готово лаб2
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-23 17:51:58 +03:00
parent 65003b6119
commit 6dbc2da1ca
47 changed files with 201807 additions and 25 deletions
+21
View File
@@ -0,0 +1,21 @@
INSERT INTO users (id, username, display_name, password_hash, created_at)
VALUES ('11111111-1111-1111-1111-111111111111', 'explain_test', 'Test', 'hash', NOW());
INSERT INTO chats (id, title, created_at)
VALUES ('22222222-2222-2222-2222-222222222222', 'Explain Chat', NOW());
INSERT INTO messages (id, chat_id, sender_id, text, created_at)
SELECT
gen_random_uuid(),
'22222222-2222-2222-2222-222222222222',
'11111111-1111-1111-1111-111111111111',
'Message ' || i,
NOW() - (i || ' minutes')::interval
FROM generate_series(1, 10000) AS i;
Команды для теста
EXPLAIN (ANALYZE, BUFFERS)
SELECT * FROM messages
WHERE chat_id = '22222222-2222-2222-2222-222222222222'
ORDER BY created_at, id
LIMIT 50;