feat:some_improvement

This commit is contained in:
Оля Мороз
2026-10-07 17:33:29 +03:00
parent 828a9f792a
commit 9773639f52
17 changed files with 620 additions and 23 deletions
+10
View File
@@ -0,0 +1,10 @@
\timing on
-- 10 000 вставок в один чат.
INSERT INTO messages (id, chat_id, sender_id, text, created_at)
SELECT
gen_random_uuid(),
(SELECT id FROM chats ORDER BY created_at LIMIT 1),
(SELECT id FROM users ORDER BY created_at LIMIT 1),
'bench ' || g,
now() - (g || ' milliseconds')::interval
FROM generate_series(1, 10000) g;