File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
firebase-firestore/src/main/java/com/google/firebase/firestore/local Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -329,11 +329,12 @@ public IndexType getIndexType(Target target) {
329
329
}
330
330
331
331
// OR queries have more than one sub-target (one sub-target per DNF term). We currently consider
332
- // all OR queries to have partial indexes, and hence do sorting and limit in post-processing.
332
+ // OR queries that have a `limit` to have a partial index. For such queries we perform sorting
333
+ // and apply the limit in memory as a post-processing step.
333
334
// TODO(orquery): If we have a FULL index *and* we have the index that can be used for sorting
334
335
// all DNF branches on the same value, we can improve performance by performing a JOIN in SQL.
335
336
// See b/235224019 for more information.
336
- if (subTargets .size () > 1 && result == IndexType .FULL ) {
337
+ if (target . hasLimit () && subTargets .size () > 1 && result == IndexType .FULL ) {
337
338
return IndexType .PARTIAL ;
338
339
}
339
340
You can’t perform that action at this time.
0 commit comments