Skip to content

Use path length to skip scanning subcollections #3192

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 13 commits into from
Dec 3, 2021

Conversation

schmidt-sebastian
Copy link
Contributor

This is a new version of #3173 that uses a "path segment count" to also skip scanning subcollections. The main benefit is that it stores less data.

@google-cla google-cla bot added the cla: yes Override cla label Nov 30, 2021
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 30, 2021

Binary Size Report

Affected SDKs

  • firebase-firestore

    Type Base (9e5c8e1) Head (adfc5ddc) Diff
    aar 1.23 MB 1.23 MB +385 B (+0.0%)
    apk (release) 3.33 MB 3.33 MB +280 B (+0.0%)

Test Logs

Notes

Head commit (adfc5ddc) is created by Prow via merging commits: 9e5c8e1 0f56227.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 30, 2021

Coverage Report

Affected SDKs

  • firebase-firestore

    SDK overall coverage changed from 45.27% (9e5c8e1) to 45.33% (adfc5ddc) by +0.05%.

    Filename Base (9e5c8e1) Head (adfc5ddc) Diff
    DeleteMutation.java 95.00% 90.00% -5.00%
    SQLiteRemoteDocumentCache.java 96.00% 95.88% -0.12%
    SQLiteSchema.java 96.27% 96.65% +0.39%
    SetMutation.java 97.14% 94.29% -2.86%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (adfc5ddc) is created by Prow via merging commits: 9e5c8e1 0f56227.


String prefixPath = EncodedPath.encode(prefix);
String prefixSuccessorPath = EncodedPath.prefixSuccessor(prefixPath);
Object[] bindVars = new Object[3 + (FieldIndex.IndexOffset.NONE.equals(offset) ? 0 : 6)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give FieldIndex.IndexOffset.NONE.equals(offset) a name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -607,6 +629,35 @@ private void rewriteCanonicalIds() {
});
}

/** Fill the remote_document's path_length column. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultranit: Fills or Populates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@wu-hui wu-hui assigned schmidt-sebastian and unassigned wu-hui Dec 3, 2021
Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review


String prefixPath = EncodedPath.encode(prefix);
String prefixSuccessorPath = EncodedPath.prefixSuccessor(prefixPath);
Object[] bindVars = new Object[3 + (FieldIndex.IndexOffset.NONE.equals(offset) ? 0 : 6)];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -607,6 +629,35 @@ private void rewriteCanonicalIds() {
});
}

/** Fill the remote_document's path_length column. */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@schmidt-sebastian schmidt-sebastian merged commit 9466242 into master Dec 3, 2021
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/pathlength branch December 3, 2021 16:46
@firebase firebase locked and limited conversation to collaborators Jan 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants