mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add index for sorting by word_count
This commit is contained in:
parent
525b3fbacf
commit
cf6f15e520
2 changed files with 15 additions and 0 deletions
6
packages/db/migrations/0157.do.library_item_user_id_word_count_idx.sql
Executable file
6
packages/db/migrations/0157.do.library_item_user_id_word_count_idx.sql
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
-- Type: DO
|
||||
-- Name: library_item_user_id_word_count_idx
|
||||
-- Description: Add library_item_user_id_word_count_idx index on library_item table for user_id and word_count
|
||||
|
||||
-- create index for sorting concurrently to avoid locking
|
||||
CREATE INDEX CONCURRENTLY IF NOT EXISTS library_item_user_id_word_count_idx ON omnivore.library_item (user_id, word_count DESC NULLS LAST);
|
||||
9
packages/db/migrations/0157.undo.library_item_user_id_word_count_idx.sql
Executable file
9
packages/db/migrations/0157.undo.library_item_user_id_word_count_idx.sql
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
-- Type: UNDO
|
||||
-- Name: library_item_user_id_word_count_idx
|
||||
-- Description: Add library_item_user_id_word_count_idx index on library_item table for user_id and word_count
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP INDEX IF EXISTS library_item_user_id_word_count_idx;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue