Skip to content

Commit

Permalink
fix: naive take on adding an index
Browse files Browse the repository at this point in the history
user_id on uploads should probably be indexed...
  • Loading branch information
drewdelano committed Jun 13, 2022
1 parent 71dbbea commit 063f885
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX IF NOT EXISTS upload_user_id_deleted_at_idx ON upload (user_id) WHERE deleted_at IS NULL
1 change: 1 addition & 0 deletions packages/db/postgres/tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ CREATE TABLE IF NOT EXISTS upload
);

CREATE INDEX IF NOT EXISTS upload_auth_key_id_idx ON upload (auth_key_id);
CREATE INDEX IF NOT EXISTS upload_user_id_deleted_at_idx ON upload (user_id) WHERE deleted_at IS NULL
CREATE INDEX IF NOT EXISTS upload_content_cid_idx ON upload (content_cid);
CREATE INDEX IF NOT EXISTS upload_updated_at_idx ON upload (updated_at);

Expand Down

0 comments on commit 063f885

Please sign in to comment.