Skip to content

Commit 8d03c8a

Browse files
authored
Rerun limit queries if a partial index is available. (#6301)
This is porting firebase/firebase-android-sdk#3657 to the Web SDK. The majority of the code was ported as a part of other PRs such as #6153. The only thing remaining is to port the tests in SQLiteLocalStoreTest.java which will be done as a part of #6261.
1 parent 9614bbd commit 8d03c8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/firestore/src/local/query_engine.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class QueryEngine {
154154
return null;
155155
}
156156

157-
if (indexType === IndexType.PARTIAL) {
157+
if (query.limit !== null && indexType === IndexType.PARTIAL) {
158158
// We cannot apply a limit for targets that are served using a partial
159159
// index. If a partial index will be used to serve the target, the
160160
// query may return a superset of documents that match the target
@@ -301,7 +301,7 @@ export class QueryEngine {
301301
* Determines if a limit query needs to be refilled from cache, making it
302302
* ineligible for index-free execution.
303303
*
304-
* @param query The query.
304+
* @param query - The query.
305305
* @param sortedPreviousResults - The documents that matched the query when it
306306
* was last synchronized, sorted by the query's comparator.
307307
* @param remoteKeys - The document keys that matched the query at the last

0 commit comments

Comments
 (0)