diff options
| author | eltrac <hi@eltr.ac> | 2026-10-24 17:50:35 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-10-24 18:17:08 +0800 |
| commit | c54bece1a02a6ade615492f09792c17c75b69c95 (patch) | |
| tree | f597074bff0f9f632be6ff6a0a7ddf7a798a9939 /resources/sql/h2_init.sql | |
| parent | ad1261436f9a6f2ecdf9ba548349ca1dc4345436 (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/h2_init.sql')
| -rw-r--r-- | resources/sql/h2_init.sql | 8 |
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); |
