-
Notifications
You must be signed in to change notification settings - Fork 38
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
Increased "search update" reads after #175 #178
Comments
So, in about 5 hours of minutely It's interesting that although none of the _delete_from_search queries deleted anything, and all of them had 10356 reads, 35 out of 304 are reported as having read 0 bytes. Maybe related to this, on a VirtualBox VM with roughly the same OS (Ubuntu 18.04), all the queries reported reading 0 bytes; per this answer, it may have to do with the underlying storage.
|
This gist has output from The _delete_from_search The _insert_into_search_one_chunk #143 would result in analyze being run regularly; alternatively, we could force a particular join order using CROSS JOIN. |
From 2 hours of logs after deploying the changes above:
|
I ran Update: For 11 hours since then:
|
After resolving #175, I started seeing increased
search update
reads, leading to the EBS burst balance being exhausted on the 4GB volume where I have reader deployed.search update
is disabled)While this is not necessarily a bug, it is a regression (and reader should support my current use case).
I continue to suspect the increased number of
delete from entries_search
queries as the root cause for this (each query results in an entries_search scan). I'll have to confirm this by measuring.After a bit of thinking, this can probably be fixed by storing the rowids of the entries_search rows corresponding to an entry in entry_search_sync_state; queries by rowid should use an index, unlike those for any of the other columns (virtual tables can't have indexes).
One can get the rowid of the last insert by using the last_insert_rowid function. However, this will require us to bump the minimum SQLite version from 3.15 to 3.18 (last_insert_rowid works correctly for FTS5 tables only starting with 3.18). It shouldn't be an issue, since an up-to-date Ubuntu 18.04 (my main/oldest deployment target) seems to have at least 3.22). We should probably still allow using 3.15 if search is not enabled.
Another thing we could explore is to increase the page_size (the SQLite defaults may not be optimized for SSDs/EBS), but we should probably fix the code first.
The text was updated successfully, but these errors were encountered: