mirror of
https://github.com/block/buzz.git
synced 2026-10-27 20:41:57 +00:00
db: drop idx_thread_metadata_root, a prefix of idx_thread_metadata_window
With both indexes the planner can read a thread's latest reply through the narrower one and sort every reply. On a 20k-reply thread that cost 28ms of the sidebar; through the window index it is one probe (0.76ms). Signed-off-by: hMB2 <0400eb0da32afbbf16cdd1dee6ffd243587e8f3d6a2823fe7dfa95d16b002b7d@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -576,7 +576,6 @@ CREATE TABLE thread_metadata (
|
||||
);
|
||||
|
||||
CREATE INDEX idx_thread_metadata_parent ON thread_metadata (community_id, parent_event_id);
|
||||
CREATE INDEX idx_thread_metadata_root ON thread_metadata (community_id, root_event_id);
|
||||
CREATE INDEX idx_thread_metadata_window
|
||||
ON thread_metadata (community_id, root_event_id, event_created_at DESC, event_id ASC);
|
||||
CREATE INDEX idx_thread_metadata_channel_depth
|
||||
|
||||
Reference in New Issue
Block a user