Why not load SearchIndex from cache on delete/vacuum and Writer BGW? #1619
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@softhuafei, thank you for taking the time to review our codebase! We always appreciate suggestions for performance improvements. While you're correct that there's overhead to loading the index reader/writer from disk, I think in this case the impact is negligible. Operations that mutate the index are only ever performed from the dedicated background writer process (you can see how it's initialized in The design of the background writer process currently only allows a single connection to mutate a writer at a time. We are working to change this to make concurrent writes possible, and that will require more sophisticated loading/unloading of writer instances. When that time comes I think your observation will be relevant, and we will make sure the writer initialization is optimized. |
Beta Was this translation helpful? Give feedback.
@softhuafei, thank you for taking the time to review our codebase! We always appreciate suggestions for performance improvements. While you're correct that there's overhead to loading the index reader/writer from disk, I think in this case the impact is negligible.
Operations that mutate the index are only ever performed from the dedicated background writer process (you can see how it's initialized in
lib.rs
), and the writer instance is cached in memory after being loaded. The cost of initializing the writer is only paid once.The design of the background writer process currently only allows a single connection to mutate a writer at a time. We are working to change this to make concurrent…