I used to update my main View before every query (as it’s done by default) but recently I switched to a faster method by updating the view periodically in the background and not before every query.
This resulted in faster queries, except during the times the view is actually getting updated. It seems like the queries and View indexing are processed in the same thread.
I was wondering if there is a way of always querying a view’s last index instead of waiting for it to update its index.
My database can be very change-heavy and it needs to stay updated, but search speed is priority number 1. In other words, I don’t care if the results of a query aren’t updated with the latest docs for a few minutes as long as the queries are fast.
Hm, I would expect that you could query a view via one database instance while another instance is updating the index. SQLite allows reads while another connection is in the midst of a transaction. I know we changed the iOS/Mac codebase at one point, 1.4 or earlier, to support this. It’s possible that Android doesn’t have similar logic and is blocking reads even when it doesn’t have to? Unfortunately I’m not familiar with the Android codebase.