Files
mtusi2026labs/evidence/track1/compare/before-8x1_rate5400_rep3/pg_statements.csv
T
ArtyomandClaude Opus 5.5 dde113b4ed Record the before and after comparison of track 1
8x1 with the image of edc091d (before) and the one-statement write
(after), alternating per repeat, three repeats at 3 600, 5 400 and
8 100 rps. At 3 600 rps, below the knee, p95 falls from 64.5 ms
(35.7..142.5) to 3.7 ms (2.8..5.4) and p99 from 122 to 13 ms; the API
spends 391 instead of 457 % CPU and PostgreSQL 102 instead of 137 %;
connections waiting for a chat lock drop from 12.8 to 0.15 and none is
idle in transaction any more. Past the knee the peak rises from 4 252
(4 054..4 396) to 4 894 rps (4 494..5 104), +15 %, and at 8 100 rps
from 4 104 to 4 841 (+18 %); the ranges do not overlap. Saturated, the
lock holders now wait for the WAL flush (LWLock WALWrite) instead of
the application.

The switch to the after image for the third repeat failed in compose
while another lab was running tests on the shared VM, so that repeat
was run alone with --first-repeat 3 on the same database; apply now
retries compose up twice and prints its stderr. Two after rows were
still marked disturbed after three reruns and are kept; they are the
lower ones.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
2026-10-29 01:37:34 +03:00

2.5 KiB

1callstotal_msmean_msrowsshared_blks_hitshared_blks_readquery
21388151946754.44514.02413881527872770SELECT c.id, c.title, c.created_at, c.last_message_at, ARRAY(SELECT user_id FROM chat_members WHERE chat_id = c.id ORDER BY position) AS member_ids FROM chats c WHERE c.id = $1 FOR UPDATE
313204619631.3020.1491320465110788165WITH message AS ( INSERT INTO messages (id, chat_id, sender_id, text, created_at) VALUES ($1, $2, $3, $4, $5) RETURNING id, chat_id, sender_id, created_at ), receipt AS ( INSERT INTO idempotency_keys
41388152021.5430.01505552600SELECT k.fingerprint, m.id, m.chat_id, m.sender_id, m.text, m.created_at FROM idempotency_keys k JOIN messages m ON m.id = k.message_id WHERE k.chat_id = $1 AND k.user_id = $2 AND k.key = $3 AND k.cre
5343002019.1280.059174654919008250SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id = $1 ORDER BY created_at, id LIMIT $2
667691101.9120.16367692617121WITH message AS ( INSERT INTO messages (id, chat_id, sender_id, text, created_at) VALUES ($1, $2, $3, $4, $5) RETURNING id, chat_id, sender_id, created_at ), receipt AS ( INSERT INTO idempotency_keys
7343001050.2900.031343002991750SELECT c.id, c.title, c.created_at, ARRAY(SELECT user_id FROM chat_members WHERE chat_id = c.id ORDER BY position) AS member_ids FROM chat_members m JOIN chats c ON c.id = m.chat_id WHERE m.chat_id =
8207901785.9620.004000RESET ALL
9207901294.3240.00120790100SELECT pg_advisory_unlock_all()
1020790139.5340.000000CLOSE ALL
1113886535.2510.000000COMMIT
1220790128.3400.000000UNLISTEN *
1313886523.2160.000000BEGIN
14202.0870.104202720WITH expired AS (DELETE FROM sessions WHERE user_id = $2 AND expires_at <= $3) INSERT INTO sessions (token_hash, user_id, created_at, expires_at) VALUES ($1, $2, $3, $4)
15201.9310.097201760INSERT INTO users (id, username, display_name, password_hash, created_at) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (username) DO NOTHING RETURNING true
16101.5230.152203440INSERT INTO chat_members (chat_id, user_id, position, chat_created_at) SELECT $1, member.user_id, member.position, $3 FROM unnest($2::uuid[]) WITH ORDINALITY AS member (user_id, position)
173950.4740.00139500SELECT 1
18200.4270.02120600SELECT id, username, display_name, password_hash, created_at FROM users WHERE username = $1
19210.2740.01321630SELECT token_hash, user_id, created_at, expires_at FROM sessions WHERE token_hash = $1 AND expires_at > $2
20100.2290.02310230INSERT INTO chats (id, title, created_at) VALUES ($1, $2, $3)