summaryrefslogtreecommitdiff
path: root/resources/sql
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-24 17:50:35 +0800
committereltrac <hi@eltr.ac>2026-10-24 18:17:08 +0800
commitc54bece1a02a6ade615492f09792c17c75b69c95 (patch)
treef597074bff0f9f632be6ff6a0a7ddf7a798a9939 /resources/sql
parentad1261436f9a6f2ecdf9ba548349ca1dc4345436 (diff)
storage/h2: optimize H2 database performance
- use LEFT JOIN instead of making multiple queries - put insert/update inside transactions - add indexes - fix configuration description
Diffstat (limited to 'resources/sql')
-rw-r--r--resources/sql/h2_init.sql8
1 files changed, 8 insertions, 0 deletions
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);