File tree Expand file tree Collapse file tree
drizzle/20260830122645_posts-url-index Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,35 @@ To be released.
8080[ #549 ] : https://github.com/fedify-dev/hollo/issues/549
8181
8282
83+ Version 0.9.17
84+ --------------
85+
86+ Released on August 30, 2026.
87+
88+ - Fixed status URL searches timing out on installations with large posts
89+ tables by adding a partial hash index on ` posts.url ` . On large
90+ installations, create the index before upgrading to avoid blocking writes
91+ during the automatic migration:
92+
93+ ~~~~ sql
94+ CREATE INDEX CONCURRENTLY posts_url_index
95+ ON posts USING hash (url)
96+ WHERE url IS NOT NULL ;
97+ ~~~~
98+
99+ If this concurrent build fails or is interrupted, PostgreSQL can leave an
100+ invalid index behind. Drop it and retry the command above before
101+ upgrading:
102+
103+ ~~~~ sql
104+ DROP INDEX CONCURRENTLY IF EXISTS posts_url_index;
105+ ~~~~
106+
107+ [[# 596]]
108+
109+ [# 596]: https://github.com/fedify-dev/hollo/issues/596
110+
111+
83112Version 0 .9 .16
84113-- ------------
85114
Original file line number Diff line number Diff line change 1+ -- CONCURRENTLY omitted: Drizzle migrator wraps pending PostgreSQL migrations
2+ -- in a transaction, and CREATE INDEX CONCURRENTLY cannot run inside one.
3+ -- Large installations can pre-create this index with CONCURRENTLY before
4+ -- deployment; IF NOT EXISTS makes this step a no-op after a successful build.
5+ CREATE INDEX IF NOT EXISTS " posts_url_index"
6+ ON " posts" USING hash (" url" )
7+ WHERE (" url" IS NOT NULL );
8+ -- > statement-breakpoint
9+ DO $$ BEGIN
10+ IF NOT EXISTS (
11+ SELECT 1
12+ FROM pg_catalog .pg_index AS idx
13+ JOIN pg_catalog .pg_class AS relation
14+ ON relation .oid = idx .indexrelid
15+ JOIN pg_catalog .pg_am AS access_method
16+ ON access_method .oid = relation .relam
17+ WHERE relation .oid = ' public.posts_url_index' ::regclass
18+ AND idx .indrelid = ' public.posts' ::regclass
19+ AND idx .indisvalid
20+ AND idx .indnkeyatts = 1
21+ AND pg_get_indexdef(relation .oid , 1 , false) = ' url'
22+ AND access_method .amname = ' hash'
23+ ) THEN
24+ RAISE EXCEPTION ' posts_url_index is missing or invalid' ;
25+ END IF;
26+ END $$;
You can’t perform that action at this time.
0 commit comments