-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support _deleted selector in RxDB queries #18
Changes from all commits
8ea48cb
2b519ea
aee429d
0c309e3
d89783a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
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.
I can't quite remember, but do we need to specifically handle
count
operations for any selector that contains a true-like value for_deleted
and supports counting via an index (fast count). Or is_deleted
always a slow count?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.
Pseudo code
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.
This is a good point that I have not tested yet. Could I verify this by using the field that Tristan mentioned here
'rxdbOnly.indexFields.triage_status_exists'
and then check the correct count?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.
Yeah… I think this could work, but it is also possible that the query planner “sees” the
_deleted
field in the selector, and just skips finding the best index, because it is an “unknown field” for the query planner. If you userxdbOnly.indexFields.triage_status_exists
and it actually picks up this index, you can potentially log the usage. https://github.com/readwiseio/rekindled/blob/ac42918be6d214fab78344a115405c9bc39ab3b7/reading-clients/shared/database/internals/storages/storage-sqlite/sqlite-storage-instance.ts#L360 for mobile, you could add aconsole.log
and check which index is picked. It is possible though that no index, which results in RxDB to fall back to the default (this should beid
).