Add SQLite indexes for contenus page language/tag queries + WIP: Peertube orphans, dialogs, contact decoupling, context note, finality types

This commit is contained in:
Pontoporeia
2026-06-21 13:33:55 +02:00
parent 0d5e9dac19
commit 03c9c3566f
38 changed files with 1432 additions and 333 deletions

View File

@@ -0,0 +1,16 @@
-- 041: Add index on thesis_languages(language_id) for contenus page performance.
--
-- The contenus page queries getAllLanguagesWithCount() and searchLanguages() join
-- languages → thesis_languages on language_id. SQLite's PRIMARY KEY on
-- (thesis_id, language_id) cannot optimize a lookup by language_id alone, so
-- it builds an AUTOMATIC COVERING INDEX per query. This persisted index
-- removes that overhead.
--
-- Also adds a covering index on tags(deleted_at, name) to accelerate
-- getAllTagsWithCount() and searchTags() ORDER BY clauses (avoiding temp B-tree).
CREATE INDEX IF NOT EXISTS idx_thesis_languages_language
ON thesis_languages(language_id);
CREATE INDEX IF NOT EXISTS idx_tags_deleted_name
ON tags(deleted_at, name);