From c54bece1a02a6ade615492f09792c17c75b69c95 Mon Sep 17 00:00:00 2001 From: eltrac Date: Sat, 24 Oct 2026 17:50:35 +0800 Subject: storage/h2: optimize H2 database performance - use LEFT JOIN instead of making multiple queries - put insert/update inside transactions - add indexes - fix configuration description --- resources/sql/h2_init.sql | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'resources/sql/h2_init.sql') diff --git a/resources/sql/h2_init.sql b/resources/sql/h2_init.sql index 2ca12bd..475987f 100644 --- a/resources/sql/h2_init.sql +++ b/resources/sql/h2_init.sql @@ -30,3 +30,11 @@ create table if not exists proxied_photo ( references webmention(id) on delete cascade ); + +create index idx_webmention_hash on webmention (hash); + +create index idx_webmention_pair on webmention (wm_source, wm_target); + +create index idx_webmention_domain on webmention (wm_target_domain); + +create index idx_webmention_uri on webmention (wm_target_domain, wm_target_path); -- cgit v1.2.3