Replies: 1 comment
-
Thanks for the report! It looks like you're listening to the 9000 queries in parallel - why? Calling sqlite3 can only work one query at a time (it is synchronous), so drift will queue up pending queries and run them in order. So if you schedule many queries and then another one, it will have to wait for those initial streams to fetch their initial data first. It's somewhat surprising that 9000 selects take a couple seconds to complete (if you can share the full repository for me to take a look at, I can profile this further), but queries being run in the order in which they were scheduled is intended. Do you have 9000 |
Beta Was this translation helpful? Give feedback.
-
Hi,
I made a sample application where I have 2 tables
Notes
andSubNotes
where the relationship is that a note can have one or many subnotes and created sample data around 9000 records inNotes
and 2 records for each note inSubNote
(18000 records).After I create a stream to watch all Notes
I click a button which then creates SubNote streams for each of all the 9000 notes
Immediately after this if I try to perform another query that is not cached it takes a few seconds to complete.
I think the SubNote watch stream queries are not all executed yet and only after that , the query that I made latest is executed.
I'm using Drift Isolate and in my main Application I switch between different features where I create many such watch streams and while switching I cancel the subscriptions so the queries are not cached.
Is there a way to make this quicker and not wait till all the watch queries are executed ?
Thank you.
In this clip, loading ToDos takes a few seconds to load after loading the subnotes.
Screen.Recording.2023-01-11.at.5.25.57.PM.mov
Beta Was this translation helpful? Give feedback.
All reactions