Skip to content

Commit c9f8ebd

Browse files
committed
QL: Remove redundant conjunct in aggregates.
1 parent 375de59 commit c9f8ebd

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

ql/ql/src/queries/performance/LargeJoinOrder.ql

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,11 @@ predicate hasDuplication(
7676

7777
predicate hasDuplication(ComputeRecursive recursive, string ordering, int i, float duplication) {
7878
duplication =
79-
max(SummaryEvent inLayer, int iteration, int dup |
80-
inLayer = getInLayerOrRecursive(recursive) and
81-
hasDuplication(recursive, ordering, inLayer, iteration, i, dup)
82-
|
83-
dup
84-
)
79+
max(int iteration, int dup | hasDuplication(recursive, ordering, _, iteration, i, dup) | dup)
8580
}
8681

8782
/**
8883
* Holds if the ordering `ordering` has `resultSize` resultSize in the `iteration`'th iteration.
89-
*
90-
* For example, the "base" ordering in iteration 0 has size 42.
9184
*/
9285
private predicate hasResultSize(
9386
ComputeRecursive recursive, string ordering, SummaryEvent inLayer, int iteration, float resultSize
@@ -109,12 +102,7 @@ private predicate hasResultSize(
109102

110103
predicate hasResultSize(ComputeRecursive recursive, string ordering, float resultSize) {
111104
resultSize =
112-
strictsum(InLayer inLayer, int iteration, float r |
113-
inLayer.getComputeRecursiveEvent() = recursive and
114-
hasResultSize(recursive, ordering, inLayer, iteration, r)
115-
|
116-
r
117-
)
105+
strictsum(int iteration, float r | hasResultSize(recursive, ordering, _, iteration, r) | r)
118106
}
119107

120108
RAParser<PipeLine>::RAExpr getAnRaOperation(SummaryEvent inLayer, string ordering) {
@@ -221,9 +209,8 @@ predicate hasDependentPredicateSize(
221209
ComputeRecursive recursive, string ordering, string predicateName, float size
222210
) {
223211
size =
224-
strictsum(SummaryEvent inLayer, int iteration, int s |
225-
inLayer = getInLayerOrRecursive(recursive) and
226-
hasDependentPredicateSize(recursive, ordering, inLayer, iteration, predicateName, s)
212+
strictsum(int iteration, float s |
213+
hasDependentPredicateSize(recursive, ordering, _, iteration, predicateName, s)
227214
|
228215
s
229216
)

0 commit comments

Comments
 (0)