optimize the batch update script to use index by adding order by user_id

This commit is contained in:
Hongbo Wu 2024-08-05 15:34:56 +08:00
parent f467681189
commit 431640605f

View file

@ -23,6 +23,7 @@ def batch_update_library_items(conn):
SELECT ctid
FROM omnivore.library_item
WHERE original_content IS NOT NULL
ORDER BY user_id
LIMIT {batch_size}
)
""")