add index for sorting by published_at
This commit is contained in:
6
packages/db/migrations/0155.do.library_item_user_id_published_at_idx.sql
Executable file
6
packages/db/migrations/0155.do.library_item_user_id_published_at_idx.sql
Executable file
@ -0,0 +1,6 @@
|
||||
-- Type: DO
|
||||
-- Name: library_item_user_id_published_at_idx
|
||||
-- Description: Add library_item_user_id_published_at_idx index on library_item table for user_id and published_at
|
||||
|
||||
-- create index for sorting concurrently to avoid locking
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS library_item_user_id_updated_at_idx ON omnivore.library_item (user_id, updated_at DESC NULLS LAST);
|
||||
@ -0,0 +1,9 @@
|
||||
-- Type: UNDO
|
||||
-- Name: library_item_user_id_published_at_idx
|
||||
-- Description: Add library_item_user_id_published_at_idx index on library_item table for user_id and published_at
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP INDEX IF EXISTS library_item_user_id_published_at_idx;
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user