Skip to content

Commit

Permalink
Fix index for hashed video id dearrow fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Jan 9, 2024
1 parent 0edf0b9 commit 7aaf000
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions databases/_sponsorTimes_indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ CREATE INDEX IF NOT EXISTS "titles_videoID"
("videoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST)
TABLESPACE pg_default;

CREATE INDEX IF NOT EXISTS "titles_hashedVideoID"
CREATE INDEX IF NOT EXISTS "titles_hashedVideoID_2"
ON public."titles" USING btree
("hashedVideoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST)
(service COLLATE pg_catalog."default" ASC NULLS LAST, "hashedVideoID" text_pattern_ops ASC NULLS LAST, "timeSubmitted" ASC NULLS LAST)
TABLESPACE pg_default;

-- titleVotes
Expand All @@ -163,9 +163,9 @@ CREATE INDEX IF NOT EXISTS "thumbnails_videoID"
("videoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST)
TABLESPACE pg_default;

CREATE INDEX IF NOT EXISTS "thumbnails_hashedVideoID"
CREATE INDEX IF NOT EXISTS "thumbnails_hashedVideoID_2"
ON public."thumbnails" USING btree
("hashedVideoID" COLLATE pg_catalog."default" ASC NULLS LAST, "service" COLLATE pg_catalog."default" ASC NULLS LAST)
(service COLLATE pg_catalog."default" ASC NULLS LAST, "hashedVideoID" text_pattern_ops ASC NULLS LAST, "timeSubmitted" ASC NULLS LAST)
TABLESPACE pg_default;

-- thumbnailVotes
Expand Down
8 changes: 8 additions & 0 deletions databases/_upgrade_sponsorTimes_40.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BEGIN TRANSACTION;

DROP INDEX IF EXISTS "titles_hashedVideoID";
DROP INDEX IF EXISTS "thumbnails_hashedVideoID";

UPDATE "config" SET value = 40 WHERE key = 'version';

COMMIT;

0 comments on commit 7aaf000

Please sign in to comment.