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.
This commit is contained in:
Joscha 2023-08-05 12:31:17 +02:00
parent 523b82632f
commit 3bfeb89686

View file

@ -17,3 +17,9 @@ CREATE TABLE tracked_refs (
hash TEXT NOT NULL, hash TEXT NOT NULL,
FOREIGN KEY (hash) REFERENCES commits (hash) ON DELETE CASCADE FOREIGN KEY (hash) REFERENCES commits (hash) ON DELETE CASCADE
) STRICT; ) 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);