You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Search index keeps the old entries of every re-indexed message #149
After the one-off message_search_names re-index (0.11.0, #93), the search index of a real account cache (1.16M messages) still holds the old entry of every message next to the new one: deletemerge=0 keeps deleted rows until a merge, and no merge comes. Measured on a copy of that cache:
now
after FTS5 optimize
index data (message_search_data)
263 MB, 20 segments
125 MB, 1 segment
asking the index whether one message matches
2.2–4.6 ms
5–7 µs
newest page of a word in 19% of messages (sorted)
205 ms
173 ms
optimize took 3.2 s at 1.16M messages, in one write transaction.
Effects:
The cache is about 140 MB larger than it needs to be.
Proposal: merge the index in small steps in the background (daemon and tg db migrate, like the background migrations), after a re-index and whenever deleted rows pile up; this also covers the merge spikes of #142. Then retune the walk of #118 for a merged index, or bound it by measured time instead of a fixed threshold.
Activity
docs(storage): numbers of the merged search index and the new walk
docs(storage): numbers of the merged search index and the new walk