лаба на 5
Skeleton contracts / contracts (pull_request) Failing after 34s

This commit is contained in:
2026-10-08 02:29:37 +03:00
parent a2e8ca2817
commit 173455c94e
13 changed files with 752 additions and 79 deletions
+57
View File
@@ -0,0 +1,57 @@
\set ON_ERROR_STOP on
\timing on
\echo '=== Grade 5: write overhead comparison ==='
\echo '=== Index A: insert 10000 messages ==='
BEGIN;
INSERT INTO bench_index_a (
id, chat_id, sender_id, text, created_at
)
SELECT
(
lpad(to_hex(200000 + g), 8, '0') ||
'-0000-4000-8000-' ||
lpad(to_hex(200000 + g), 12, '0')
)::uuid,
'66666666-6666-4666-8666-666666666661'::uuid,
'55555555-5555-4555-8555-555555555555'::uuid,
'Grade 5 write benchmark ' || g,
'2026-02-01 00:00:00+00'::timestamptz
+ g * interval '1 millisecond'
FROM generate_series(1, 10000) AS g;
ROLLBACK;
\echo '=== Index B: insert 10000 messages ==='
BEGIN;
INSERT INTO bench_index_b (
id, chat_id, sender_id, text, created_at
)
SELECT
(
lpad(to_hex(200000 + g), 8, '0') ||
'-0000-4000-8000-' ||
lpad(to_hex(200000 + g), 12, '0')
)::uuid,
'66666666-6666-4666-8666-666666666661'::uuid,
'55555555-5555-4555-8555-555555555555'::uuid,
'Grade 5 write benchmark ' || g,
'2026-02-01 00:00:00+00'::timestamptz
+ g * interval '1 millisecond'
FROM generate_series(1, 10000) AS g;
ROLLBACK;
\echo '=== Verify unchanged row counts ==='
SELECT 'A' AS variant, COUNT(*) FROM bench_index_a
UNION ALL
SELECT 'B', COUNT(*) FROM bench_index_b;