From 3bfeb89686d4b23c14afe3db957d7de48e67df64 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 5 Aug 2023 12:31:17 +0200 Subject: [PATCH] Add indices for slightly better performance With the linux kernel commits, this reduced the time to update commit tracked flags from >60s to 44s, but this requires further testing before committing to the indices. --- migrations/20230805101911_commits.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migrations/20230805101911_commits.sql b/migrations/20230805101911_commits.sql index 67aed59..4c215c8 100644 --- a/migrations/20230805101911_commits.sql +++ b/migrations/20230805101911_commits.sql @@ -17,3 +17,9 @@ CREATE TABLE tracked_refs ( hash TEXT NOT NULL, FOREIGN KEY (hash) REFERENCES commits (hash) ON DELETE CASCADE ) STRICT; + +CREATE INDEX idx_commit_links_child_parent +ON commit_links(child, parent); + +CREATE INDEX idx_commit_links_parent_child +ON commit_links(parent, child);