OAK-12057 - Select same plan with or without LIMIT option#2722
OAK-12057 - Select same plan with or without LIMIT option#2722thomasmueller merged 2 commits intoapache:OAK-12057from
Conversation
| if (sortOrder == null || p.getSortOrder() != null) { | ||
| // if the query is unordered, or | ||
| // if the query contains "order by" and the index can sort on that, | ||
| // then we don't need to read all entries from the index | ||
| entryCount = Math.min(maxEntryCount, entryCount); | ||
| } |
There was a problem hiding this comment.
@thomasmueller This is the part that leads to the change in costs of the broken test
f7907ec to
6e5104a
Compare
| String query = "SELECT * FROM [rep:Authorizable] WHERE [rep:principalName] = 'anonymous'"; | ||
| session.getLatestRoot().getQueryEngine().executeQuery(query, JCR_SQL2, 1, 0, null, null); | ||
|
|
||
| boolean evaluationContinueLogPresent = false; |
There was a problem hiding this comment.
I simplified the test a bit to reduce it to one explicit query rather than 3 implicit with one of them generating the expected log entries.
(It's in a separate commit so that we can check that it passed before, and that now it no longer passes)
6e5104a to
0dec652
Compare
| QueryIndex index = queryIndexes.get(i); | ||
| double minCost = index.getMinimumCost(); | ||
| if (minCost > bestCost) { | ||
| if (Math.abs(minCost - bestIndex.getMinimumCost()) < .00001) { |
There was a problem hiding this comment.
Concerning the broken test.
I've try to look into this a bit deeper. In the original case, as there was a limit of 1 so the best cost of test-index1 up around the minimal cost of test-index3 with the latter still bigger than the former but then passing through this if.
Currently, dropping the limit all indices are evaluated as their minCost is definitely below the bestCost.
So, I wondering, is the scenario that lead to this situation still valid ? If so, what case would that be and how to simulate it ?
There was a problem hiding this comment.
I'll check. Maybe the test needs to be changed.
0dec652 to
e1108ed
Compare
|
Merging it, but only into the branch |
No description provided.