Skip to content

Rerun limit queries if a partial index is used. #6301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/firestore/src/local/query_engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class QueryEngine {
return null;
}

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