mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
Add bulk import optimization: track_lookup cache, batch inserts, BulkSubmitter
This commit is contained in:
parent
0ec7b458cc
commit
ae373a7090
21 changed files with 1296 additions and 125 deletions
15
db/migrations/000006_track_lookup.sql
Normal file
15
db/migrations/000006_track_lookup.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
-- +goose Up
|
||||
CREATE TABLE track_lookup (
|
||||
lookup_key TEXT NOT NULL PRIMARY KEY,
|
||||
artist_id INT NOT NULL REFERENCES artists(id) ON DELETE CASCADE,
|
||||
album_id INT NOT NULL REFERENCES releases(id) ON DELETE CASCADE,
|
||||
track_id INT NOT NULL REFERENCES tracks(id) ON DELETE CASCADE,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX idx_track_lookup_track_id ON track_lookup(track_id);
|
||||
CREATE INDEX idx_track_lookup_artist_id ON track_lookup(artist_id);
|
||||
CREATE INDEX idx_track_lookup_album_id ON track_lookup(album_id);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE IF EXISTS track_lookup;
|
||||
Loading…
Add table
Add a link
Reference in a new issue