Skip to content
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

feat: Optimize reactive queries - tweak query results based change streams instead of re-running them (use EventReduce?) #1021

Open
beorn opened this issue Oct 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@beorn
Copy link
Contributor

beorn commented Oct 9, 2024

Currently it seems that all queries are re-run when changes happen, which can be very slow both locally and result in additional queries to the remote server (in the case of AutoFetchCollection).

RxDB implements an Event Reduce algorithm that updates query results based on database change events, which is more optimal. This will allow much more expensive and long persisted remote queries in AutoFetchCollection (since they don't have to be re-run all the time), and presumably more efficient reactivity updates internally too.

@beorn beorn changed the title feat: Support Event-Reduce to optimize reactive queries feat: Optimize reactive queries based on change streams (use EventReduce?) Oct 9, 2024
@beorn beorn changed the title feat: Optimize reactive queries based on change streams (use EventReduce?) feat: Optimize reactive queries - tweak query results based change streams instead of re-running them (use EventReduce?) Oct 9, 2024
@maxnowack
Copy link
Owner

Good idea! PR appreciated!
For the AutoFetchCollection it wouldn't change that much, as queries only being registered at the first run and unregistered when the reactive scope is disposed. Reruns of queries shouldn't trigger a new registering/fetching from the server.

@maxnowack maxnowack added the enhancement New feature or request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants