forked from mtusi2026/mtusi2026lab4
ЛР4: S3-вложения, приватный bucket и согласованность хранилищ (трек 2)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- Indexes justified by the two keyset queries of the contract.
|
||||
--
|
||||
-- Message history:
|
||||
-- WHERE chat_id = $1 AND (created_at, id) > ($2, $3)
|
||||
-- ORDER BY created_at, id LIMIT $4
|
||||
-- The three-column index lets PostgreSQL start at the cursor position inside
|
||||
-- one chat instead of scanning the whole history for every page.
|
||||
CREATE INDEX messages_chat_created_id_idx
|
||||
ON messages (chat_id, created_at, id);
|
||||
|
||||
-- Chat list:
|
||||
-- ORDER BY created_at, id LIMIT $1
|
||||
-- after joining chat_members for the current user.
|
||||
CREATE INDEX chats_created_id_idx
|
||||
ON chats (created_at, id);
|
||||
Reference in New Issue
Block a user