-
Notifications
You must be signed in to change notification settings - Fork 627
Index Evaluation #2963
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
Index Evaluation #2963
Conversation
Coverage ReportAffected SDKs
Test Logs
NotesHTML coverage reports can be produced locally with Head commit (6c576b9d) is created by Prow via merging commits: 191700a adbac78. |
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (6c576b9d) is created by Prow via merging commits: 191700a adbac78. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good.
I will do another review for comments and code structure later.
...base-firestore/src/test/java/com/google/firebase/firestore/local/SQLiteIndexManagerTest.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/index/IndexEntry.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Outdated
Show resolved
Hide resolved
firebase-firestore/src/main/java/com/google/firebase/firestore/local/SQLiteIndexManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one test I cannot find, but LGTM anyways.
@@ -176,6 +176,8 @@ public void addIndexEntries(Document document) { | |||
if (fieldIndex == null) return null; | |||
|
|||
Bound lowerBound = target.getLowerBound(fieldIndex); | |||
String lowerBoundOp = lowerBound.isBefore() ? ">=" : ">"; // `startAt()` versus `startAfter()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but what do you think about changing isBefore
to isIncluded
?
This way we can do lower.isIncluded ? ">=" : ">"
and upper.isIncluded ? "<=" : "<"
. We need to change this everywhere and still keep the API for startAt
and startAfter
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brian is also confused about this (so am I). I will send a follow-up PR to do a rename.
This PR adds the code that is needed to add documents to the Index and to run queries against the Index.
Couple changes from previous PRs: