feat: implement persistent messenger with PostgreSQL and Redis
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
sashadugina06
2026-10-30 14:02:09 +03:00
parent 65003b6119
commit bd34c1050a
40 changed files with 2879 additions and 24 deletions
+40
View File
@@ -0,0 +1,40 @@
\set ON_ERROR_STOP on
\timing on
BEGIN;
DROP INDEX IF EXISTS idx_messages_chat_created_id;
DROP INDEX IF EXISTS idx_messages_chat_id_only;
\echo 'WRITE WITHOUT SECONDARY INDEXES'
EXPLAIN (ANALYZE, BUFFERS)
INSERT INTO messages (id, chat_id, sender_id, text)
SELECT
gen_random_uuid(),
c.id,
c.created_by,
'Write benchmark without index'
FROM chats c
CROSS JOIN generate_series(1, 10000)
LIMIT 10000;
ROLLBACK;
BEGIN;
CREATE INDEX IF NOT EXISTS idx_messages_chat_id_only ON messages (chat_id);
\echo 'WRITE WITH EXISTING INDEXES'
EXPLAIN (ANALYZE, BUFFERS)
INSERT INTO messages (id, chat_id, sender_id, text)
SELECT
gen_random_uuid(),
c.id,
c.created_by,
'Write benchmark with index'
FROM chats c
CROSS JOIN generate_series(1, 10000)
LIMIT 10000;
ROLLBACK;