File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
firebase-firestore/src/main/java/com/google/firebase/firestore/local Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -143,13 +143,13 @@ private boolean needsRefill(
143
143
return false ;
144
144
}
145
145
146
- // Limit queries are not eligible for index-free query execution if an older document from cache
147
- // may sort before a document that was previously part of the limit. This can happen if the last
148
- // document of the limit could sort lower than it did when the query was last synchronized. To
149
- // verify this, we use the query's comparator to determine the last document that fit the
150
- // limit. If the last document was edited after the query was last synchronized, there is a
151
- // chance that another document from cache sorts higher, in which case we have to perform a full
152
- // cache scan .
146
+ // Limit queries are not eligible for index-free query execution if there is a potential that an
147
+ // older document from cache now sorts before a document that was previously part of the limit.
148
+ // This, however, can only happen if the last document of the limit sorts lower than it did when
149
+ // the query was last synchronized. If a document that is not the limit boundary sorts
150
+ // differently, the boundary of the limit itself did not change and documents from cache will
151
+ // continue to be "rejected" by the boundary. Therefore, we can ignore any modifications that
152
+ // don't affect the last document .
153
153
Document lastDocumentInLimit = sortedPreviousResults .getMaxEntry ();
154
154
return lastDocumentInLimit .hasPendingWrites ()
155
155
|| lastDocumentInLimit .getVersion ().compareTo (limboFreeSnapshotVersion ) > 0 ;
You can’t perform that action at this time.
0 commit comments