docs: record unit-of-work evidence and report

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 00:34:03 +03:00
co-authored by Claude Opus 5.5
parent 6ba74b18f3
commit 952c16350e
127 changed files with 16540 additions and 414 deletions
@@ -0,0 +1,673 @@
# План запроса истории: размер 10k
Commit b2fb88f
Читаемый чат — 10000 сообщений; фоновые чаты: 2 × 1k, 10 × 100, 50 × 10.
Страница — `limit` профиля; «после» — сколько сообщений чата до
страницы.
## Планы приложения
auto_explain (ANALYZE, BUFFERS, TIMING): запрос, параметры и план,
с которыми его выполнило приложение (prepared statement asyncpg).
### read 10k: first, после 0
duration: 0.166 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = 'a15252a7-4b4d-4826-b9af-d40b3f396740', $2 = '51'
Limit (cost=0.29..9.63 rows=51 width=153) (actual time=0.040..0.132 rows=51.00 loops=1)
Buffers: shared hit=18
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1832.72 rows=10000 width=153) (actual time=0.038..0.128 rows=51.00 loops=1)
Index Cond: (chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid)
Index Searches: 1
Buffers: shared hit=18
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 10k: middle, после 5000
duration: 0.159 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = 'a15252a7-4b4d-4826-b9af-d40b3f396740', $2 = '2026-10-31 20:35:09.519876+00', $3 = '6819996c-a9b7-49bf-a667-63e22465f335', $4 = '51'
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.038..0.115 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.037..0.112 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 10k: last, после 9900
duration: 0.111 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = 'a15252a7-4b4d-4826-b9af-d40b3f396740', $2 = '2026-10-31 20:35:21.624448+00', $3 = '11df026f-1d67-40fd-9265-0191805efd2b', $4 = '51'
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.019..0.081 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.019..0.078 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: first, после 0
duration: 0.147 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '7efbb7d2-1786-4de5-9216-ec211d58e49a', $2 = '51'
Limit (cost=0.29..54.21 rows=51 width=153) (actual time=0.024..0.110 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1057.63 rows=1000 width=153) (actual time=0.024..0.107 rows=51.00 loops=1)
Index Cond: (chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: middle, после 500
duration: 0.129 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '7efbb7d2-1786-4de5-9216-ec211d58e49a', $2 = '2026-10-31 20:35:09.525761+00', $3 = '34ae19f0-3c97-4690-bc5e-a23eb57bddda', $4 = '51'
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.020..0.095 rows=51.00 loops=1)
Buffers: shared hit=46
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.019..0.092 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=46
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: last, после 900
duration: 0.131 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '7efbb7d2-1786-4de5-9216-ec211d58e49a', $2 = '2026-10-31 20:35:19.321243+00', $3 = 'a8ca10b3-a372-48db-83d1-cb4cab0e70db', $4 = '51'
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.020..0.095 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.020..0.092 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 100: first, после 0
duration: 0.157 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = 'e071a7a6-8832-4ab0-b80e-e5830f099a95', $2 = '51'
Limit (cost=0.29..151.04 rows=51 width=153) (actual time=0.024..0.130 rows=51.00 loops=1)
Buffers: shared hit=51
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..295.88 rows=100 width=153) (actual time=0.024..0.127 rows=51.00 loops=1)
Index Cond: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Index Searches: 1
Buffers: shared hit=51
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 10: first, после 0
duration: 0.043 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32', $2 = '51'
Limit (cost=0.29..38.26 rows=10 width=153) (actual time=0.016..0.040 rows=10.00 loops=1)
Buffers: shared hit=12
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..38.26 rows=10 width=153) (actual time=0.015..0.039 rows=10.00 loops=1)
Index Cond: (chat_id = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32'::uuid)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
## Страницы сравнения в psql: варианты
Тот же текст запроса и те же параметры, что у плана приложения этой
страницы, в одной транзакции, которая откатывается: индексы базы
после неё те же. Каждый вариант выполнен дважды, здесь — второе
выполнение. `psql` — индекс приложения, custom plan; `generic` — он
же с force_generic_plan; `or-cursor` — условие курсора через OR;
`no-index` — без индекса приложения; варианты индекса вместо него:
`chat_only` (chat_id), `covering` (chat_id, created_at, id) INCLUDE (sender_id, text).
### read 10k: middle, после 5000
#### psql
Limit (cost=0.29..14.72 rows=51 width=153) (actual time=0.007..0.050 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1415.52 rows=5001 width=153) (actual time=0.007..0.047 rows=51.00 loops=1)
Index Cond: ((chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.519876+00'::timestamp with time zone, '6819996c-a9b7-49bf-a667-63e22465f335'::uuid)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.060 ms
Execution Time: 0.056 ms
#### generic
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.009..0.059 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.009..0.056 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.010 ms
Execution Time: 0.069 ms
#### or-cursor
Limit (cost=0.29..18.97 rows=51 width=153) (actual time=0.578..0.614 rows=51.00 loops=1)
Buffers: shared hit=5077
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1832.74 rows=5001 width=153) (actual time=0.578..0.611 rows=51.00 loops=1)
Index Cond: (chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid)
Filter: ((created_at > '2026-10-31 20:35:09.519876+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:35:09.519876+00'::timestamp with time zone) AND (id > '6819996c-a9b7-49bf-a667-63e22465f335'::uuid)))
Rows Removed by Filter: 5000
Index Searches: 1
Buffers: shared hit=5077
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.070 ms
Execution Time: 0.621 ms
#### no-index
Limit (cost=772.11..772.24 rows=51 width=153) (actual time=3.749..3.753 rows=51.00 loops=1)
Buffers: shared hit=294
-> Sort (cost=772.11..784.61 rows=5001 width=153) (actual time=3.749..3.751 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 45kB
Buffers: shared hit=294
-> Seq Scan on messages (cost=0.00..605.26 rows=5001 width=153) (actual time=0.248..3.288 rows=5000.00 loops=1)
Filter: ((chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.519876+00'::timestamp with time zone, '6819996c-a9b7-49bf-a667-63e22465f335'::uuid)))
Rows Removed by Filter: 8500
Buffers: shared hit=294
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=5000)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=5000)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.059 ms
Execution Time: 3.760 ms
#### chat_only
Limit (cost=772.11..772.24 rows=51 width=153) (actual time=3.711..3.715 rows=51.00 loops=1)
Buffers: shared hit=294
-> Sort (cost=772.11..784.61 rows=5001 width=153) (actual time=3.710..3.713 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 45kB
Buffers: shared hit=294
-> Seq Scan on messages (cost=0.00..605.26 rows=5001 width=153) (actual time=0.305..3.238 rows=5000.00 loops=1)
Filter: ((chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.519876+00'::timestamp with time zone, '6819996c-a9b7-49bf-a667-63e22465f335'::uuid)))
Rows Removed by Filter: 8500
Buffers: shared hit=294
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=5000)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=5000)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.080 ms
Execution Time: 3.726 ms
#### covering
Limit (cost=0.41..6.19 rows=51 width=153) (actual time=0.005..0.044 rows=51.00 loops=1)
Buffers: shared hit=5
-> Index Only Scan using bench_variant on messages (cost=0.41..567.45 rows=5001 width=153) (actual time=0.005..0.041 rows=51.00 loops=1)
Index Cond: ((chat_id = 'a15252a7-4b4d-4826-b9af-d40b3f396740'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.519876+00'::timestamp with time zone, '6819996c-a9b7-49bf-a667-63e22465f335'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=5
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.050 ms
Execution Time: 0.051 ms
### bg 1k: middle, после 500
#### psql
Limit (cost=0.29..96.23 rows=51 width=153) (actual time=0.007..0.047 rows=51.00 loops=1)
Buffers: shared hit=46
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..940.93 rows=500 width=153) (actual time=0.006..0.045 rows=51.00 loops=1)
Index Cond: ((chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.525761+00'::timestamp with time zone, '34ae19f0-3c97-4690-bc5e-a23eb57bddda'::uuid)))
Index Searches: 1
Buffers: shared hit=46
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.058 ms
Execution Time: 0.054 ms
#### generic
Limit (cost=0.29..21.80 rows=7 width=153) (actual time=0.012..0.054 rows=51.00 loops=1)
Buffers: shared hit=46
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..218.47 rows=71 width=153) (actual time=0.011..0.051 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=46
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.010 ms
Execution Time: 0.066 ms
#### or-cursor
Limit (cost=0.29..108.13 rows=51 width=153) (actual time=0.094..0.135 rows=51.00 loops=1)
Buffers: shared hit=507
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1057.63 rows=500 width=153) (actual time=0.094..0.132 rows=51.00 loops=1)
Index Cond: (chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid)
Filter: ((created_at > '2026-10-31 20:35:09.525761+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:35:09.525761+00'::timestamp with time zone) AND (id > '34ae19f0-3c97-4690-bc5e-a23eb57bddda'::uuid)))
Rows Removed by Filter: 500
Index Searches: 1
Buffers: shared hit=507
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.046 ms
Execution Time: 0.141 ms
#### no-index
Limit (cost=554.43..554.56 rows=51 width=153) (actual time=1.044..1.047 rows=51.00 loops=1)
Buffers: shared hit=294
-> Sort (cost=554.43..555.68 rows=500 width=153) (actual time=1.043..1.045 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 39kB
Buffers: shared hit=294
-> Seq Scan on messages (cost=0.00..537.75 rows=500 width=153) (actual time=0.530..0.995 rows=500.00 loops=1)
Filter: ((chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.525761+00'::timestamp with time zone, '34ae19f0-3c97-4690-bc5e-a23eb57bddda'::uuid)))
Rows Removed by Filter: 13000
Buffers: shared hit=294
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.104 ms
Execution Time: 1.061 ms
#### chat_only
Limit (cost=351.59..351.72 rows=51 width=153) (actual time=0.456..0.460 rows=51.00 loops=1)
Buffers: shared hit=286
-> Sort (cost=351.59..352.84 rows=500 width=153) (actual time=0.456..0.458 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 39kB
Buffers: shared hit=286
-> Bitmap Heap Scan on messages (cost=15.91..334.91 rows=500 width=153) (actual time=0.083..0.407 rows=500.00 loops=1)
Recheck Cond: (chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid)
Filter: (ROW(created_at, id) > ROW('2026-10-31 20:35:09.525761+00'::timestamp with time zone, '34ae19f0-3c97-4690-bc5e-a23eb57bddda'::uuid))
Rows Removed by Filter: 500
Heap Blocks: exact=283
Buffers: shared hit=286
-> Bitmap Index Scan on bench_variant (cost=0.00..15.79 rows=1000 width=0) (actual time=0.018..0.018 rows=1000.00 loops=1)
Index Cond: (chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.046 ms
Execution Time: 0.467 ms
#### covering
Limit (cost=0.41..6.28 rows=51 width=153) (actual time=0.006..0.044 rows=51.00 loops=1)
Buffers: shared hit=5
-> Index Only Scan using bench_variant on messages (cost=0.41..57.91 rows=500 width=153) (actual time=0.005..0.041 rows=51.00 loops=1)
Index Cond: ((chat_id = '7efbb7d2-1786-4de5-9216-ec211d58e49a'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:35:09.525761+00'::timestamp with time zone, '34ae19f0-3c97-4690-bc5e-a23eb57bddda'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=5
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 0.051 ms
### bg 100: first, после 0
#### psql
Limit (cost=0.29..151.04 rows=51 width=153) (actual time=0.005..0.053 rows=51.00 loops=1)
Buffers: shared hit=51
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..295.88 rows=100 width=153) (actual time=0.005..0.051 rows=51.00 loops=1)
Index Cond: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Index Searches: 1
Buffers: shared hit=51
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.045 ms
Execution Time: 0.060 ms
#### generic
Limit (cost=0.29..53.03 rows=21 width=153) (actual time=0.010..0.064 rows=51.00 loops=1)
Buffers: shared hit=51
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..537.81 rows=214 width=153) (actual time=0.009..0.061 rows=51.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=51
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.004 ms
Execution Time: 0.072 ms
#### no-index
Limit (cost=467.57..467.70 rows=51 width=153) (actual time=0.405..0.409 rows=51.00 loops=1)
Buffers: shared hit=294
-> Sort (cost=467.57..467.82 rows=100 width=153) (actual time=0.405..0.406 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=294
-> Seq Scan on messages (cost=0.00..464.25 rows=100 width=153) (actual time=0.013..0.390 rows=100.00 loops=1)
Filter: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Rows Removed by Filter: 13400
Buffers: shared hit=294
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.036 ms
Execution Time: 0.415 ms
#### chat_only
Limit (cost=215.59..215.72 rows=51 width=153) (actual time=0.118..0.122 rows=51.00 loops=1)
Buffers: shared hit=95
-> Sort (cost=215.59..215.84 rows=100 width=153) (actual time=0.118..0.120 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=95
-> Bitmap Heap Scan on messages (cost=5.06..212.27 rows=100 width=153) (actual time=0.014..0.104 rows=100.00 loops=1)
Recheck Cond: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Heap Blocks: exact=93
Buffers: shared hit=95
-> Bitmap Index Scan on bench_variant (cost=0.00..5.04 rows=100 width=0) (actual time=0.004..0.004 rows=100.00 loops=1)
Index Cond: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.056 ms
Execution Time: 0.131 ms
#### covering
Limit (cost=0.41..6.15 rows=51 width=153) (actual time=0.006..0.045 rows=51.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.41..11.66 rows=100 width=153) (actual time=0.006..0.041 rows=51.00 loops=1)
Index Cond: (chat_id = 'e071a7a6-8832-4ab0-b80e-e5830f099a95'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.039 ms
Execution Time: 0.051 ms
### bg 10: first, после 0
#### psql
Limit (cost=0.29..38.26 rows=10 width=153) (actual time=0.006..0.017 rows=10.00 loops=1)
Buffers: shared hit=12
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..38.26 rows=10 width=153) (actual time=0.005..0.016 rows=10.00 loops=1)
Index Cond: (chat_id = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32'::uuid)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.047 ms
Execution Time: 0.022 ms
#### generic
Limit (cost=0.29..53.03 rows=21 width=153) (actual time=0.009..0.020 rows=10.00 loops=1)
Buffers: shared hit=12
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..537.81 rows=214 width=153) (actual time=0.008..0.019 rows=10.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning Time: 0.003 ms
Execution Time: 0.026 ms
#### no-index
Limit (cost=463.07..463.09 rows=10 width=153) (actual time=0.352..0.353 rows=10.00 loops=1)
Buffers: shared hit=294
-> Sort (cost=463.07..463.09 rows=10 width=153) (actual time=0.352..0.352 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=294
-> Seq Scan on messages (cost=0.00..462.90 rows=10 width=153) (actual time=0.026..0.349 rows=10.00 loops=1)
Filter: (chat_id = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32'::uuid)
Rows Removed by Filter: 13490
Buffers: shared hit=294
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.037 ms
Execution Time: 0.358 ms
#### chat_only
Limit (cost=33.48..33.50 rows=10 width=153) (actual time=0.017..0.018 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=33.48..33.50 rows=10 width=153) (actual time=0.017..0.017 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Index Scan using bench_variant on messages (cost=0.29..33.31 rows=10 width=153) (actual time=0.004..0.015 rows=10.00 loops=1)
Index Cond: (chat_id = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32'::uuid)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.033 ms
Execution Time: 0.023 ms
#### covering
Limit (cost=0.41..4.74 rows=10 width=153) (actual time=0.005..0.013 rows=10.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.41..4.74 rows=10 width=153) (actual time=0.005..0.012 rows=10.00 loops=1)
Index Cond: (chat_id = '1324dcfc-ac5c-4d64-b55b-d9f8febbff32'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 0.019 ms
@@ -0,0 +1,731 @@
# План запроса истории: размер 1k
Commit b2fb88f
Читаемый чат — 1000 сообщений; фоновые чаты: 2 × 1k, 10 × 100, 50 × 10.
Страница — `limit` профиля; «после» — сколько сообщений чата до
страницы.
## Планы приложения
auto_explain (ANALYZE, BUFFERS, TIMING): запрос, параметры и план,
с которыми его выполнило приложение (prepared statement asyncpg).
### read 1k: first, после 0
duration: 0.112 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '86fab098-90d6-41f8-8651-e1a1d894b47f', $2 = '51'
Limit (cost=0.28..24.54 rows=51 width=153) (actual time=0.021..0.080 rows=51.00 loops=1)
Buffers: shared hit=38
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..475.91 rows=1000 width=153) (actual time=0.020..0.076 rows=51.00 loops=1)
Index Cond: (chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid)
Index Searches: 1
Buffers: shared hit=38
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 1k: middle, после 500
duration: 0.109 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '86fab098-90d6-41f8-8651-e1a1d894b47f', $2 = '2026-10-31 20:32:35.560579+00', $3 = '56b675e9-b197-40df-b5bf-70da08443b02', $4 = '51'
Limit (cost=0.28..44.89 rows=51 width=153) (actual time=0.012..0.073 rows=51.00 loops=1)
Buffers: shared hit=52
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..436.74 rows=499 width=153) (actual time=0.011..0.070 rows=51.00 loops=1)
Index Cond: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.560579+00'::timestamp with time zone, '56b675e9-b197-40df-b5bf-70da08443b02'::uuid)))
Index Searches: 1
Buffers: shared hit=52
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 1k: last, после 900
duration: 0.190 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '86fab098-90d6-41f8-8651-e1a1d894b47f', $2 = '2026-10-31 20:32:38.6944+00', $3 = '15f6b21b-4c28-40a8-b298-28397cbf0a2e', $4 = '51'
Limit (cost=119.82..119.95 rows=51 width=153) (actual time=0.153..0.157 rows=51.00 loops=1)
Buffers: shared hit=27
-> Sort (cost=119.82..120.08 rows=102 width=153) (actual time=0.152..0.154 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=27
-> Bitmap Heap Scan on messages (cost=9.33..116.42 rows=102 width=153) (actual time=0.019..0.115 rows=100.00 loops=1)
Recheck Cond: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:38.6944+00'::timestamp with time zone, '15f6b21b-4c28-40a8-b298-28397cbf0a2e'::uuid)))
Heap Blocks: exact=18
Buffers: shared hit=21
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..9.30 rows=102 width=0) (actual time=0.009..0.009 rows=100.00 loops=1)
Index Cond: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:38.6944+00'::timestamp with time zone, '15f6b21b-4c28-40a8-b298-28397cbf0a2e'::uuid)))
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
### bg 1k: first, после 0
duration: 0.097 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '4a92e036-81de-4387-8577-bca03fd549a7', $2 = '51'
Limit (cost=0.28..24.54 rows=51 width=153) (actual time=0.010..0.068 rows=51.00 loops=1)
Buffers: shared hit=43
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..475.91 rows=1000 width=153) (actual time=0.010..0.066 rows=51.00 loops=1)
Index Cond: (chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid)
Index Searches: 1
Buffers: shared hit=43
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: middle, после 500
duration: 0.096 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '4a92e036-81de-4387-8577-bca03fd549a7', $2 = '2026-10-31 20:32:35.544798+00', $3 = 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f', $4 = '51'
Limit (cost=0.28..44.72 rows=51 width=153) (actual time=0.011..0.066 rows=51.00 loops=1)
Buffers: shared hit=53
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..436.81 rows=501 width=153) (actual time=0.010..0.063 rows=51.00 loops=1)
Index Cond: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.544798+00'::timestamp with time zone, 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid)))
Index Searches: 1
Buffers: shared hit=53
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: last, после 900
duration: 0.145 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '4a92e036-81de-4387-8577-bca03fd549a7', $2 = '2026-10-31 20:32:38.721445+00', $3 = 'a1f7ba6d-d70d-485c-ba73-68124a4f887b', $4 = '51'
Limit (cost=118.86..118.98 rows=51 width=153) (actual time=0.112..0.116 rows=51.00 loops=1)
Buffers: shared hit=19
-> Sort (cost=118.86..119.10 rows=98 width=153) (actual time=0.112..0.114 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=19
-> Bitmap Heap Scan on messages (cost=9.29..115.62 rows=98 width=153) (actual time=0.013..0.093 rows=100.00 loops=1)
Recheck Cond: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:38.721445+00'::timestamp with time zone, 'a1f7ba6d-d70d-485c-ba73-68124a4f887b'::uuid)))
Heap Blocks: exact=17
Buffers: shared hit=19
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..9.26 rows=98 width=0) (actual time=0.007..0.007 rows=100.00 loops=1)
Index Cond: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:38.721445+00'::timestamp with time zone, 'a1f7ba6d-d70d-485c-ba73-68124a4f887b'::uuid)))
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
### bg 100: first, после 0
duration: 0.197 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '20a79c04-8e44-4239-98e4-6e42867bb00b', $2 = '51'
Limit (cost=118.60..118.73 rows=51 width=153) (actual time=0.163..0.167 rows=51.00 loops=1)
Buffers: shared hit=73
-> Sort (cost=118.60..118.85 rows=100 width=153) (actual time=0.162..0.164 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=73
-> Bitmap Heap Scan on messages (cost=9.06..115.28 rows=100 width=153) (actual time=0.023..0.141 rows=100.00 loops=1)
Recheck Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Heap Blocks: exact=70
Buffers: shared hit=73
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..9.03 rows=100 width=0) (actual time=0.010..0.010 rows=100.00 loops=1)
Index Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
### bg 10: first, после 0
duration: 0.036 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a', $2 = '51'
Limit (cost=35.31..35.34 rows=10 width=153) (actual time=0.031..0.032 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=35.31..35.34 rows=10 width=153) (actual time=0.031..0.031 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..35.15 rows=10 width=153) (actual time=0.013..0.028 rows=10.00 loops=1)
Recheck Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..4.36 rows=10 width=0) (actual time=0.005..0.005 rows=10.00 loops=1)
Index Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
## Страницы сравнения в psql: варианты
Тот же текст запроса и те же параметры, что у плана приложения этой
страницы, в одной транзакции, которая откатывается: индексы базы
после неё те же. Каждый вариант выполнен дважды, здесь — второе
выполнение. `psql` — индекс приложения, custom plan; `generic` — он
же с force_generic_plan; `or-cursor` — условие курсора через OR;
`no-index` — без индекса приложения; варианты индекса вместо него:
`chat_only` (chat_id), `covering` (chat_id, created_at, id) INCLUDE (sender_id, text).
### read 1k: middle, после 500
#### psql
Limit (cost=0.28..44.89 rows=51 width=153) (actual time=0.007..0.060 rows=51.00 loops=1)
Buffers: shared hit=52
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..436.74 rows=499 width=153) (actual time=0.007..0.056 rows=51.00 loops=1)
Index Cond: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.560579+00'::timestamp with time zone, '56b675e9-b197-40df-b5bf-70da08443b02'::uuid)))
Index Searches: 1
Buffers: shared hit=52
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.057 ms
Execution Time: 0.067 ms
#### generic
Limit (cost=0.28..7.93 rows=2 width=153) (actual time=0.015..0.066 rows=51.00 loops=1)
Buffers: shared hit=52
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..92.03 rows=24 width=153) (actual time=0.014..0.063 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=52
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.010 ms
Execution Time: 0.079 ms
#### or-cursor
Limit (cost=0.28..48.89 rows=51 width=153) (actual time=0.082..0.126 rows=51.00 loops=1)
Buffers: shared hit=533
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..475.90 rows=499 width=153) (actual time=0.081..0.123 rows=51.00 loops=1)
Index Cond: (chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid)
Filter: ((created_at > '2026-10-31 20:32:35.560579+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:32:35.560579+00'::timestamp with time zone) AND (id > '56b675e9-b197-40df-b5bf-70da08443b02'::uuid)))
Rows Removed by Filter: 500
Index Searches: 1
Buffers: shared hit=533
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.049 ms
Execution Time: 0.132 ms
#### no-index
Limit (cost=202.88..203.01 rows=51 width=153) (actual time=0.572..0.576 rows=51.00 loops=1)
Buffers: shared hit=100
-> Sort (cost=202.88..204.13 rows=499 width=153) (actual time=0.572..0.574 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 42kB
Buffers: shared hit=100
-> Seq Scan on messages (cost=0.00..186.24 rows=499 width=153) (actual time=0.075..0.510 rows=500.00 loops=1)
Filter: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.560579+00'::timestamp with time zone, '56b675e9-b197-40df-b5bf-70da08443b02'::uuid)))
Rows Removed by Filter: 4000
Buffers: shared hit=100
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 0.582 ms
#### chat_only
Limit (cost=157.54..157.67 rows=51 width=153) (actual time=0.493..0.497 rows=51.00 loops=1)
Buffers: shared hit=103
-> Sort (cost=157.54..158.79 rows=499 width=153) (actual time=0.493..0.495 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 42kB
Buffers: shared hit=103
-> Bitmap Heap Scan on messages (cost=15.91..140.89 rows=499 width=153) (actual time=0.063..0.432 rows=500.00 loops=1)
Recheck Cond: (chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid)
Filter: (ROW(created_at, id) > ROW('2026-10-31 20:32:35.560579+00'::timestamp with time zone, '56b675e9-b197-40df-b5bf-70da08443b02'::uuid))
Rows Removed by Filter: 500
Heap Blocks: exact=100
Buffers: shared hit=103
-> Bitmap Index Scan on bench_variant (cost=0.00..15.78 rows=1000 width=0) (actual time=0.019..0.019 rows=1000.00 loops=1)
Index Cond: (chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.037 ms
Execution Time: 0.503 ms
#### covering
Limit (cost=0.28..6.16 rows=51 width=153) (actual time=0.005..0.045 rows=51.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.28..57.75 rows=499 width=153) (actual time=0.005..0.042 rows=51.00 loops=1)
Index Cond: ((chat_id = '86fab098-90d6-41f8-8651-e1a1d894b47f'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.560579+00'::timestamp with time zone, '56b675e9-b197-40df-b5bf-70da08443b02'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.042 ms
Execution Time: 0.051 ms
### bg 1k: middle, после 500
#### psql
Limit (cost=0.28..44.72 rows=51 width=153) (actual time=0.012..0.062 rows=51.00 loops=1)
Buffers: shared hit=53
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..436.81 rows=501 width=153) (actual time=0.012..0.058 rows=51.00 loops=1)
Index Cond: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.544798+00'::timestamp with time zone, 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid)))
Index Searches: 1
Buffers: shared hit=53
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.058 ms
Execution Time: 0.072 ms
#### generic
Limit (cost=0.28..7.93 rows=2 width=153) (actual time=0.010..0.056 rows=51.00 loops=1)
Buffers: shared hit=53
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..92.03 rows=24 width=153) (actual time=0.009..0.053 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=53
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.006 ms
Execution Time: 0.063 ms
#### or-cursor
Limit (cost=0.28..48.70 rows=51 width=153) (actual time=0.076..0.116 rows=51.00 loops=1)
Buffers: shared hit=540
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..475.93 rows=501 width=153) (actual time=0.076..0.114 rows=51.00 loops=1)
Index Cond: (chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid)
Filter: ((created_at > '2026-10-31 20:32:35.544798+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:32:35.544798+00'::timestamp with time zone) AND (id > 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid)))
Rows Removed by Filter: 500
Index Searches: 1
Buffers: shared hit=540
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.044 ms
Execution Time: 0.121 ms
#### no-index
Limit (cost=202.98..203.11 rows=51 width=153) (actual time=0.486..0.490 rows=51.00 loops=1)
Buffers: shared hit=100
-> Sort (cost=202.98..204.23 rows=501 width=153) (actual time=0.486..0.488 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 43kB
Buffers: shared hit=100
-> Seq Scan on messages (cost=0.00..186.27 rows=501 width=153) (actual time=0.070..0.431 rows=500.00 loops=1)
Filter: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.544798+00'::timestamp with time zone, 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid)))
Rows Removed by Filter: 4000
Buffers: shared hit=100
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.043 ms
Execution Time: 0.497 ms
#### chat_only
Limit (cost=157.64..157.76 rows=51 width=153) (actual time=0.436..0.440 rows=51.00 loops=1)
Buffers: shared hit=103
-> Sort (cost=157.64..158.89 rows=501 width=153) (actual time=0.436..0.437 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 43kB
Buffers: shared hit=103
-> Bitmap Heap Scan on messages (cost=15.91..140.92 rows=501 width=153) (actual time=0.053..0.382 rows=500.00 loops=1)
Recheck Cond: (chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid)
Filter: (ROW(created_at, id) > ROW('2026-10-31 20:32:35.544798+00'::timestamp with time zone, 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid))
Rows Removed by Filter: 500
Heap Blocks: exact=100
Buffers: shared hit=103
-> Bitmap Index Scan on bench_variant (cost=0.00..15.78 rows=1000 width=0) (actual time=0.012..0.012 rows=1000.00 loops=1)
Index Cond: (chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.045 ms
Execution Time: 0.446 ms
#### covering
Limit (cost=0.28..6.14 rows=51 width=153) (actual time=0.006..0.045 rows=51.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.28..57.82 rows=501 width=153) (actual time=0.006..0.043 rows=51.00 loops=1)
Index Cond: ((chat_id = '4a92e036-81de-4387-8577-bca03fd549a7'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:32:35.544798+00'::timestamp with time zone, 'a727e0c7-e3cb-4ce8-bff7-59e9c11b7c6f'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 0.052 ms
### bg 100: first, после 0
#### psql
Limit (cost=118.60..118.73 rows=51 width=153) (actual time=0.118..0.123 rows=51.00 loops=1)
Buffers: shared hit=73
-> Sort (cost=118.60..118.85 rows=100 width=153) (actual time=0.118..0.120 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=73
-> Bitmap Heap Scan on messages (cost=9.06..115.28 rows=100 width=153) (actual time=0.022..0.103 rows=100.00 loops=1)
Recheck Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Heap Blocks: exact=70
Buffers: shared hit=73
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..9.03 rows=100 width=0) (actual time=0.010..0.010 rows=100.00 loops=1)
Index Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.064 ms
Execution Time: 0.136 ms
#### generic
Limit (cost=0.28..21.54 rows=7 width=153) (actual time=0.009..0.050 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..215.90 rows=71 width=153) (actual time=0.008..0.046 rows=51.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.004 ms
Execution Time: 0.057 ms
#### no-index
Limit (cost=161.07..161.20 rows=51 width=153) (actual time=0.196..0.200 rows=51.00 loops=1)
Buffers: shared hit=100
-> Sort (cost=161.07..161.32 rows=100 width=153) (actual time=0.196..0.197 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=100
-> Seq Scan on messages (cost=0.00..157.75 rows=100 width=153) (actual time=0.004..0.182 rows=100.00 loops=1)
Filter: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Rows Removed by Filter: 4400
Buffers: shared hit=100
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.038 ms
Execution Time: 0.206 ms
#### chat_only
Limit (cost=114.60..114.73 rows=51 width=153) (actual time=0.107..0.111 rows=51.00 loops=1)
Buffers: shared hit=72
-> Sort (cost=114.60..114.85 rows=100 width=153) (actual time=0.107..0.109 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=72
-> Bitmap Heap Scan on messages (cost=5.06..111.28 rows=100 width=153) (actual time=0.014..0.093 rows=100.00 loops=1)
Recheck Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Heap Blocks: exact=70
Buffers: shared hit=72
-> Bitmap Index Scan on bench_variant (cost=0.00..5.03 rows=100 width=0) (actual time=0.005..0.005 rows=100.00 loops=1)
Index Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.054 ms
Execution Time: 0.119 ms
#### covering
Limit (cost=0.28..6.02 rows=51 width=153) (actual time=0.005..0.040 rows=51.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.28..11.53 rows=100 width=153) (actual time=0.005..0.038 rows=51.00 loops=1)
Index Cond: (chat_id = '20a79c04-8e44-4239-98e4-6e42867bb00b'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.038 ms
Execution Time: 0.047 ms
### bg 10: first, после 0
#### psql
Limit (cost=35.31..35.34 rows=10 width=153) (actual time=0.020..0.021 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=35.31..35.34 rows=10 width=153) (actual time=0.020..0.020 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..35.15 rows=10 width=153) (actual time=0.009..0.018 rows=10.00 loops=1)
Recheck Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..4.36 rows=10 width=0) (actual time=0.004..0.004 rows=10.00 loops=1)
Index Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.042 ms
Execution Time: 0.031 ms
#### generic
Limit (cost=0.28..21.54 rows=7 width=153) (actual time=0.009..0.020 rows=10.00 loops=1)
Buffers: shared hit=12
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.28..215.90 rows=71 width=153) (actual time=0.008..0.019 rows=10.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning Time: 0.004 ms
Execution Time: 0.026 ms
#### no-index
Limit (cost=156.57..156.59 rows=10 width=153) (actual time=0.127..0.128 rows=10.00 loops=1)
Buffers: shared hit=100
-> Sort (cost=156.57..156.59 rows=10 width=153) (actual time=0.126..0.127 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=100
-> Seq Scan on messages (cost=0.00..156.40 rows=10 width=153) (actual time=0.008..0.124 rows=10.00 loops=1)
Filter: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Rows Removed by Filter: 4490
Buffers: shared hit=100
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.033 ms
Execution Time: 0.132 ms
#### chat_only
Limit (cost=35.31..35.34 rows=10 width=153) (actual time=0.021..0.022 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=35.31..35.34 rows=10 width=153) (actual time=0.020..0.021 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..35.15 rows=10 width=153) (actual time=0.009..0.018 rows=10.00 loops=1)
Recheck Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on bench_variant (cost=0.00..4.36 rows=10 width=0) (actual time=0.003..0.003 rows=10.00 loops=1)
Index Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.050 ms
Execution Time: 0.030 ms
#### covering
Limit (cost=0.28..4.61 rows=10 width=153) (actual time=0.005..0.013 rows=10.00 loops=1)
Buffers: shared hit=3
-> Index Only Scan using bench_variant on messages (cost=0.28..4.61 rows=10 width=153) (actual time=0.004..0.012 rows=10.00 loops=1)
Index Cond: (chat_id = 'ed5c39bf-15e3-48b5-bb93-a93544b7da4a'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.035 ms
Execution Time: 0.018 ms
@@ -0,0 +1,693 @@
# План запроса истории: размер 5k
Commit b2fb88f
Читаемый чат — 5000 сообщений; фоновые чаты: 2 × 1k, 10 × 100, 50 × 10.
Страница — `limit` профиля; «после» — сколько сообщений чата до
страницы.
## Планы приложения
auto_explain (ANALYZE, BUFFERS, TIMING): запрос, параметры и план,
с которыми его выполнило приложение (prepared statement asyncpg).
### read 5k: first, после 0
duration: 0.135 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c', $2 = '51'
Limit (cost=0.29..11.43 rows=51 width=153) (actual time=0.035..0.104 rows=51.00 loops=1)
Buffers: shared hit=27
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1092.83 rows=5000 width=153) (actual time=0.034..0.100 rows=51.00 loops=1)
Index Cond: (chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid)
Index Searches: 1
Buffers: shared hit=27
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 5k: middle, после 2500
duration: 0.130 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c', $2 = '2026-10-31 20:33:47.697992+00', $3 = 'd0685e16-8d05-433e-94b2-52f7f33fc60d', $4 = '51'
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.021..0.099 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.020..0.097 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### read 5k: last, после 4900
duration: 0.119 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c', $2 = '2026-10-31 20:33:55.782721+00', $3 = '56aa58ee-98f4-437c-86bd-dc713751a74e', $4 = '51'
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.024..0.088 rows=51.00 loops=1)
Buffers: shared hit=53
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.023..0.085 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=53
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: first, после 0
duration: 0.118 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '32b1f6b8-cb91-4797-90f1-11562fd0d15c', $2 = '51'
Limit (cost=0.29..39.43 rows=51 width=153) (actual time=0.021..0.087 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..767.87 rows=1000 width=153) (actual time=0.021..0.084 rows=51.00 loops=1)
Index Cond: (chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: middle, после 500
duration: 0.122 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '32b1f6b8-cb91-4797-90f1-11562fd0d15c', $2 = '2026-10-31 20:33:47.678256+00', $3 = '5b0bf7b2-94b1-471b-b626-e907cff5d820', $4 = '51'
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.015..0.094 rows=51.00 loops=1)
Buffers: shared hit=49
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.014..0.091 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=49
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 1k: last, после 900
duration: 0.136 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID AND (messages.created_at, messages.id) > ($2::TIMESTAMP WITH TIME ZONE, $3::UUID) ORDER BY messages.created_at, messages.id
LIMIT $4::INTEGER
Query Parameters: $1 = '32b1f6b8-cb91-4797-90f1-11562fd0d15c', $2 = '2026-10-31 20:33:54.608508+00', $3 = 'b1c48e4e-55f2-4bb1-9e3d-6cefb21aca9c', $4 = '51'
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.023..0.104 rows=51.00 loops=1)
Buffers: shared hit=51
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.022..0.101 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=51
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 100: first, после 0
duration: 0.168 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb', $2 = '51'
Limit (cost=0.29..154.67 rows=51 width=153) (actual time=0.017..0.139 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..302.99 rows=100 width=153) (actual time=0.016..0.136 rows=51.00 loops=1)
Index Cond: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
### bg 10: first, после 0
duration: 0.088 ms plan:
Query Text: SELECT messages.id, messages.chat_id, messages.sender_id, messages.text, messages.created_at, array((SELECT message_attachments.attachment_id
FROM message_attachments
WHERE message_attachments.message_id = messages.id ORDER BY message_attachments.position)) AS attachment_ids
FROM messages
WHERE messages.chat_id = $1::UUID ORDER BY messages.created_at, messages.id
LIMIT $2::INTEGER
Query Parameters: $1 = '2a802f02-74f4-4937-bd97-9c4045417c5e', $2 = '51'
Limit (cost=37.85..37.87 rows=10 width=153) (actual time=0.077..0.078 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=37.85..37.87 rows=10 width=153) (actual time=0.077..0.077 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..37.68 rows=10 width=153) (actual time=0.032..0.071 rows=10.00 loops=1)
Recheck Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..4.36 rows=10 width=0) (actual time=0.007..0.007 rows=10.00 loops=1)
Index Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.002..0.002 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
## Страницы сравнения в psql: варианты
Тот же текст запроса и те же параметры, что у плана приложения этой
страницы, в одной транзакции, которая откатывается: индексы базы
после неё те же. Каждый вариант выполнен дважды, здесь — второе
выполнение. `psql` — индекс приложения, custom plan; `generic` — он
же с force_generic_plan; `or-cursor` — условие курсора через OR;
`no-index` — без индекса приложения; варианты индекса вместо него:
`chat_only` (chat_id), `covering` (chat_id, created_at, id) INCLUDE (sender_id, text).
### read 5k: middle, после 2500
#### psql
Limit (cost=0.29..18.59 rows=51 width=153) (actual time=0.007..0.056 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..897.48 rows=2500 width=153) (actual time=0.007..0.053 rows=51.00 loops=1)
Index Cond: ((chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.697992+00'::timestamp with time zone, 'd0685e16-8d05-433e-94b2-52f7f33fc60d'::uuid)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.053 ms
Execution Time: 0.063 ms
#### generic
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.009..0.056 rows=51.00 loops=1)
Buffers: shared hit=54
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.008..0.053 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=54
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.005 ms
Execution Time: 0.064 ms
#### or-cursor
Limit (cost=0.29..22.57 rows=51 width=153) (actual time=0.354..0.397 rows=51.00 loops=1)
Buffers: shared hit=2555
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..1092.83 rows=2500 width=153) (actual time=0.354..0.394 rows=51.00 loops=1)
Index Cond: (chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid)
Filter: ((created_at > '2026-10-31 20:33:47.697992+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:33:47.697992+00'::timestamp with time zone) AND (id > 'd0685e16-8d05-433e-94b2-52f7f33fc60d'::uuid)))
Rows Removed by Filter: 2500
Index Searches: 1
Buffers: shared hit=2555
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.042 ms
Execution Time: 0.402 ms
#### no-index
Limit (cost=455.66..455.78 rows=51 width=153) (actual time=2.231..2.236 rows=51.00 loops=1)
Buffers: shared hit=186
-> Sort (cost=455.66..461.91 rows=2500 width=153) (actual time=2.231..2.233 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 43kB
Buffers: shared hit=186
-> Seq Scan on messages (cost=0.00..372.25 rows=2500 width=153) (actual time=0.181..1.941 rows=2500.00 loops=1)
Filter: ((chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.697992+00'::timestamp with time zone, 'd0685e16-8d05-433e-94b2-52f7f33fc60d'::uuid)))
Rows Removed by Filter: 6000
Buffers: shared hit=186
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=2500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=2500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.043 ms
Execution Time: 2.243 ms
#### chat_only
Limit (cost=455.66..455.78 rows=51 width=153) (actual time=2.007..2.011 rows=51.00 loops=1)
Buffers: shared hit=186
-> Sort (cost=455.66..461.91 rows=2500 width=153) (actual time=2.007..2.009 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 43kB
Buffers: shared hit=186
-> Seq Scan on messages (cost=0.00..372.25 rows=2500 width=153) (actual time=0.147..1.756 rows=2500.00 loops=1)
Filter: ((chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.697992+00'::timestamp with time zone, 'd0685e16-8d05-433e-94b2-52f7f33fc60d'::uuid)))
Rows Removed by Filter: 6000
Buffers: shared hit=186
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=2500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=2500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 2.017 ms
#### covering
Limit (cost=0.41..6.28 rows=51 width=153) (actual time=0.006..0.041 rows=51.00 loops=1)
Buffers: shared hit=5
-> Index Only Scan using bench_variant on messages (cost=0.41..287.91 rows=2500 width=153) (actual time=0.006..0.039 rows=51.00 loops=1)
Index Cond: ((chat_id = 'c5a461fa-1df5-48fc-99f3-07c2b4fc839c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.697992+00'::timestamp with time zone, 'd0685e16-8d05-433e-94b2-52f7f33fc60d'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=5
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.039 ms
Execution Time: 0.047 ms
### bg 1k: middle, после 500
#### psql
Limit (cost=0.29..74.22 rows=51 width=153) (actual time=0.006..0.052 rows=51.00 loops=1)
Buffers: shared hit=49
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..728.07 rows=502 width=153) (actual time=0.006..0.050 rows=51.00 loops=1)
Index Cond: ((chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.678256+00'::timestamp with time zone, '5b0bf7b2-94b1-471b-b626-e907cff5d820'::uuid)))
Index Searches: 1
Buffers: shared hit=49
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.048 ms
Execution Time: 0.059 ms
#### generic
Limit (cost=0.29..14.23 rows=4 width=153) (actual time=0.013..0.063 rows=51.00 loops=1)
Buffers: shared hit=49
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..157.19 rows=45 width=153) (actual time=0.013..0.060 rows=51.00 loops=1)
Index Cond: ((chat_id = $1) AND (ROW(created_at, id) > ROW($2, $3)))
Index Searches: 1
Buffers: shared hit=49
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.009 ms
Execution Time: 0.075 ms
#### or-cursor
Limit (cost=0.29..78.27 rows=51 width=153) (actual time=0.083..0.127 rows=51.00 loops=1)
Buffers: shared hit=531
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..767.90 rows=502 width=153) (actual time=0.083..0.125 rows=51.00 loops=1)
Index Cond: (chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid)
Filter: ((created_at > '2026-10-31 20:33:47.678256+00'::timestamp with time zone) OR ((created_at = '2026-10-31 20:33:47.678256+00'::timestamp with time zone) AND (id > '5b0bf7b2-94b1-471b-b626-e907cff5d820'::uuid)))
Rows Removed by Filter: 500
Index Searches: 1
Buffers: shared hit=531
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.049 ms
Execution Time: 0.134 ms
#### no-index
Limit (cost=359.03..359.16 rows=51 width=153) (actual time=0.554..0.558 rows=51.00 loops=1)
Buffers: shared hit=186
-> Sort (cost=359.03..360.28 rows=502 width=153) (actual time=0.553..0.555 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 39kB
Buffers: shared hit=186
-> Seq Scan on messages (cost=0.00..342.28 rows=502 width=153) (actual time=0.128..0.504 rows=500.00 loops=1)
Filter: ((chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.678256+00'::timestamp with time zone, '5b0bf7b2-94b1-471b-b626-e907cff5d820'::uuid)))
Rows Removed by Filter: 8000
Buffers: shared hit=186
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.074 ms
Execution Time: 0.569 ms
#### chat_only
Limit (cost=243.69..243.82 rows=51 width=153) (actual time=0.455..0.459 rows=51.00 loops=1)
Buffers: shared hit=187
-> Sort (cost=243.69..244.94 rows=502 width=153) (actual time=0.455..0.456 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: top-N heapsort Memory: 39kB
Buffers: shared hit=187
-> Bitmap Heap Scan on messages (cost=15.91..226.94 rows=502 width=153) (actual time=0.077..0.404 rows=500.00 loops=1)
Recheck Cond: (chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid)
Filter: (ROW(created_at, id) > ROW('2026-10-31 20:33:47.678256+00'::timestamp with time zone, '5b0bf7b2-94b1-471b-b626-e907cff5d820'::uuid))
Rows Removed by Filter: 500
Heap Blocks: exact=184
Buffers: shared hit=187
-> Bitmap Index Scan on bench_variant (cost=0.00..15.79 rows=1000 width=0) (actual time=0.014..0.014 rows=1000.00 loops=1)
Index Cond: (chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid)
Index Searches: 1
Buffers: shared hit=3
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=500)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.045 ms
Execution Time: 0.467 ms
#### covering
Limit (cost=0.41..6.26 rows=51 width=153) (actual time=0.006..0.048 rows=51.00 loops=1)
Buffers: shared hit=5
-> Index Only Scan using bench_variant on messages (cost=0.41..57.98 rows=502 width=153) (actual time=0.006..0.045 rows=51.00 loops=1)
Index Cond: ((chat_id = '32b1f6b8-cb91-4797-90f1-11562fd0d15c'::uuid) AND (ROW(created_at, id) > ROW('2026-10-31 20:33:47.678256+00'::timestamp with time zone, '5b0bf7b2-94b1-471b-b626-e907cff5d820'::uuid)))
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=5
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.047 ms
Execution Time: 0.055 ms
### bg 100: first, после 0
#### psql
Limit (cost=0.29..154.67 rows=51 width=153) (actual time=0.021..0.072 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..302.99 rows=100 width=153) (actual time=0.021..0.069 rows=51.00 loops=1)
Index Cond: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.069 ms
Execution Time: 0.080 ms
#### generic
Limit (cost=0.29..39.82 rows=14 width=153) (actual time=0.024..0.083 rows=51.00 loops=1)
Buffers: shared hit=47
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..381.48 rows=135 width=153) (actual time=0.023..0.080 rows=51.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=47
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning Time: 0.005 ms
Execution Time: 0.094 ms
#### no-index
Limit (cost=297.07..297.20 rows=51 width=153) (actual time=0.353..0.356 rows=51.00 loops=1)
Buffers: shared hit=186
-> Sort (cost=297.07..297.32 rows=100 width=153) (actual time=0.353..0.354 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=186
-> Seq Scan on messages (cost=0.00..293.75 rows=100 width=153) (actual time=0.028..0.336 rows=100.00 loops=1)
Filter: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Rows Removed by Filter: 8400
Buffers: shared hit=186
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.035 ms
Execution Time: 0.362 ms
#### chat_only
Limit (cost=172.68..172.80 rows=51 width=153) (actual time=0.138..0.142 rows=51.00 loops=1)
Buffers: shared hit=83
-> Sort (cost=172.68..172.93 rows=100 width=153) (actual time=0.138..0.140 rows=51.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 50kB
Buffers: shared hit=83
-> Bitmap Heap Scan on messages (cost=5.06..169.35 rows=100 width=153) (actual time=0.013..0.124 rows=100.00 loops=1)
Recheck Cond: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Heap Blocks: exact=81
Buffers: shared hit=83
-> Bitmap Index Scan on bench_variant (cost=0.00..5.04 rows=100 width=0) (actual time=0.004..0.004 rows=100.00 loops=1)
Index Cond: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=100)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.038 ms
Execution Time: 0.149 ms
#### covering
Limit (cost=0.41..6.15 rows=51 width=153) (actual time=0.004..0.048 rows=51.00 loops=1)
Buffers: shared hit=5
-> Index Only Scan using bench_variant on messages (cost=0.41..11.66 rows=100 width=153) (actual time=0.004..0.045 rows=51.00 loops=1)
Index Cond: (chat_id = '31bc7aa7-0ed7-4867-b3f9-6a2f17caa6fb'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=5
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=51)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=51)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.035 ms
Execution Time: 0.053 ms
### bg 10: first, после 0
#### psql
Limit (cost=37.85..37.87 rows=10 width=153) (actual time=0.035..0.036 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=37.85..37.87 rows=10 width=153) (actual time=0.034..0.035 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..37.68 rows=10 width=153) (actual time=0.020..0.031 rows=10.00 loops=1)
Recheck Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on ix_messages_chat_id_created_at_id (cost=0.00..4.36 rows=10 width=0) (actual time=0.005..0.005 rows=10.00 loops=1)
Index Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.053 ms
Execution Time: 0.049 ms
#### generic
Limit (cost=0.29..39.82 rows=14 width=153) (actual time=0.010..0.021 rows=10.00 loops=1)
Buffers: shared hit=12
-> Index Scan using ix_messages_chat_id_created_at_id on messages (cost=0.29..381.48 rows=135 width=153) (actual time=0.010..0.020 rows=10.00 loops=1)
Index Cond: (chat_id = $1)
Index Searches: 1
Buffers: shared hit=12
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning Time: 0.004 ms
Execution Time: 0.029 ms
#### no-index
Limit (cost=292.57..292.59 rows=10 width=153) (actual time=0.199..0.200 rows=10.00 loops=1)
Buffers: shared hit=186
-> Sort (cost=292.57..292.59 rows=10 width=153) (actual time=0.199..0.199 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=186
-> Seq Scan on messages (cost=0.00..292.40 rows=10 width=153) (actual time=0.007..0.196 rows=10.00 loops=1)
Filter: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Rows Removed by Filter: 8490
Buffers: shared hit=186
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.040 ms
Execution Time: 0.205 ms
#### chat_only
Limit (cost=37.85..37.87 rows=10 width=153) (actual time=0.019..0.020 rows=10.00 loops=1)
Buffers: shared hit=12
-> Sort (cost=37.85..37.87 rows=10 width=153) (actual time=0.019..0.019 rows=10.00 loops=1)
Sort Key: messages.created_at, messages.id
Sort Method: quicksort Memory: 27kB
Buffers: shared hit=12
-> Bitmap Heap Scan on messages (cost=4.36..37.68 rows=10 width=153) (actual time=0.007..0.016 rows=10.00 loops=1)
Recheck Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Heap Blocks: exact=10
Buffers: shared hit=12
-> Bitmap Index Scan on bench_variant (cost=0.00..4.36 rows=10 width=0) (actual time=0.002..0.002 rows=10.00 loops=1)
Index Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Index Searches: 1
Buffers: shared hit=2
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.044 ms
Execution Time: 0.026 ms
#### covering
Limit (cost=0.41..4.74 rows=10 width=153) (actual time=0.006..0.014 rows=10.00 loops=1)
Buffers: shared hit=4
-> Index Only Scan using bench_variant on messages (cost=0.41..4.74 rows=10 width=153) (actual time=0.006..0.013 rows=10.00 loops=1)
Index Cond: (chat_id = '2a802f02-74f4-4937-bd97-9c4045417c5e'::uuid)
Heap Fetches: 0
Index Searches: 1
Buffers: shared hit=4
SubPlan 1
-> Sort (cost=0.01..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=0.00 loops=10)
Sort Key: message_attachments."position"
Sort Method: quicksort Memory: 25kB
-> Seq Scan on message_attachments (cost=0.00..0.00 rows=1 width=18) (actual time=0.000..0.000 rows=0.00 loops=10)
Filter: (message_id = messages.id)
Planning:
Buffers: shared hit=3
Planning Time: 0.035 ms
Execution Time: 0.020 ms
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
size,chunk,messages_before,messages_after,duration_s,requests_ok,requests_failed,rps,error_ratio,p50_ms,p95_ms,p99_ms,max_ms,app_cpu_cores,rss_end_mib,mem_cgroup_end_mib,generator_cpu_cores,flags,db_cpu_cores,cell,attempt
1000,1,0,4500,8.129,4500,0,553.5,0.0,53.566,107.997,145.124,203.112,1.001,124.9,118.0,0.125,,0.211,,
5000,1,0,8500,16.609,8500,0,511.8,0.0,54.873,131.129,176.024,367.355,1.0,124.9,115.5,0.12,,0.226,,
10000,1,0,13500,26.218,13500,0,514.9,0.0,56.009,121.243,188.234,417.242,0.996,125.1,113.8,0.119,,0.22,,
1 size chunk messages_before messages_after duration_s requests_ok requests_failed rps error_ratio p50_ms p95_ms p99_ms max_ms app_cpu_cores rss_end_mib mem_cgroup_end_mib generator_cpu_cores flags db_cpu_cores cell attempt
2 1000 1 0 4500 8.129 4500 0 553.5 0.0 53.566 107.997 145.124 203.112 1.001 124.9 118.0 0.125 0.211
3 5000 1 0 8500 16.609 8500 0 511.8 0.0 54.873 131.129 176.024 367.355 1.0 124.9 115.5 0.12 0.226
4 10000 1 0 13500 26.218 13500 0 514.9 0.0 56.009 121.243 188.234 417.242 0.996 125.1 113.8 0.119 0.22
@@ -0,0 +1,12 @@
{
"label": "unit-of-work-before",
"profile": "quick",
"stage": "done",
"size": 10000,
"runs_done": 18,
"runs_total": 18,
"elapsed_s": 232,
"eta_s": 0,
"warnings": [],
"updated_at": "2026-10-31T20:36:08+00:00"
}
@@ -0,0 +1 @@
{"options":{"summaryTimeUnit":"","noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":26217.897831},"metrics":{"iteration_duration":{"type":"trend","contains":"time","values":{"med":56.0817085,"p(50)":56.0817085,"p(95)":121.36764969999999,"p(99)":188.31833032999998,"max":417.289458,"avg":62.08268073674041,"min":10.908}},"data_sent":{"type":"counter","contains":"data","values":{"count":5076000,"rate":193608.19973896406}},"http_req_blocked":{"values":{"p(95)":0.002958,"p(99)":0.006208,"max":1.231625,"avg":0.0036268236296294123,"min":0.0005,"med":0.001292,"p(50)":0.001292},"type":"trend","contains":"time"},"http_reqs":{"values":{"count":13500,"rate":514.9154248376703},"type":"counter","contains":"default"},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":13500,"fails":0}},"http_req_connecting":{"values":{"p(95)":0,"p(99)":0,"max":0.405125,"avg":0.00043700940740740743,"min":0,"med":0,"p(50)":0},"type":"trend","contains":"time"},"http_req_sending":{"type":"trend","contains":"time","values":{"avg":0.007020301851851752,"min":0.002,"med":0.00525,"p(50)":0.00525,"p(95)":0.015375,"p(99)":0.027752079999999974,"max":0.41175}},"data_received":{"type":"counter","contains":"data","values":{"rate":252308.55817045848,"count":6615000}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":13500}},"iterations":{"type":"counter","contains":"default","values":{"count":13500,"rate":514.9154248376703}},"vus_max":{"type":"gauge","contains":"default","values":{"value":32,"min":32,"max":32}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"p(95)":121.24275384999996,"p(99)":188.23404533,"max":417.241917,"avg":61.99720407022209,"min":10.842917,"med":56.0085415,"p(50)":56.0085415},"thresholds":{"max>=0":{"ok":true}}},"vus":{"type":"gauge","contains":"default","values":{"value":32,"min":32,"max":32}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0}},"http_req_receiving":{"type":"trend","contains":"time","values":{"avg":0.021931994296296276,"min":0.004875,"med":0.017292,"p(50)":0.017292,"p(95)":0.04758604999999998,"p(99)":0.07875458999999994,"max":1.298125}},"http_req_waiting":{"type":"trend","contains":"time","values":{"min":10.821416,"med":55.973562,"p(50)":55.973562,"p(95)":121.20813124999995,"p(99)":188.21679398999999,"max":417.229417,"avg":61.96825177407398}},"http_req_duration":{"contains":"time","values":{"p(99)":188.23404533,"max":417.241917,"avg":61.99720407022209,"min":10.842917,"med":56.0085415,"p(50)":56.0085415,"p(95)":121.24275384999996},"type":"trend"}},"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":13500,"fails":0,"name":"message 201"}]}}
@@ -0,0 +1 @@
{"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":8129.394198},"metrics":{"http_req_connecting":{"type":"trend","contains":"time","values":{"p(95)":0,"p(99)":0,"max":0.238542,"avg":0.000649676,"min":0,"med":0,"p(50)":0}},"iterations":{"type":"counter","contains":"default","values":{"rate":553.5467822568,"count":4500}},"vus":{"type":"gauge","contains":"default","values":{"value":32,"min":32,"max":32}},"checks":{"type":"rate","contains":"default","values":{"fails":0,"rate":1,"passes":4500}},"iteration_duration":{"type":"trend","contains":"time","values":{"min":11.12675,"med":53.629854,"p(50)":53.629854,"p(95)":108.05101904999998,"p(99)":145.20654075,"max":203.160667,"avg":57.65925558577789}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0}},"http_req_duration":{"type":"trend","contains":"time","values":{"avg":57.58373600199996,"min":11.06175,"med":53.565521000000004,"p(50)":53.565521000000004,"p(95)":107.99710415,"p(99)":145.12359458,"max":203.112167}},"http_req_blocked":{"contains":"time","values":{"min":0.0005,"med":0.001208,"p(50)":0.001208,"p(95)":0.002542,"p(99)":0.010333839999999997,"max":1.939167,"avg":0.01047257377777748},"type":"trend"},"http_req_sending":{"contains":"time","values":{"med":0.004709,"p(50)":0.004709,"p(95)":0.013417,"p(99)":0.02838749999999995,"max":0.492583,"avg":0.0068133179999999745,"min":0.002167},"type":"trend"},"data_received":{"type":"counter","contains":"data","values":{"count":2205000,"rate":271237.923305832}},"data_sent":{"type":"counter","contains":"data","values":{"count":1692000,"rate":208133.59012855683}},"http_req_receiving":{"type":"trend","contains":"time","values":{"max":0.158708,"avg":0.019934207999999964,"min":0.005,"med":0.016542,"p(50)":0.016542,"p(95)":0.04138544999999996,"p(99)":0.06270925}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":4500}},"http_req_duration{expected_response:true}":{"contains":"time","values":{"p(50)":53.565521000000004,"p(95)":107.99710415,"p(99)":145.12359458,"max":203.112167,"avg":57.58373600199996,"min":11.06175,"med":53.565521000000004},"thresholds":{"max>=0":{"ok":true}},"type":"trend"},"http_reqs":{"type":"counter","contains":"default","values":{"count":4500,"rate":553.5467822568}},"http_req_waiting":{"type":"trend","contains":"time","values":{"avg":57.55698847600002,"min":11.042792,"med":53.5413955,"p(50)":53.5413955,"p(95)":107.96220805,"p(99)":145.10563825,"max":203.095375}},"vus_max":{"type":"gauge","contains":"default","values":{"value":32,"min":32,"max":32}}},"root_group":{"id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":4500,"fails":0}],"name":"","path":""}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"passes":8500,"fails":0,"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882"}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":16608.764133},"metrics":{"http_req_waiting":{"type":"trend","contains":"time","values":{"med":54.8474165,"p(50)":54.8474165,"p(95)":131.10701635,"p(99)":175.99143532999997,"max":367.328875,"avg":62.34265841941195,"min":10.559792}},"iterations":{"values":{"count":8500,"rate":511.7779945535698},"type":"counter","contains":"default"},"vus":{"type":"gauge","contains":"default","values":{"value":32,"min":32,"max":32}},"http_req_receiving":{"values":{"p(99)":0.09283716999999997,"max":1.376042,"avg":0.02192834011764702,"min":0.004625,"med":0.016208,"p(50)":0.016208,"p(95)":0.05},"type":"trend","contains":"time"},"vus_max":{"type":"gauge","contains":"default","values":{"min":32,"max":32,"value":32}},"http_req_blocked":{"type":"trend","contains":"time","values":{"avg":0.00597289235294084,"min":0.000458,"med":0.001167,"p(50)":0.001167,"p(95)":0.003167,"p(99)":0.0072520799999999845,"max":1.702709}},"http_req_tls_handshaking":{"contains":"time","values":{"p(99)":0,"max":0,"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0},"type":"trend"},"http_req_duration":{"type":"trend","contains":"time","values":{"p(99)":176.02381499999996,"max":367.35525,"avg":62.371295071764656,"min":10.578875,"med":54.872604,"p(50)":54.872604,"p(95)":131.1289899}},"data_sent":{"contains":"data","values":{"count":3196000,"rate":192428.52595214226},"type":"counter"},"http_reqs":{"values":{"count":8500,"rate":511.7779945535698},"type":"counter","contains":"default"},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":8500}},"data_received":{"type":"counter","contains":"data","values":{"count":4165000,"rate":250771.2173312492}},"http_req_sending":{"type":"trend","contains":"time","values":{"p(50)":0.004625,"p(95)":0.016334,"p(99)":0.03304366999999999,"max":0.2145,"avg":0.006708312235294045,"min":0.001875,"med":0.004625}},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"min":10.578875,"med":54.872604,"p(50)":54.872604,"p(95)":131.1289899,"p(99)":176.02381499999996,"max":367.35525,"avg":62.371295071764656}},"http_req_connecting":{"values":{"avg":0.0006276516470588236,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.821208},"type":"trend","contains":"time"},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":8500,"fails":0}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(99)":176.63479883,"max":367.434584,"avg":62.4581675835293,"min":10.6265,"med":54.941229500000006,"p(50)":54.941229500000006,"p(95)":131.26773605}}}}
@@ -0,0 +1 @@
{"root_group":{"id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"status 200","path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":2253,"fails":0},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":2253,"fails":0}],"name":"","path":""},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5000.271503},"metrics":{"iterations":{"type":"counter","contains":"default","values":{"count":2253,"rate":450.57553347818686}},"http_req_failed":{"values":{"rate":0,"passes":0,"fails":2253},"type":"rate","contains":"default"},"http_req_blocked":{"type":"trend","contains":"time","values":{"med":0.001084,"p(50)":0.001084,"p(95)":0.003083,"p(99)":0.005101999999999997,"max":1.077708,"avg":0.002211543719485143,"min":0.000541}},"http_req_duration{expected_response:true}":{"contains":"time","values":{"max":48.953416,"avg":2.130954683976918,"min":1.450709,"med":1.854375,"p(50)":1.854375,"p(95)":3.1597245999999988,"p(99)":6.159564999999994},"thresholds":{"max>=0":{"ok":true}},"type":"trend"},"http_req_tls_handshaking":{"values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0},"type":"trend","contains":"time"},"http_req_waiting":{"type":"trend","contains":"time","values":{"p(50)":1.829334,"p(95)":3.076249599999998,"p(99)":5.8753721599999995,"max":46.974291,"avg":2.093924473146916,"min":1.435209,"med":1.829334}},"data_received":{"type":"counter","contains":"data","values":{"count":32801427,"rate":6559929.191908922}},"http_req_duration":{"type":"trend","contains":"time","values":{"max":48.953416,"avg":2.130954683976918,"min":1.450709,"med":1.854375,"p(50)":1.854375,"p(95)":3.1597245999999988,"p(99)":6.159564999999994}},"data_sent":{"values":{"rate":188340.57299388212,"count":941754},"type":"counter","contains":"data"},"checks":{"type":"rate","contains":"default","values":{"passes":4506,"fails":0,"rate":1}},"vus":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"http_req_connecting":{"type":"trend","contains":"time","values":{"p(99)":0,"max":0.133541,"avg":0.00005927252552152685,"min":0,"med":0,"p(50)":0,"p(95)":0}},"http_req_sending":{"type":"trend","contains":"time","values":{"p(99)":0.02248167999999998,"max":0.838458,"avg":0.005323498890368457,"min":0.001584,"med":0.003125,"p(50)":0.003125,"p(95)":0.013391799999999995}},"http_req_receiving":{"type":"trend","contains":"time","values":{"p(99)":0.12193715999999993,"max":1.96425,"avg":0.03170671193963595,"min":0.011792,"med":0.021958,"p(50)":0.021958,"p(95)":0.07168319999999995}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(95)":3.307266199999999,"p(99)":6.396825319999996,"max":52.15775,"avg":2.2152040532623154,"min":1.500041,"med":1.926208,"p(50)":1.926208}},"vus_max":{"values":{"value":1,"min":1,"max":1},"type":"gauge","contains":"default"},"http_reqs":{"values":{"count":2253,"rate":450.57553347818686},"type":"counter","contains":"default"}}}
@@ -0,0 +1 @@
{"root_group":{"id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":3053,"fails":0,"name":"status 200","path":"::status 200"},{"id":"736a4affc4111c8285c374c0b4d25aed","passes":3053,"fails":0,"name":"full page","path":"::full page"}],"name":"","path":""},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5020.045753},"metrics":{"http_req_tls_handshaking":{"values":{"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0},"type":"trend","contains":"time"},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":3053}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":6106,"fails":0}},"http_req_connecting":{"type":"trend","contains":"time","values":{"avg":0.0005948110055682934,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.3855}},"data_sent":{"type":"counter","contains":"data","values":{"count":1276154,"rate":254211.6273018757}},"vus":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"http_req_duration":{"contains":"time","values":{"avg":26.181166798886302,"min":7.941916,"med":22.064041,"p(50)":22.064041,"p(95)":56.76235899999999,"p(99)":79.45444183999999,"max":216.868917},"type":"trend"},"http_req_sending":{"type":"trend","contains":"time","values":{"avg":0.0049047608909270025,"min":0.001625,"med":0.003,"p(50)":0.003,"p(95)":0.013350399999999995,"p(99)":0.028433839999999995,"max":0.291166}},"http_req_blocked":{"contains":"time","values":{"max":0.978125,"avg":0.005365760890927007,"min":0.000458,"med":0.000917,"p(50)":0.000917,"p(95)":0.0036833999999999947,"p(99)":0.00958348},"type":"trend"},"vus_max":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"data_received":{"contains":"data","values":{"count":44448627,"rate":8854227.4686316},"type":"counter"},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"avg":26.181166798886302,"min":7.941916,"med":22.064041,"p(50)":22.064041,"p(95)":56.76235899999999,"p(99)":79.45444183999999,"max":216.868917},"thresholds":{"max>=0":{"ok":true}}},"iterations":{"type":"counter","contains":"default","values":{"count":3053,"rate":608.1617878035304}},"http_reqs":{"type":"counter","contains":"default","values":{"count":3053,"rate":608.1617878035304}},"http_req_waiting":{"contains":"time","values":{"avg":26.148865134621694,"min":7.918167,"med":22.042416,"p(50)":22.042416,"p(95)":56.74389139999999,"p(99)":79.375535,"max":216.794583},"type":"trend"},"iteration_duration":{"type":"trend","contains":"time","values":{"avg":26.265951053717636,"min":8.001958,"med":22.146833,"p(50)":22.146833,"p(95)":56.88824999999999,"p(99)":79.64376315999999,"max":217.035042}},"http_req_receiving":{"contains":"time","values":{"avg":0.02739690337373078,"min":0.007542,"med":0.019208,"p(50)":0.019208,"p(95)":0.07083299999999991,"p(99)":0.13634999999999997,"max":0.743542},"type":"trend"}}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"status 200","path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":3164,"fails":0},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":3164,"fails":0}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdErrTTY":false,"testRunDurationMs":5004.397627,"isStdOutTTY":false},"metrics":{"http_req_sending":{"type":"trend","contains":"time","values":{"p(95)":0.012910699999999994,"p(99)":0.025209,"max":0.163083,"avg":0.0050704216182048505,"min":0.001542,"med":0.003375,"p(50)":0.003375}},"data_received":{"type":"counter","contains":"data","values":{"rate":9204839.310023915,"count":46064676}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"p(99)":14.285878459999994,"max":55.594459,"avg":6.2370559108723205,"min":3.327209,"med":5.6359794999999995,"p(50)":5.6359794999999995,"p(95)":8.469265149999998},"thresholds":{"max>=0":{"ok":true}}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0,"med":0}},"http_req_connecting":{"type":"trend","contains":"time","values":{"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.201958,"avg":0.00019118710493046777}},"vus":{"type":"gauge","contains":"default","values":{"value":4,"min":4,"max":4}},"http_req_blocked":{"type":"trend","contains":"time","values":{"avg":0.002943344500632133,"min":0.0005,"med":0.001042,"p(50)":0.001042,"p(95)":0.003167,"p(99)":0.006640169999999999,"max":1.206834}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(50)":5.7143125,"p(95)":8.6252608,"p(99)":14.427661249999995,"max":55.678792,"avg":6.320211902338795,"min":3.404083,"med":5.7143125}},"checks":{"type":"rate","contains":"default","values":{"passes":6328,"fails":0,"rate":1}},"http_req_duration":{"values":{"p(99)":14.285878459999994,"max":55.594459,"avg":6.2370559108723205,"min":3.327209,"med":5.6359794999999995,"p(50)":5.6359794999999995,"p(95)":8.469265149999998},"type":"trend","contains":"time"},"http_reqs":{"type":"counter","contains":"default","values":{"count":3164,"rate":632.2439254086074}},"http_req_waiting":{"contains":"time","values":{"min":3.305417,"med":5.605938,"p(50)":5.605938,"p(95)":8.4078536,"p(99)":14.12857749999999,"max":55.554666,"avg":6.202394768963339},"type":"trend"},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":3164}},"data_sent":{"type":"counter","contains":"data","values":{"count":1322552,"rate":264277.9608207979}},"vus_max":{"type":"gauge","contains":"default","values":{"max":4,"value":4,"min":4}},"iterations":{"type":"counter","contains":"default","values":{"rate":632.2439254086074,"count":3164}},"http_req_receiving":{"contains":"time","values":{"p(95)":0.06993379999999998,"p(99)":0.12717124999999999,"max":1.720959,"avg":0.029590720290771172,"min":0.009,"med":0.0203335,"p(50)":0.0203335},"type":"trend"}}}
@@ -0,0 +1 @@
{"root_group":{"checks":[{"name":"status 200","path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":2489,"fails":0},{"fails":0,"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":2489}],"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[]},"options":{"summaryTimeUnit":"","noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5001.461169},"metrics":{"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"max":3.887292,"avg":1.9278422800321393,"min":1.5285,"med":1.855875,"p(50)":1.855875,"p(95)":2.4594664,"p(99)":2.9532430799999996}},"iterations":{"type":"counter","contains":"default","values":{"count":2489,"rate":497.65456851435573}},"vus":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0,"med":0,"p(50)":0}},"data_sent":{"type":"counter","contains":"data","values":{"count":1040402,"rate":208019.6096390007}},"http_req_connecting":{"type":"trend","contains":"time","values":{"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.1185,"avg":0.00004760948171956609}},"checks":{"contains":"default","values":{"rate":1,"passes":4978,"fails":0},"type":"rate"},"http_req_duration":{"type":"trend","contains":"time","values":{"p(95)":2.4594664,"p(99)":2.9532430799999996,"max":3.887292,"avg":1.9278422800321393,"min":1.5285,"med":1.855875,"p(50)":1.855875}},"http_req_failed":{"contains":"default","values":{"passes":0,"fails":2489,"rate":0},"type":"rate"},"http_reqs":{"type":"counter","contains":"default","values":{"count":2489,"rate":497.65456851435573}},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(99)":0.004347999999999998,"max":0.4935,"avg":0.0016562591402169465,"min":0.000583,"med":0.001208,"p(50)":0.001208,"p(95)":0.0024835999999999955}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":0.1295,"avg":0.004578830453997602,"min":0.00175,"med":0.003417,"p(50)":0.003417,"p(95)":0.010566599999999995,"p(99)":0.02178311999999999}},"http_req_receiving":{"type":"trend","contains":"time","values":{"p(99)":0.09022303999999998,"max":0.437791,"avg":0.02939842948975484,"min":0.012542,"med":0.023833,"p(50)":0.023833,"p(95)":0.05711639999999999}},"vus_max":{"values":{"max":1,"value":1,"min":1},"type":"gauge","contains":"default"},"http_req_waiting":{"type":"trend","contains":"time","values":{"med":1.824667,"p(50)":1.824667,"p(95)":2.4054667999999997,"p(99)":2.86957696,"max":3.795709,"avg":1.8938650200883875,"min":1.506584}},"data_received":{"type":"counter","contains":"data","values":{"count":36237351,"rate":7245352.863000505}},"iteration_duration":{"values":{"p(50)":1.928834,"p(95)":2.579233,"p(99)":3.10140196,"max":4.283792,"avg":2.0054184089995983,"min":1.586875,"med":1.928834},"type":"trend","contains":"time"}}}
@@ -0,0 +1 @@
{"root_group":{"checks":[{"path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":3513,"fails":0,"name":"status 200"},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":3513,"fails":0}],"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[]},"options":{"noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":""},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5016.84253},"metrics":{"http_req_blocked":{"type":"trend","contains":"time","values":{"avg":0.0038652063763165647,"min":0.000458,"med":0.000833,"p(50)":0.000833,"p(95)":0.00175,"p(99)":0.004948039999999997,"max":0.896958}},"http_req_connecting":{"type":"trend","contains":"time","values":{"p(99)":0,"max":0.369333,"avg":0.0005176606888699117,"min":0,"med":0,"p(50)":0,"p(95)":0}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":0.081167,"avg":0.0033468306290919824,"min":0.001708,"med":0.002709,"p(50)":0.002709,"p(95)":0.005933399999999994,"p(99)":0.014454999999999989}},"http_req_receiving":{"values":{"med":0.017459,"p(50)":0.017459,"p(95)":0.040733399999999975,"p(99)":0.08879687999999997,"max":0.717167,"avg":0.021207658411614004,"min":0.006875},"type":"trend","contains":"time"},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":7026,"fails":0}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"min":8.515959,"med":20.992125,"p(50)":20.992125,"p(95)":39.748124999999995,"p(99)":61.90779,"max":85.8895,"avg":22.743520846569826},"thresholds":{"max>=0":{"ok":true}}},"http_req_duration":{"type":"trend","contains":"time","values":{"p(50)":20.992125,"p(95)":39.748124999999995,"p(99)":61.90779,"max":85.8895,"avg":22.743520846569826,"min":8.515959,"med":20.992125}},"http_reqs":{"type":"counter","contains":"default","values":{"count":3513,"rate":700.2412332045033}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0}},"vus":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"iterations":{"type":"counter","contains":"default","values":{"count":3513,"rate":700.2412332045033}},"data_received":{"type":"counter","contains":"data","values":{"count":51145767,"rate":10194812.114224363}},"iteration_duration":{"type":"trend","contains":"time","values":{"med":21.050208,"p(50)":21.050208,"p(95)":39.80692539999999,"p(99)":61.97183496,"max":85.983333,"avg":22.810347667805306,"min":8.574542}},"http_req_waiting":{"type":"trend","contains":"time","values":{"med":20.971459,"p(50)":20.971459,"p(95)":39.728266999999995,"p(99)":61.880613000000004,"max":85.871209,"avg":22.718966357529222,"min":8.490875}},"http_req_failed":{"type":"rate","contains":"default","values":{"fails":3513,"rate":0,"passes":0}},"data_sent":{"values":{"count":1468434,"rate":292700.83547948237},"type":"counter","contains":"data"},"vus_max":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}}}}
@@ -0,0 +1 @@
{"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5002.932919},"metrics":{"vus_max":{"type":"gauge","contains":"default","values":{"value":4,"min":4,"max":4}},"http_req_connecting":{"contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0.301459,"avg":0.00028230925644916535,"min":0,"med":0},"type":"trend"},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":3295}},"data_sent":{"type":"counter","contains":"data","values":{"count":1377310,"rate":275300.5131788376}},"http_req_duration":{"type":"trend","contains":"time","values":{"p(50)":5.215209,"p(95)":8.5245456,"p(99)":18.93017893999999,"max":62.826125,"avg":5.990473185128973,"min":3.696667,"med":5.215209}},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"avg":5.990473185128973,"min":3.696667,"med":5.215209,"p(50)":5.215209,"p(95)":8.5245456,"p(99)":18.93017893999999,"max":62.826125}},"iteration_duration":{"contains":"time","values":{"p(99)":19.375204999999994,"max":62.891458,"avg":6.06830401305007,"min":3.759125,"med":5.277125,"p(50)":5.277125,"p(95)":8.6376252},"type":"trend"},"http_req_tls_handshaking":{"values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0,"med":0},"type":"trend","contains":"time"},"http_req_receiving":{"contains":"time","values":{"max":0.495083,"avg":0.026285457966616056,"min":0.008625,"med":0.018125,"p(50)":0.018125,"p(95)":0.06477519999999999,"p(99)":0.1371625},"type":"trend"},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":6590,"fails":0}},"iterations":{"contains":"default","values":{"count":3295,"rate":658.613667891956},"type":"counter"},"http_req_blocked":{"contains":"time","values":{"avg":0.002571095599393056,"min":0.0005,"med":0.000916,"p(50)":0.000916,"p(95)":0.002833,"p(99)":0.006257499999999997,"max":1.104917},"type":"trend"},"http_reqs":{"type":"counter","contains":"default","values":{"count":3295,"rate":658.613667891956}},"http_req_sending":{"type":"trend","contains":"time","values":{"med":0.002791,"p(50)":0.002791,"p(95)":0.012167,"p(99)":0.040491459999999986,"max":0.184,"avg":0.004774410015174558,"min":0.001625}},"http_req_waiting":{"contains":"time","values":{"min":3.673,"med":5.189625,"p(50)":5.189625,"p(95)":8.479216999999998,"p(99)":18.780699959999993,"max":62.797958,"avg":5.959413317147188},"type":"trend"},"vus":{"type":"gauge","contains":"default","values":{"value":4,"min":4,"max":4}},"data_received":{"type":"counter","contains":"data","values":{"rate":9588756.390838988,"count":47971905}}},"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":3295,"fails":0,"name":"status 200","path":"::status 200"},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":3295,"fails":0}]},"options":{"noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":""}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"status 200","path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":2228,"fails":0},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":2228,"fails":0}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5001.965738},"metrics":{"http_req_receiving":{"type":"trend","contains":"time","values":{"avg":0.03563683258527831,"min":0.011542,"med":0.028167,"p(50)":0.028167,"p(95)":0.07769364999999999,"p(99)":0.1147145,"max":0.309416}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":2228}},"iteration_duration":{"type":"trend","contains":"time","values":{"min":1.626542,"med":2.0358539999999996,"p(50)":2.0358539999999996,"p(95)":3.12250185,"p(99)":4.305317,"max":80.91475,"avg":2.2400195915619383}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":0.326291,"avg":0.006153988330341136,"min":0.00175,"med":0.0041665,"p(50)":0.0041665,"p(95)":0.014818949999999996,"p(99)":0.025863659999999997}},"http_req_waiting":{"type":"trend","contains":"time","values":{"min":1.533625,"med":1.920375,"p(50)":1.920375,"p(95)":2.9227458499999996,"p(99)":3.9958985,"max":80.612167,"avg":2.107480340664276}},"http_req_duration":{"type":"trend","contains":"time","values":{"min":1.564208,"med":1.9531245,"p(50)":1.9531245,"p(95)":2.99771865,"p(99)":4.121174819999999,"max":80.766334,"avg":2.14927116157989}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":4456,"fails":0}},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"p(95)":2.99771865,"p(99)":4.121174819999999,"max":80.766334,"avg":2.14927116157989,"min":1.564208,"med":1.9531245,"p(50)":1.9531245}},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(99)":0.00529173,"max":0.534208,"avg":0.0019440228904847405,"min":0.000542,"med":0.001292,"p(50)":0.001292,"p(95)":0.00325}},"http_req_connecting":{"type":"trend","contains":"time","values":{"max":0.124625,"avg":0.00005593581687612208,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0}},"vus":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"vus_max":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"data_sent":{"type":"counter","contains":"data","values":{"count":931304,"rate":186187.60079159902}},"data_received":{"type":"counter","contains":"data","values":{"count":32437452,"rate":6484940.861064331}},"http_req_tls_handshaking":{"contains":"time","values":{"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0},"type":"trend"},"iterations":{"type":"counter","contains":"default","values":{"count":2228,"rate":445.4248822765527}},"http_reqs":{"contains":"default","values":{"count":2228,"rate":445.4248822765527},"type":"counter"}}}
@@ -0,0 +1 @@
{"options":{"summaryTimeUnit":"","noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":5015.283336},"metrics":{"iteration_duration":{"type":"trend","contains":"time","values":{"med":23.878833,"p(50)":23.878833,"p(95)":50.81040819999995,"p(99)":76.99555355999999,"max":128.572042,"avg":26.41199930926477,"min":9.207541}},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"p(95)":50.60700019999997,"p(99)":76.91052544,"max":128.476833,"avg":26.32275204780749,"min":9.137334,"med":23.794334,"p(50)":23.794334}},"http_req_waiting":{"values":{"p(99)":76.86861144,"max":128.426959,"avg":26.28821623244314,"min":9.108375,"med":23.763625,"p(50)":23.763625,"p(95)":50.55655839999997},"type":"trend","contains":"time"},"http_req_receiving":{"type":"trend","contains":"time","values":{"max":0.356375,"avg":0.02940985262116716,"min":0.00775,"med":0.022917,"p(50)":0.022917,"p(95)":0.06189999999999995,"p(99)":0.12834543999999976}},"vus":{"values":{"value":16,"min":16,"max":16},"type":"gauge","contains":"default"},"http_req_duration":{"type":"trend","contains":"time","values":{"med":23.794334,"p(50)":23.794334,"p(95)":50.60700019999997,"p(99)":76.91052544,"max":128.476833,"avg":26.32275204780749,"min":9.137334}},"http_req_connecting":{"type":"trend","contains":"time","values":{"avg":0.0018773775140125289,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.593542}},"data_sent":{"type":"counter","contains":"data","values":{"count":1267794,"rate":252786.1169676496}},"vus_max":{"values":{"min":16,"max":16,"value":16},"type":"gauge","contains":"default"},"http_reqs":{"type":"counter","contains":"default","values":{"rate":604.7514759991617,"count":3033}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":3033}},"http_req_blocked":{"values":{"p(50)":0.001125,"p(95)":0.002625,"p(99)":0.010265439999999999,"max":0.997375,"avg":0.004977574019123037,"min":0.000541,"med":0.001125},"type":"trend","contains":"time"},"data_received":{"type":"counter","contains":"data","values":{"count":44157447,"rate":8804576.739071796}},"http_req_tls_handshaking":{"contains":"time","values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0},"type":"trend"},"http_req_sending":{"type":"trend","contains":"time","values":{"avg":0.0051259627431586435,"min":0.001958,"med":0.003833,"p(50)":0.003833,"p(95)":0.011349799999999993,"p(99)":0.021058999999999967,"max":0.182}},"checks":{"type":"rate","contains":"default","values":{"passes":6066,"fails":0,"rate":1}},"iterations":{"type":"counter","contains":"default","values":{"count":3033,"rate":604.7514759991617}}},"root_group":{"path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1","passes":3033,"fails":0,"name":"status 200"},{"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":3033,"fails":0}],"name":""}}
@@ -0,0 +1 @@
{"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdErrTTY":false,"testRunDurationMs":5004.963419,"isStdOutTTY":false},"metrics":{"http_req_sending":{"type":"trend","contains":"time","values":{"avg":0.00465384713763708,"min":0.0015,"med":0.002875,"p(50)":0.002875,"p(95)":0.011208,"p(99)":0.030532219999999968,"max":0.432875}},"iterations":{"contains":"default","values":{"count":3284,"rate":656.1486518629039},"type":"counter"},"vus":{"contains":"default","values":{"value":4,"min":4,"max":4},"type":"gauge"},"http_req_duration":{"type":"trend","contains":"time","values":{"avg":6.01513668544458,"min":4.157959,"med":5.418854,"p(50)":5.418854,"p(95)":8.585795549999997,"p(99)":15.028389109999997,"max":44.245083}},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(99)":0.0054800799999999966,"max":0.631083,"avg":0.0020061522533495954,"min":0.0005,"med":0.000917,"p(50)":0.000917,"p(95)":0.002583}},"http_req_receiving":{"type":"trend","contains":"time","values":{"med":0.01925,"p(50)":0.01925,"p(95)":0.06489809999999999,"p(99)":0.12631807999999994,"max":0.540167,"avg":0.027042937576126646,"min":0.006625}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(99)":15.267310859999997,"max":44.328083,"avg":6.090102879110868,"min":4.221208,"med":5.487125000000001,"p(50)":5.487125000000001,"p(95)":8.740737549999997}},"vus_max":{"contains":"default","values":{"value":4,"min":4,"max":4},"type":"gauge"},"http_req_waiting":{"values":{"p(95)":8.5182838,"p(99)":14.989583249999997,"max":44.21025,"avg":5.983439900730812,"min":4.141667,"med":5.392291500000001,"p(50)":5.392291500000001},"type":"trend","contains":"time"},"http_req_duration{expected_response:true}":{"contains":"time","values":{"p(50)":5.418854,"p(95)":8.585795549999997,"p(99)":15.028389109999997,"max":44.245083,"avg":6.01513668544458,"min":4.157959,"med":5.418854},"thresholds":{"max>=0":{"ok":true}},"type":"trend"},"data_received":{"type":"counter","contains":"data","values":{"count":47811756,"rate":9552868.222472018}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":6568,"fails":0}},"http_reqs":{"type":"counter","contains":"default","values":{"count":3284,"rate":656.1486518629039}},"http_req_tls_handshaking":{"values":{"p(99)":0,"max":0,"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0},"type":"trend","contains":"time"},"http_req_failed":{"type":"rate","contains":"default","values":{"passes":0,"fails":3284,"rate":0}},"data_sent":{"type":"counter","contains":"data","values":{"count":1372712,"rate":274270.1364786938}},"http_req_connecting":{"type":"trend","contains":"time","values":{"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.124875,"avg":0.0001106123629719854}}},"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"passes":3284,"fails":0,"name":"status 200","path":"::status 200","id":"fad9fa412b86fcb03bee97c80dcd61f1"},{"fails":0,"name":"full page","path":"::full page","id":"736a4affc4111c8285c374c0b4d25aed","passes":3284}]}}
@@ -0,0 +1 @@
{"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":2021.613876},"metrics":{"http_req_sending":{"contains":"time","values":{"p(50)":0.003209,"p(95)":0.007051449999999991,"p(99)":0.016355239999999983,"max":0.171125,"avg":0.004454332000000001,"min":0.002166,"med":0.003209},"type":"trend"},"data_received":{"values":{"count":490000,"rate":242380.60779911268},"type":"counter","contains":"data"},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":1000}},"iteration_duration":{"type":"trend","contains":"time","values":{"avg":2.0185759639999983,"min":1.753,"med":1.939479,"p(50)":1.939479,"p(95)":2.41536875,"p(99)":3.1912434199999997,"max":8.462792}},"vus_max":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"vus":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"http_req_duration":{"values":{"p(95)":2.3432568499999995,"p(99)":3.1071454199999997,"max":7.759667,"avg":1.9696032060000013,"min":1.710708,"med":1.8914170000000001,"p(50)":1.8914170000000001},"type":"trend","contains":"time"},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(50)":0.000917,"p(95)":0.00179105,"p(99)":0.0025909199999999927,"max":0.473667,"avg":0.0015324739999999924,"min":0.0005,"med":0.000917}},"iterations":{"contains":"default","values":{"count":1000,"rate":494.6543016308422},"type":"counter"},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0}},"http_req_waiting":{"type":"trend","contains":"time","values":{"min":1.694208,"med":1.8758545,"p(50)":1.8758545,"p(95)":2.315538099999999,"p(99)":3.0497805099999997,"max":7.665541,"avg":1.9512902819999978}},"http_req_connecting":{"values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.127792,"avg":0.000127792,"min":0},"type":"trend","contains":"time"},"checks":{"type":"rate","contains":"default","values":{"passes":1000,"fails":0,"rate":1}},"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":185990.01741319668}},"http_req_receiving":{"type":"trend","contains":"time","values":{"med":0.012125,"p(50)":0.012125,"p(95)":0.024879199999999997,"p(99)":0.03991992,"max":0.092458,"avg":0.013858591999999942,"min":0.009209}},"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":494.6543016308422}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"p(50)":1.8914170000000001,"p(95)":2.3432568499999995,"p(99)":3.1071454199999997,"max":7.759667,"avg":1.9696032060000013,"min":1.710708,"med":1.8914170000000001},"thresholds":{"max>=0":{"ok":true}}}},"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true}}
@@ -0,0 +1 @@
{"root_group":{"path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0,"name":"message 201","path":"::message 201"}],"name":""},"options":{"summaryTimeUnit":"","noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":1900.4515},"metrics":{"http_req_sending":{"type":"trend","contains":"time","values":{"avg":0.007713278999999991,"min":0.002333,"med":0.004833,"p(50)":0.004833,"p(95)":0.01741905,"p(99)":0.06015582999999997,"max":0.256458}},"http_req_receiving":{"type":"trend","contains":"time","values":{"p(50)":0.015854,"p(95)":0.047,"p(99)":0.07451416999999999,"max":0.1795,"avg":0.020503382000000004,"min":0.005458,"med":0.015854}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":1000}},"data_sent":{"values":{"count":376000,"rate":197847.7219755411},"type":"counter","contains":"data"},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"avg":30.142481124999993,"min":12.528875,"med":27.190708,"p(50)":27.190708,"p(95)":56.23626045,"p(99)":87.50877351,"max":110.388208},"thresholds":{"max>=0":{"ok":true}}},"http_req_duration":{"type":"trend","contains":"time","values":{"min":12.528875,"med":27.190708,"p(50)":27.190708,"p(95)":56.23626045,"p(99)":87.50877351,"max":110.388208,"avg":30.142481124999993}},"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":526.1907499349497}},"http_req_blocked":{"values":{"p(99)":0.9029430899999998,"max":1.221792,"avg":0.016780967999999993,"min":0.000583,"med":0.00125,"p(50)":0.00125,"p(95)":0.003463149999999996},"type":"trend","contains":"time"},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0,"med":0}},"vus":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"vus_max":{"type":"gauge","contains":"default","values":{"max":16,"value":16,"min":16}},"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":526.1907499349497}},"http_req_connecting":{"type":"trend","contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0.11269291999999972,"max":0.280167,"avg":0.0025576670000000004,"min":0,"med":0}},"iteration_duration":{"type":"trend","contains":"time","values":{"med":27.375583,"p(50)":27.375583,"p(95)":56.32066395,"p(99)":87.600088,"max":110.487292,"avg":30.240331432000016,"min":12.586916}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"http_req_waiting":{"values":{"avg":30.11426446400001,"min":12.5105,"med":27.171146,"p(50)":27.171146,"p(95)":56.2112128,"p(99)":87.47325934,"max":110.353167},"type":"trend","contains":"time"},"data_received":{"type":"counter","contains":"data","values":{"count":490000,"rate":257833.46746812534}}}}
@@ -0,0 +1 @@
{"root_group":{"groups":[],"checks":[{"fails":0,"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000}],"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e"},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":1589.382459},"metrics":{"http_reqs":{"type":"counter","contains":"default","values":{"rate":629.1751833156477,"count":1000}},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(99)":0.005208839999999999,"max":0.857708,"avg":0.004010209999999984,"min":0.0005,"med":0.000917,"p(50)":0.000917,"p(95)":0.002375}},"data_received":{"type":"counter","contains":"data","values":{"count":490000,"rate":308295.8398246674}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(50)":5.846125000000001,"p(95)":8.088834799999997,"p(99)":10.23388625,"max":69.224,"avg":6.349634796999996,"min":4.631417,"med":5.846125000000001}},"http_req_duration":{"type":"trend","contains":"time","values":{"min":4.592292,"med":5.7915835,"p(50)":5.7915835,"p(95)":8.02284405,"p(99)":9.853355089999999,"max":69.173459,"avg":6.284986049000003}},"http_req_connecting":{"type":"trend","contains":"time","values":{"max":0.285667,"avg":0.001103625,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0}},"vus":{"type":"gauge","contains":"default","values":{"min":4,"max":4,"value":4}},"vus_max":{"type":"gauge","contains":"default","values":{"value":4,"min":4,"max":4}},"http_req_waiting":{"values":{"min":4.581584,"med":5.773104,"p(50)":5.773104,"p(95)":8.0024473,"p(99)":9.83730333,"max":69.161709,"avg":6.264457304000002},"type":"trend","contains":"time"},"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":629.1751833156477}},"http_req_failed":{"values":{"passes":0,"fails":1000,"rate":0},"type":"rate","contains":"default"},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"avg":6.284986049000003,"min":4.592292,"med":5.7915835,"p(50)":5.7915835,"p(95)":8.02284405,"p(99)":9.853355089999999,"max":69.173459},"thresholds":{"max>=0":{"ok":true}}},"http_req_sending":{"values":{"p(95)":0.013752099999999998,"p(99)":0.04218115999999999,"max":0.088208,"avg":0.005368999999999992,"min":0.001875,"med":0.003417,"p(50)":0.003417},"type":"trend","contains":"time"},"http_req_receiving":{"type":"trend","contains":"time","values":{"avg":0.015159744999999985,"min":0.005291,"med":0.0116455,"p(50)":0.0116455,"p(95)":0.03600834999999999,"p(99)":0.07642516999999999,"max":0.1365}},"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":236569.86892668356}}}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0,"name":"message 201"}]},"options":{"summaryTimeUnit":"","noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"]},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":2456.906293},"metrics":{"iteration_duration":{"type":"trend","contains":"time","values":{"med":2.1066255,"p(50)":2.1066255,"p(95)":3.9687506499999983,"p(99)":5.833210919999999,"max":14.809083,"avg":2.4525510519999973,"min":1.73325}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"p(99)":0,"max":0,"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0}},"http_req_waiting":{"type":"trend","contains":"time","values":{"avg":2.3536451560000025,"min":1.683541,"med":2.0332915,"p(50)":2.0332915,"p(95)":3.779387799999999,"p(99)":5.57392226,"max":14.631458}},"http_req_connecting":{"type":"trend","contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0.161542,"avg":0.00016154199999999998,"min":0,"med":0}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":0.161208,"avg":0.006530930999999994,"min":0.002208,"med":0.004125,"p(50)":0.004125,"p(95)":0.015429499999999988,"p(99)":0.02822148999999999}},"http_req_blocked":{"contains":"time","values":{"max":0.66825,"avg":0.002167687999999994,"min":0.000583,"med":0.001166,"p(50)":0.001166,"p(95)":0.002875,"p(99)":0.004917},"type":"trend"},"data_received":{"contains":"data","values":{"count":490000,"rate":199437.80574622023},"type":"counter"},"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":407.01593009432696}},"http_req_duration":{"values":{"p(99)":5.662027919999999,"max":14.681958,"avg":2.381875646999998,"min":1.696625,"med":2.053729,"p(50)":2.053729,"p(95)":3.8517351},"type":"trend","contains":"time"},"http_req_receiving":{"type":"trend","contains":"time","values":{"max":0.181625,"avg":0.02169956000000001,"min":0.009458,"med":0.0154375,"p(50)":0.0154375,"p(95)":0.04959964999999999,"p(99)":0.09181416999999994}},"vus":{"type":"gauge","contains":"default","values":{"max":1,"value":1,"min":1}},"http_reqs":{"values":{"count":1000,"rate":407.01593009432696},"type":"counter","contains":"default"},"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":153037.98971546695}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"vus_max":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"min":1.696625,"med":2.053729,"p(50)":2.053729,"p(95)":3.8517351,"p(99)":5.662027919999999,"max":14.681958,"avg":2.381875646999998},"thresholds":{"max>=0":{"ok":true}}},"http_req_failed":{"contains":"default","values":{"passes":0,"fails":1000,"rate":0},"type":"rate"}}}
@@ -0,0 +1 @@
{"state":{"isStdErrTTY":false,"testRunDurationMs":1671.702959,"isStdOutTTY":false},"metrics":{"http_req_duration":{"type":"trend","contains":"time","values":{"max":85.161833,"avg":26.558928253,"min":11.961666,"med":25.079667,"p(50)":25.079667,"p(95)":40.415920849999985,"p(99)":77.28657292}},"http_req_sending":{"type":"trend","contains":"time","values":{"p(50)":0.003791,"p(95)":0.011675299999999993,"p(99)":0.21840148999999995,"max":0.435375,"avg":0.008641250000000019,"min":0.002375,"med":0.003791}},"vus_max":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":598.1923969304884}},"http_req_receiving":{"type":"trend","contains":"time","values":{"p(99)":0.051051579999999985,"max":0.1265,"avg":0.01675562499999996,"min":0.004708,"med":0.01425,"p(50)":0.01425,"p(95)":0.0343792}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":224920.34124586364}},"data_received":{"type":"counter","contains":"data","values":{"rate":293114.2744959393,"count":490000}},"http_req_duration{expected_response:true}":{"contains":"time","values":{"p(50)":25.079667,"p(95)":40.415920849999985,"p(99)":77.28657292,"max":85.161833,"avg":26.558928253,"min":11.961666,"med":25.079667},"thresholds":{"max>=0":{"ok":true}},"type":"trend"},"http_req_tls_handshaking":{"contains":"time","values":{"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0,"med":0},"type":"trend"},"vus":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"http_req_blocked":{"type":"trend","contains":"time","values":{"med":0.001,"p(50)":0.001,"p(95)":0.002417,"p(99)":1.01049509,"max":1.710083,"avg":0.01933059000000015,"min":0.000459}},"iteration_duration":{"type":"trend","contains":"time","values":{"med":25.145021,"p(50)":25.145021,"p(95)":40.57707049999999,"p(99)":77.36564084,"max":85.333709,"avg":26.642562094999988,"min":12.025333}},"http_req_waiting":{"type":"trend","contains":"time","values":{"p(95)":40.37399134999998,"p(99)":77.23113791,"max":85.117583,"avg":26.53353137800002,"min":11.941917,"med":25.060375,"p(50)":25.060375}},"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":598.1923969304884}},"http_req_connecting":{"contains":"time","values":{"p(95)":0,"p(99)":0.09022424999999998,"max":0.447375,"avg":0.002195625,"min":0,"med":0,"p(50)":0},"type":"trend"},"http_req_failed":{"contains":"default","values":{"rate":0,"passes":0,"fails":1000},"type":"rate"}},"root_group":{"id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"fails":0,"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000}],"name":"","path":""},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"testRunDurationMs":1634.717626,"isStdOutTTY":false,"isStdErrTTY":false},"metrics":{"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":611.7264438182549}},"http_req_sending":{"type":"trend","contains":"time","values":{"p(95)":0.01946939999999999,"p(99)":0.04043058999999999,"max":0.19025,"avg":0.006797146999999998,"min":0.002083,"med":0.00375,"p(50)":0.00375}},"vus_max":{"type":"gauge","contains":"default","values":{"value":4,"min":4,"max":4}},"http_req_receiving":{"contains":"time","values":{"p(50)":0.012458,"p(95)":0.05279315,"p(99)":0.08282892999999997,"max":0.136709,"avg":0.018673963999999967,"min":0.005125,"med":0.012458},"type":"trend"},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"p(99)":12.299225829999994,"max":15.930416,"avg":6.453734133999994,"min":4.777416,"med":5.685396,"p(50)":5.685396,"p(95)":10.717775649999998}},"http_req_tls_handshaking":{"values":{"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0},"type":"trend","contains":"time"},"vus":{"type":"gauge","contains":"default","values":{"min":4,"max":4,"value":4}},"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":611.7264438182549}},"http_req_connecting":{"values":{"p(95)":0,"p(99)":0,"max":0.393,"avg":0.000914126,"min":0,"med":0,"p(50)":0},"type":"trend","contains":"time"},"http_req_waiting":{"type":"trend","contains":"time","values":{"avg":6.428263022999998,"min":4.757958,"med":5.663042,"p(50)":5.663042,"p(95)":10.639974699999998,"p(99)":12.242283249999995,"max":15.88825}},"http_req_failed":{"type":"rate","contains":"default","values":{"rate":0,"passes":0,"fails":1000}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"http_req_blocked":{"contains":"time","values":{"avg":0.005559838000000025,"min":0.000541,"med":0.001,"p(50)":0.001,"p(95)":0.003625,"p(99)":0.008846749999999988,"max":1.051},"type":"trend"},"data_received":{"values":{"count":490000,"rate":299745.9574709449},"type":"counter","contains":"data"},"data_sent":{"contains":"data","values":{"count":376000,"rate":230009.14287566382},"type":"counter"},"iteration_duration":{"type":"trend","contains":"time","values":{"max":16.075209,"avg":6.530070587,"min":4.819375,"med":5.7436665,"p(50)":5.7436665,"p(95)":10.875543749999999,"p(99)":12.471526079999995}},"http_req_duration":{"type":"trend","contains":"time","values":{"avg":6.453734133999994,"min":4.777416,"med":5.685396,"p(50)":5.685396,"p(95)":10.717775649999998,"p(99)":12.299225829999994,"max":15.930416}}}}
@@ -0,0 +1 @@
{"metrics":{"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":398.37604633991435}},"http_req_sending":{"type":"trend","contains":"time","values":{"p(99)":0.02808482,"max":1.101292,"avg":0.007326698000000011,"min":0.002375,"med":0.004292,"p(50)":0.004292,"p(95)":0.0173771}},"http_req_blocked":{"type":"trend","contains":"time","values":{"avg":0.001941851999999992,"min":0.000583,"med":0.001125,"p(50)":0.001125,"p(95)":0.003083,"p(99)":0.005835659999999999,"max":0.488917}},"data_received":{"type":"counter","contains":"data","values":{"count":490000,"rate":195204.26270655805}},"http_req_failed":{"values":{"rate":0,"passes":0,"fails":1000},"type":"rate","contains":"default"},"http_req_tls_handshaking":{"contains":"time","values":{"max":0,"avg":0,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0},"type":"trend"},"http_reqs":{"type":"counter","contains":"default","values":{"rate":398.37604633991435,"count":1000}},"checks":{"values":{"rate":1,"passes":1000,"fails":0},"type":"rate","contains":"default"},"vus_max":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"http_req_duration{expected_response:true}":{"thresholds":{"max>=0":{"ok":true}},"type":"trend","contains":"time","values":{"p(95)":3.9619981999999987,"p(99)":7.608621009999999,"max":25.02525,"avg":2.427928313000002,"min":1.713916,"med":2.0728334999999998,"p(50)":2.0728334999999998}},"http_req_duration":{"type":"trend","contains":"time","values":{"p(99)":7.608621009999999,"max":25.02525,"avg":2.427928313000002,"min":1.713916,"med":2.0728334999999998,"p(50)":2.0728334999999998,"p(95)":3.9619981999999987}},"data_sent":{"contains":"data","values":{"count":376000,"rate":149789.3934238078},"type":"counter"},"vus":{"type":"gauge","contains":"default","values":{"value":1,"min":1,"max":1}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(50)":2.128063,"p(95)":4.127093749999999,"p(99)":7.917443089999999,"max":26.058208,"avg":2.506009104999999,"min":1.774292,"med":2.128063}},"http_req_waiting":{"type":"trend","contains":"time","values":{"avg":2.396936735999999,"min":1.699875,"med":2.0524375,"p(50)":2.0524375,"p(95)":3.904655949999999,"p(99)":7.528800589999999,"max":24.933333}},"http_req_receiving":{"type":"trend","contains":"time","values":{"avg":0.023664879000000055,"min":0.009542,"med":0.015875,"p(50)":0.015875,"p(95)":0.0508381,"p(99)":0.07927666999999998,"max":2.337833}},"http_req_connecting":{"type":"trend","contains":"time","values":{"avg":0.000106875,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0.106875}}},"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0}]},"options":{"noColor":true,"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":""},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":2510.191085}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"name":"message 201","path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":2608.563821},"metrics":{"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":383.35270617095625}},"http_req_blocked":{"type":"trend","contains":"time","values":{"max":0.916834,"avg":0.011096260000000068,"min":0.000542,"med":0.0015,"p(50)":0.0015,"p(95)":0.005502049999999998,"p(99)":0.3768191699999985}},"http_req_receiving":{"type":"trend","contains":"time","values":{"min":0.005,"med":0.021,"p(50)":0.021,"p(95)":0.07484434999999999,"p(99)":0.13909316,"max":1.040542,"avg":0.03188410799999997}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":1.240833,"avg":0.012556742000000008,"min":0.00225,"med":0.006167,"p(50)":0.006167,"p(95)":0.024696149999999976,"p(99)":0.060369669999999966}},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"p(50)":32.155103999999994,"p(95)":95.91642680000001,"p(99)":125.38881823999999,"max":159.23275,"avg":41.419282618999944,"min":11.985208,"med":32.155103999999994},"thresholds":{"max>=0":{"ok":true}}},"http_req_connecting":{"type":"trend","contains":"time","values":{"p(95)":0,"p(99)":0.04960341999999998,"max":0.26025,"avg":0.001535375,"min":0,"med":0,"p(50)":0}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0}},"http_req_failed":{"values":{"rate":0,"passes":0,"fails":1000},"type":"rate","contains":"default"},"http_req_duration":{"type":"trend","contains":"time","values":{"min":11.985208,"med":32.155103999999994,"p(50)":32.155103999999994,"p(95)":95.91642680000001,"p(99)":125.38881823999999,"max":159.23275,"avg":41.419282618999944}},"http_req_waiting":{"values":{"p(95)":95.80526044999999,"p(99)":125.32728891999999,"max":159.197542,"avg":41.37484176899995,"min":11.967916,"med":32.1255625,"p(50)":32.1255625},"type":"trend","contains":"time"},"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":144140.61752027954}},"iterations":{"type":"counter","contains":"default","values":{"count":1000,"rate":383.35270617095625}},"vus_max":{"type":"gauge","contains":"default","values":{"value":16,"min":16,"max":16}},"checks":{"type":"rate","contains":"default","values":{"fails":0,"rate":1,"passes":1000}},"vus":{"type":"gauge","contains":"default","values":{"max":16,"value":16,"min":16}},"data_received":{"type":"counter","contains":"data","values":{"count":490000,"rate":187842.82602376858}},"iteration_duration":{"type":"trend","contains":"time","values":{"p(99)":125.55100273999999,"max":159.352416,"avg":41.535506086000005,"min":12.0395,"med":32.22275,"p(50)":32.22275,"p(95)":96.1073917}}}}
@@ -0,0 +1 @@
{"root_group":{"name":"","path":"","id":"d41d8cd98f00b204e9800998ecf8427e","groups":[],"checks":[{"path":"::message 201","id":"6445aff337e1ade0bc10402fbac79882","passes":1000,"fails":0,"name":"message 201"}]},"options":{"summaryTrendStats":["avg","min","med","p(50)","p(95)","p(99)","max"],"summaryTimeUnit":"","noColor":true},"state":{"isStdOutTTY":false,"isStdErrTTY":false,"testRunDurationMs":1712.946626},"metrics":{"data_sent":{"type":"counter","contains":"data","values":{"count":376000,"rate":219504.79617570993}},"vus":{"type":"gauge","contains":"default","values":{"max":4,"value":4,"min":4}},"http_req_connecting":{"contains":"time","values":{"max":0.817125,"avg":0.002441042,"min":0,"med":0,"p(50)":0,"p(95)":0,"p(99)":0},"type":"trend"},"http_req_receiving":{"type":"trend","contains":"time","values":{"p(95)":0.04095805,"p(99)":0.08348448999999994,"max":0.305666,"avg":0.01753987599999998,"min":0.005708,"med":0.013125,"p(50)":0.013125}},"vus_max":{"type":"gauge","contains":"default","values":{"min":4,"max":4,"value":4}},"http_reqs":{"type":"counter","contains":"default","values":{"count":1000,"rate":583.7893515311434}},"http_req_failed":{"contains":"default","values":{"rate":0,"passes":0,"fails":1000},"type":"rate"},"iterations":{"values":{"count":1000,"rate":583.7893515311434},"type":"counter","contains":"default"},"http_req_duration{expected_response:true}":{"type":"trend","contains":"time","values":{"max":80.708417,"avg":6.772950257000002,"min":4.159875,"med":6.082229,"p(50)":6.082229,"p(95)":8.975899999999996,"p(99)":15.047881669999999},"thresholds":{"max>=0":{"ok":true}}},"http_req_duration":{"type":"trend","contains":"time","values":{"min":4.159875,"med":6.082229,"p(50)":6.082229,"p(95)":8.975899999999996,"p(99)":15.047881669999999,"max":80.708417,"avg":6.772950257000002}},"http_req_tls_handshaking":{"type":"trend","contains":"time","values":{"med":0,"p(50)":0,"p(95)":0,"p(99)":0,"max":0,"avg":0,"min":0}},"http_req_sending":{"type":"trend","contains":"time","values":{"max":1.162834,"avg":0.007186256000000006,"min":0.002042,"med":0.003666,"p(50)":0.003666,"p(95)":0.012379149999999997,"p(99)":0.028256249999999997}},"http_req_blocked":{"type":"trend","contains":"time","values":{"p(95)":0.002419049999999998,"p(99)":0.004376249999999999,"max":1.595334,"avg":0.006733755000000027,"min":0.0005,"med":0.000917,"p(50)":0.000917}},"checks":{"type":"rate","contains":"default","values":{"rate":1,"passes":1000,"fails":0}},"iteration_duration":{"values":{"avg":6.8403362109999915,"min":4.208792,"med":6.1297085,"p(50)":6.1297085,"p(95)":9.068070199999996,"p(99)":15.198800419999998,"max":80.768959},"type":"trend","contains":"time"},"http_req_waiting":{"type":"trend","contains":"time","values":{"avg":6.748224124999995,"min":4.144166,"med":6.064396,"p(50)":6.064396,"p(95)":8.919716999999997,"p(99)":15.030408749999998,"max":80.68875}},"data_received":{"contains":"data","values":{"count":490000,"rate":286056.7822502603},"type":"counter"}}}
@@ -0,0 +1,19 @@
run,scenario,size,concurrency,repeat,duration_s,requests_ok,requests_failed,rps,error_ratio,p50_ms,p95_ms,p99_ms,max_ms,app_cpu_cores,rss_start_mib,rss_end_mib,rss_max_mib,mem_cgroup_end_mib,store_messages_start,store_messages_end,generator_cpu_cores,flags,check_failed,db_cpu_cores,series,cell,attempt,config,replicas,replica_cpus,replica_memory,db_max_connections,step,step_kind,target_rps,sent,missing,dropped_iterations,slo_error_ratio,slo_pass,fail_reason,read_p95_ms,write_p95_ms,me_p95_ms,read_errors,write_errors,me_errors,short_pages,vus_max,generator_throttled_ratio,generator_mem_peak_mib,app_cpu_replica_max,app_cpu_second_max,app_throttled_ratio,app_throttled_ms,app_mem_peak_mib,app_us_per_request,db_throttled_ratio,db_mem_peak_mib,db_us_per_request,lb_cpu_cores,lb_throttled_ratio,cache_cpu_cores,vm_busy_cores,vm_cpu_pressure,db_commits_per_s,db_rollbacks_per_s,db_wal_mib_per_s,db_wal_fsyncs_per_s,db_sessions_new,db_conn_max,db_conn_replica_max,db_aas_cpu,db_aas_wal,db_aas_lock,db_aas_lwlock,db_aas_io,db_aas_other,db_idle_in_tx_mean,pool_busy_share,db_too_many_clients,lb_qtime_ms,lb_ctime_ms,lb_rtime_ms,lb_ttime_ms,lb_scur_max,lb_qcur_max,lb_retries,lb_redispatches,lb_econ,lb_eresp,lb_chkdown,lb_5xx,instances,instance_share_min,instance_share_max,host_swapouts,signs,error_codes,level
1,read,1000,1,1,5.001,2489,0,497.7,0.0,1.856,2.459,2.953,3.887,0.819,125.0,125.0,125.0,113.6,4500,4500,0.127,,0,0.137,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2,read,1000,4,1,5.003,3295,0,658.6,0.0,5.215,8.525,18.93,62.826,1.001,125.0,125.0,125.0,114.0,4500,4500,0.162,,0,0.184,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
3,read,1000,16,1,5.017,3513,0,700.2,0.0,20.992,39.748,61.908,85.889,1.004,125.0,125.0,125.0,114.1,4500,4500,0.158,,0,0.18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
4,write,1000,1,1,2.457,1000,0,407.0,0.0,2.054,3.852,5.662,14.682,0.757,125.0,125.0,125.0,114.2,4600,5600,0.104,,0,0.131,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
5,write,1000,4,1,1.635,1000,0,611.7,0.0,5.685,10.718,12.299,15.93,0.99,125.0,125.0,125.0,115.9,5700,6700,0.149,,0,0.216,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
6,write,1000,16,1,1.672,1000,0,598.2,0.0,25.08,40.416,77.287,85.162,1.009,125.0,125.2,125.2,118.3,6800,7800,0.143,,0,0.221,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
7,read,5000,1,1,5.002,2228,0,445.4,0.0,1.953,2.998,4.121,80.766,0.824,125.0,125.0,125.0,115.6,8500,8500,0.131,,0,0.136,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
8,read,5000,4,1,5.005,3284,0,656.1,0.0,5.419,8.586,15.028,44.245,1.002,125.0,125.0,125.0,115.8,8500,8500,0.154,,0,0.188,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
9,read,5000,16,1,5.015,3033,0,604.8,0.0,23.794,50.607,76.911,128.477,1.006,125.0,125.0,125.0,114.1,8500,8500,0.163,,0,0.196,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
10,write,5000,1,1,2.51,1000,0,398.4,0.0,2.073,3.962,7.609,25.025,0.755,125.0,125.0,125.0,115.9,8600,9600,0.106,,0,0.158,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
11,write,5000,4,1,1.713,1000,0,583.8,0.0,6.082,8.976,15.048,80.708,1.001,125.0,125.0,125.0,116.1,9700,10700,0.139,,0,0.194,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
12,write,5000,16,1,2.609,1000,0,383.4,0.0,32.155,95.916,125.389,159.233,0.998,125.1,125.4,125.5,114.4,10800,11800,0.136,,0,0.265,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
13,read,10000,1,1,5.0,2253,0,450.6,0.0,1.854,3.16,6.16,48.953,0.808,125.1,125.1,125.1,118.0,13500,13500,0.125,,0,0.15,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
14,read,10000,4,1,5.004,3164,0,632.2,0.0,5.636,8.469,14.286,55.594,1.002,125.1,125.1,125.2,116.4,13500,13500,0.161,,0,0.192,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
15,read,10000,16,1,5.02,3053,0,608.2,0.0,22.064,56.762,79.454,216.869,1.004,125.2,125.2,125.2,116.0,13500,13500,0.159,,0,0.194,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
16,write,10000,1,1,2.022,1000,0,494.7,0.0,1.891,2.343,3.107,7.76,0.783,125.2,125.2,125.2,115.6,13600,14600,0.1,,0,0.143,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
17,write,10000,4,1,1.589,1000,0,629.2,0.0,5.792,8.023,9.853,69.173,0.994,125.2,125.2,125.2,115.6,14700,15700,0.136,,0,0.188,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
18,write,10000,16,1,1.9,1000,0,526.2,0.0,27.191,56.236,87.509,110.388,1.009,125.2,125.5,125.5,116.9,15800,16800,0.153,,0,0.228,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1 run scenario size concurrency repeat duration_s requests_ok requests_failed rps error_ratio p50_ms p95_ms p99_ms max_ms app_cpu_cores rss_start_mib rss_end_mib rss_max_mib mem_cgroup_end_mib store_messages_start store_messages_end generator_cpu_cores flags check_failed db_cpu_cores series cell attempt config replicas replica_cpus replica_memory db_max_connections step step_kind target_rps sent missing dropped_iterations slo_error_ratio slo_pass fail_reason read_p95_ms write_p95_ms me_p95_ms read_errors write_errors me_errors short_pages vus_max generator_throttled_ratio generator_mem_peak_mib app_cpu_replica_max app_cpu_second_max app_throttled_ratio app_throttled_ms app_mem_peak_mib app_us_per_request db_throttled_ratio db_mem_peak_mib db_us_per_request lb_cpu_cores lb_throttled_ratio cache_cpu_cores vm_busy_cores vm_cpu_pressure db_commits_per_s db_rollbacks_per_s db_wal_mib_per_s db_wal_fsyncs_per_s db_sessions_new db_conn_max db_conn_replica_max db_aas_cpu db_aas_wal db_aas_lock db_aas_lwlock db_aas_io db_aas_other db_idle_in_tx_mean pool_busy_share db_too_many_clients lb_qtime_ms lb_ctime_ms lb_rtime_ms lb_ttime_ms lb_scur_max lb_qcur_max lb_retries lb_redispatches lb_econ lb_eresp lb_chkdown lb_5xx instances instance_share_min instance_share_max host_swapouts signs error_codes level
2 1 read 1000 1 1 5.001 2489 0 497.7 0.0 1.856 2.459 2.953 3.887 0.819 125.0 125.0 125.0 113.6 4500 4500 0.127 0 0.137
3 2 read 1000 4 1 5.003 3295 0 658.6 0.0 5.215 8.525 18.93 62.826 1.001 125.0 125.0 125.0 114.0 4500 4500 0.162 0 0.184
4 3 read 1000 16 1 5.017 3513 0 700.2 0.0 20.992 39.748 61.908 85.889 1.004 125.0 125.0 125.0 114.1 4500 4500 0.158 0 0.18
5 4 write 1000 1 1 2.457 1000 0 407.0 0.0 2.054 3.852 5.662 14.682 0.757 125.0 125.0 125.0 114.2 4600 5600 0.104 0 0.131
6 5 write 1000 4 1 1.635 1000 0 611.7 0.0 5.685 10.718 12.299 15.93 0.99 125.0 125.0 125.0 115.9 5700 6700 0.149 0 0.216
7 6 write 1000 16 1 1.672 1000 0 598.2 0.0 25.08 40.416 77.287 85.162 1.009 125.0 125.2 125.2 118.3 6800 7800 0.143 0 0.221
8 7 read 5000 1 1 5.002 2228 0 445.4 0.0 1.953 2.998 4.121 80.766 0.824 125.0 125.0 125.0 115.6 8500 8500 0.131 0 0.136
9 8 read 5000 4 1 5.005 3284 0 656.1 0.0 5.419 8.586 15.028 44.245 1.002 125.0 125.0 125.0 115.8 8500 8500 0.154 0 0.188
10 9 read 5000 16 1 5.015 3033 0 604.8 0.0 23.794 50.607 76.911 128.477 1.006 125.0 125.0 125.0 114.1 8500 8500 0.163 0 0.196
11 10 write 5000 1 1 2.51 1000 0 398.4 0.0 2.073 3.962 7.609 25.025 0.755 125.0 125.0 125.0 115.9 8600 9600 0.106 0 0.158
12 11 write 5000 4 1 1.713 1000 0 583.8 0.0 6.082 8.976 15.048 80.708 1.001 125.0 125.0 125.0 116.1 9700 10700 0.139 0 0.194
13 12 write 5000 16 1 2.609 1000 0 383.4 0.0 32.155 95.916 125.389 159.233 0.998 125.1 125.4 125.5 114.4 10800 11800 0.136 0 0.265
14 13 read 10000 1 1 5.0 2253 0 450.6 0.0 1.854 3.16 6.16 48.953 0.808 125.1 125.1 125.1 118.0 13500 13500 0.125 0 0.15
15 14 read 10000 4 1 5.004 3164 0 632.2 0.0 5.636 8.469 14.286 55.594 1.002 125.1 125.1 125.2 116.4 13500 13500 0.161 0 0.192
16 15 read 10000 16 1 5.02 3053 0 608.2 0.0 22.064 56.762 79.454 216.869 1.004 125.2 125.2 125.2 116.0 13500 13500 0.159 0 0.194
17 16 write 10000 1 1 2.022 1000 0 494.7 0.0 1.891 2.343 3.107 7.76 0.783 125.2 125.2 125.2 115.6 13600 14600 0.1 0 0.143
18 17 write 10000 4 1 1.589 1000 0 629.2 0.0 5.792 8.023 9.853 69.173 0.994 125.2 125.2 125.2 115.6 14700 15700 0.136 0 0.188
19 18 write 10000 16 1 1.9 1000 0 526.2 0.0 27.191 56.236 87.509 110.388 1.009 125.2 125.5 125.5 116.9 15800 16800 0.153 0 0.228
@@ -0,0 +1,167 @@
# Нагрузочный замер: метка `unit-of-work-before`
- Статус: **complete**
- Commit: `b2fb88f`
- Профиль `quick`: размеры 1k, 5k, 10k; клиенты 1, 4, 16; повторов 1; чтение 5 с после 2 с прогрева; запись 1000 после 100
- Лимиты без swap: API 1 CPU / 2g × 1 реплик за HAProxy 1 CPU / 256m, PostgreSQL 4 CPU / 3g, Valkey 2 CPU / 512m; CPU и RSS API — сумма по репликам; значения — медиана (min–max) по повторам
- Посторонние контейнеры в VM во время замера: domains-api-1, domains-bot-1, domains-postgres-1
## Сценарий `read`
| Размер | Клиенты | RPS | p50, мс | p95, мс | p99, мс | max, мс | CPU API, ядер | CPU БД, ядер | RSS конец, МиБ | Сообщений в начале | Пометки |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1k | 1 | 498 | 1.86 | 2.46 | 2.95 | 3.9 | 0.82 | 0.14 | 125.0 | 4500 | — |
| 1k | 4 | 659 | 5.21 | 8.53 | 18.93 | 62.8 | 1.00 | 0.18 | 125.0 | 4500 | — |
| 1k | 16 | 700 | 20.99 | 39.75 | 61.91 | 85.9 | 1.00 | 0.18 | 125.0 | 4500 | — |
| 5k | 1 | 445 | 1.95 | 3.00 | 4.12 | 80.8 | 0.82 | 0.14 | 125.0 | 8500 | — |
| 5k | 4 | 656 | 5.42 | 8.59 | 15.03 | 44.2 | 1.00 | 0.19 | 125.0 | 8500 | — |
| 5k | 16 | 605 | 23.79 | 50.61 | 76.91 | 128.5 | 1.01 | 0.20 | 125.0 | 8500 | — |
| 10k | 1 | 451 | 1.85 | 3.16 | 6.16 | 49.0 | 0.81 | 0.15 | 125.1 | 13500 | — |
| 10k | 4 | 632 | 5.64 | 8.47 | 14.29 | 55.6 | 1.00 | 0.19 | 125.1 | 13500 | — |
| 10k | 16 | 608 | 22.06 | 56.76 | 79.45 | 216.9 | 1.00 | 0.19 | 125.2 | 13500 | — |
## Сценарий `write`
| Размер | Клиенты | RPS | p50, мс | p95, мс | p99, мс | max, мс | CPU API, ядер | CPU БД, ядер | RSS конец, МиБ | Сообщений в начале | Пометки |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1k | 1 | 407 | 2.05 | 3.85 | 5.66 | 14.7 | 0.76 | 0.13 | 125.0 | 4600 | — |
| 1k | 4 | 612 | 5.68 | 10.72 | 12.30 | 15.9 | 0.99 | 0.22 | 125.0 | 5700 | — |
| 1k | 16 | 598 | 25.08 | 40.42 | 77.29 | 85.2 | 1.01 | 0.22 | 125.2 | 6800 | — |
| 5k | 1 | 398 | 2.07 | 3.96 | 7.61 | 25.0 | 0.76 | 0.16 | 125.0 | 8600 | — |
| 5k | 4 | 584 | 6.08 | 8.98 | 15.05 | 80.7 | 1.00 | 0.19 | 125.0 | 9700 | — |
| 5k | 16 | 383 | 32.16 | 95.92 | 125.39 | 159.2 | 1.00 | 0.27 | 125.4 | 10800 | — |
| 10k | 1 | 495 | 1.89 | 2.34 | 3.11 | 7.8 | 0.78 | 0.14 | 125.2 | 13600 | — |
| 10k | 4 | 629 | 5.79 | 8.02 | 9.85 | 69.2 | 0.99 | 0.19 | 125.2 | 14700 | — |
| 10k | 16 | 526 | 27.19 | 56.24 | 87.51 | 110.4 | 1.01 | 0.23 | 125.5 | 15800 | — |
## Память и наполнение по размерам
Объём `messages` — после `VACUUM (ANALYZE)`, до прогонов: в таблице N сообщений читаемого чата и сообщения фоновых чатов (`Сообщений`).
| Размер | Сообщений | RSS API до, МиБ | RSS API после, МиБ | Байт RSS на сообщение | Таблица, МиБ | Индексы, МиБ | Байт в БД на сообщение | Наполнение, сообщ/с | Курсоров в пуле | Пик RSS за размер, МиБ |
|---|---|---|---|---|---|---|---|---|---|---|
| 1k | 4500 | 121.1 | 124.9 | 895 | 0.8 | 0.6 | 328 | 554 | 9 | 184.6 |
| 5k | 8500 | 121.1 | 124.9 | 473 | 1.5 | 1.1 | 318 | 512 | 49 | 184.5 |
| 10k | 13500 | 121.1 | 125.1 | 313 | 2.3 | 1.9 | 329 | 515 | 99 | 184.5 |
## Планы запроса истории
Страница (`limit` профиля) читаемого чата и первого чата каждого фонового уровня. `app` — план запроса приложения (auto_explain). Остальное — тот же запрос с теми же параметрами в psql, в откатываемой транзакции: `psql` — индекс приложения, `generic` — он же с generic plan, `or-cursor` — условие курсора через OR, `no-index` — без индекса, дальше — варианты индекса профиля. Буферы — верхнего узла плана, файлы — `explain-<размер>.txt`.
| Размер | Чат | Страница | После сообщений | Вариант | Узел | shared hit | read | Строк | Время, мс | План |
|---|---|---|---|---|---|---|---|---|---|---|
| 1k | read 1k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 38 | 0 | 51 | 0.112 | custom |
| 1k | read 1k | middle | 500 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 52 | 0 | 51 | 0.109 | custom |
| 1k | read 1k | middle | 500 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 52 | 0 | 51 | 0.067 | custom |
| 1k | read 1k | middle | 500 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 52 | 0 | 51 | 0.079 | generic |
| 1k | read 1k | middle | 500 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 533 | 0 | 51 | 0.132 | custom |
| 1k | read 1k | middle | 500 | no-index | Seq Scan on messages | 100 | 0 | 51 | 0.582 | custom |
| 1k | read 1k | middle | 500 | chat_only | Bitmap Heap Scan on messages | 103 | 0 | 51 | 0.503 | custom |
| 1k | read 1k | middle | 500 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 51 | 0.051 | custom |
| 1k | read 1k | last | 900 | app | Bitmap Heap Scan on messages | 27 | 0 | 51 | 0.190 | custom |
| 1k | bg 1k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 43 | 0 | 51 | 0.097 | custom |
| 1k | bg 1k | middle | 500 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 53 | 0 | 51 | 0.096 | custom |
| 1k | bg 1k | middle | 500 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 53 | 0 | 51 | 0.072 | custom |
| 1k | bg 1k | middle | 500 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 53 | 0 | 51 | 0.063 | generic |
| 1k | bg 1k | middle | 500 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 540 | 0 | 51 | 0.121 | custom |
| 1k | bg 1k | middle | 500 | no-index | Seq Scan on messages | 100 | 0 | 51 | 0.497 | custom |
| 1k | bg 1k | middle | 500 | chat_only | Bitmap Heap Scan on messages | 103 | 0 | 51 | 0.446 | custom |
| 1k | bg 1k | middle | 500 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 51 | 0.052 | custom |
| 1k | bg 1k | last | 900 | app | Bitmap Heap Scan on messages | 19 | 0 | 51 | 0.145 | custom |
| 1k | bg 100 | first | 0 | app | Bitmap Heap Scan on messages | 73 | 0 | 51 | 0.197 | custom |
| 1k | bg 100 | first | 0 | psql | Bitmap Heap Scan on messages | 73 | 0 | 51 | 0.136 | custom |
| 1k | bg 100 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.057 | generic |
| 1k | bg 100 | first | 0 | no-index | Seq Scan on messages | 100 | 0 | 51 | 0.206 | custom |
| 1k | bg 100 | first | 0 | chat_only | Bitmap Heap Scan on messages | 72 | 0 | 51 | 0.119 | custom |
| 1k | bg 100 | first | 0 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 51 | 0.047 | custom |
| 1k | bg 10 | first | 0 | app | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.036 | custom |
| 1k | bg 10 | first | 0 | psql | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.031 | custom |
| 1k | bg 10 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 12 | 0 | 10 | 0.026 | generic |
| 1k | bg 10 | first | 0 | no-index | Seq Scan on messages | 100 | 0 | 10 | 0.132 | custom |
| 1k | bg 10 | first | 0 | chat_only | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.030 | custom |
| 1k | bg 10 | first | 0 | covering | Index Only Scan using bench_variant on messages | 3 | 0 | 10 | 0.018 | custom |
| 5k | read 5k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 27 | 0 | 51 | 0.135 | custom |
| 5k | read 5k | middle | 2500 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.130 | generic |
| 5k | read 5k | middle | 2500 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.063 | custom |
| 5k | read 5k | middle | 2500 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.064 | generic |
| 5k | read 5k | middle | 2500 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 2555 | 0 | 51 | 0.402 | custom |
| 5k | read 5k | middle | 2500 | no-index | Seq Scan on messages | 186 | 0 | 51 | 2.243 | custom |
| 5k | read 5k | middle | 2500 | chat_only | Seq Scan on messages | 186 | 0 | 51 | 2.017 | custom |
| 5k | read 5k | middle | 2500 | covering | Index Only Scan using bench_variant on messages | 5 | 0 | 51 | 0.047 | custom |
| 5k | read 5k | last | 4900 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 53 | 0 | 51 | 0.119 | generic |
| 5k | bg 1k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.118 | custom |
| 5k | bg 1k | middle | 500 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 49 | 0 | 51 | 0.122 | generic |
| 5k | bg 1k | middle | 500 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 49 | 0 | 51 | 0.059 | custom |
| 5k | bg 1k | middle | 500 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 49 | 0 | 51 | 0.075 | generic |
| 5k | bg 1k | middle | 500 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 531 | 0 | 51 | 0.134 | custom |
| 5k | bg 1k | middle | 500 | no-index | Seq Scan on messages | 186 | 0 | 51 | 0.569 | custom |
| 5k | bg 1k | middle | 500 | chat_only | Bitmap Heap Scan on messages | 187 | 0 | 51 | 0.467 | custom |
| 5k | bg 1k | middle | 500 | covering | Index Only Scan using bench_variant on messages | 5 | 0 | 51 | 0.055 | custom |
| 5k | bg 1k | last | 900 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 51 | 0 | 51 | 0.136 | generic |
| 5k | bg 100 | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.168 | custom |
| 5k | bg 100 | first | 0 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.080 | custom |
| 5k | bg 100 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.094 | generic |
| 5k | bg 100 | first | 0 | no-index | Seq Scan on messages | 186 | 0 | 51 | 0.362 | custom |
| 5k | bg 100 | first | 0 | chat_only | Bitmap Heap Scan on messages | 83 | 0 | 51 | 0.149 | custom |
| 5k | bg 100 | first | 0 | covering | Index Only Scan using bench_variant on messages | 5 | 0 | 51 | 0.053 | custom |
| 5k | bg 10 | first | 0 | app | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.088 | custom |
| 5k | bg 10 | first | 0 | psql | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.049 | custom |
| 5k | bg 10 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 12 | 0 | 10 | 0.029 | generic |
| 5k | bg 10 | first | 0 | no-index | Seq Scan on messages | 186 | 0 | 10 | 0.205 | custom |
| 5k | bg 10 | first | 0 | chat_only | Bitmap Heap Scan on messages | 12 | 0 | 10 | 0.026 | custom |
| 5k | bg 10 | first | 0 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 10 | 0.020 | custom |
| 10k | read 10k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 18 | 0 | 51 | 0.166 | custom |
| 10k | read 10k | middle | 5000 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.159 | generic |
| 10k | read 10k | middle | 5000 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.056 | custom |
| 10k | read 10k | middle | 5000 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.069 | generic |
| 10k | read 10k | middle | 5000 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 5077 | 0 | 51 | 0.621 | custom |
| 10k | read 10k | middle | 5000 | no-index | Seq Scan on messages | 294 | 0 | 51 | 3.760 | custom |
| 10k | read 10k | middle | 5000 | chat_only | Seq Scan on messages | 294 | 0 | 51 | 3.726 | custom |
| 10k | read 10k | middle | 5000 | covering | Index Only Scan using bench_variant on messages | 5 | 0 | 51 | 0.051 | custom |
| 10k | read 10k | last | 9900 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 54 | 0 | 51 | 0.111 | generic |
| 10k | bg 1k | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.147 | custom |
| 10k | bg 1k | middle | 500 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 46 | 0 | 51 | 0.129 | generic |
| 10k | bg 1k | middle | 500 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 46 | 0 | 51 | 0.054 | custom |
| 10k | bg 1k | middle | 500 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 46 | 0 | 51 | 0.066 | generic |
| 10k | bg 1k | middle | 500 | or-cursor | Index Scan using ix_messages_chat_id_created_at_id on messages | 507 | 0 | 51 | 0.141 | custom |
| 10k | bg 1k | middle | 500 | no-index | Seq Scan on messages | 294 | 0 | 51 | 1.061 | custom |
| 10k | bg 1k | middle | 500 | chat_only | Bitmap Heap Scan on messages | 286 | 0 | 51 | 0.467 | custom |
| 10k | bg 1k | middle | 500 | covering | Index Only Scan using bench_variant on messages | 5 | 0 | 51 | 0.051 | custom |
| 10k | bg 1k | last | 900 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 47 | 0 | 51 | 0.131 | generic |
| 10k | bg 100 | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 51 | 0 | 51 | 0.157 | custom |
| 10k | bg 100 | first | 0 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 51 | 0 | 51 | 0.060 | custom |
| 10k | bg 100 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 51 | 0 | 51 | 0.072 | generic |
| 10k | bg 100 | first | 0 | no-index | Seq Scan on messages | 294 | 0 | 51 | 0.415 | custom |
| 10k | bg 100 | first | 0 | chat_only | Bitmap Heap Scan on messages | 95 | 0 | 51 | 0.131 | custom |
| 10k | bg 100 | first | 0 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 51 | 0.051 | custom |
| 10k | bg 10 | first | 0 | app | Index Scan using ix_messages_chat_id_created_at_id on messages | 12 | 0 | 10 | 0.043 | custom |
| 10k | bg 10 | first | 0 | psql | Index Scan using ix_messages_chat_id_created_at_id on messages | 12 | 0 | 10 | 0.022 | custom |
| 10k | bg 10 | first | 0 | generic | Index Scan using ix_messages_chat_id_created_at_id on messages | 12 | 0 | 10 | 0.026 | generic |
| 10k | bg 10 | first | 0 | no-index | Seq Scan on messages | 294 | 0 | 10 | 0.358 | custom |
| 10k | bg 10 | first | 0 | chat_only | Index Scan using bench_variant on messages | 12 | 0 | 10 | 0.023 | custom |
| 10k | bg 10 | first | 0 | covering | Index Only Scan using bench_variant on messages | 4 | 0 | 10 | 0.019 | custom |
## Стоимость записи по вариантам индекса
Вставка порции сообщений во все чаты в пропорции наполнения одной командой, в транзакции, которая откатывается; индекс истории построен заново, перед вставкой `CHECKPOINT`. Значения — медиана (min–max) повторов. «4000 символов» — вставка сообщения максимальной длины из несжимаемого текста.
| Размер | Вариант | Строк вставки | Индекс, МиБ | Байт индекса на сообщение | мкс на сообщение | WAL байт на сообщение | FPI на 1000 | 4000 символов |
|---|---|---|---|---|---|---|---|---|
| 1k | app | 5000 | 0.5 | 60.9 | 5.57 (4.92–5.86) | 487 (487–499) | 20.2 (11.2–20.2) | ok |
| 1k | chat_only | 5000 | 0.1 | 10.5 | 4.77 (4.73–5.09) | 399 (399–399) | 18.0 (18.0–18.0) | ok |
| 1k | covering | 5000 | 1.2 | 159.6 | 5.36 (5.30–6.96) | 693 (693–693) | 24.2 (24.2–24.2) | index row requires 12072 bytes, maximum size is 8191 |
| 1k | none | 5000 | 0.0 | 0.0 | 4.29 (4.26–4.37) | 314 (314–314) | 16.6 (16.6–16.6) | ok |
| 5k | app | 5000 | 0.7 | 60.4 | 5.05 (4.93–6.68) | 506 (500–506) | 21.8 (17.8–21.8) | ok |
| 5k | chat_only | 5000 | 0.1 | 9.0 | 4.76 (4.70–4.76) | 421 (421–422) | 19.2 (19.2–19.6) | ok |
| 5k | covering | 5000 | 1.8 | 160.4 | 5.81 (5.45–5.87) | 703 (703–703) | 25.0 (25.0–25.2) | index row requires 12072 bytes, maximum size is 8191 |
| 5k | none | 5000 | 0.0 | 0.0 | 4.27 (4.25–4.70) | 336 (336–336) | 17.8 (17.6–17.8) | ok |
| 10k | app | 5000 | 1.0 | 59.5 | 5.12 (5.01–6.31) | 542 (540–557) | 31.4 (19.0–31.6) | ok |
| 10k | chat_only | 5000 | 0.1 | 8.3 | 4.80 (4.72–5.69) | 452 (450–454) | 29.2 (27.6–29.4) | ok |
| 10k | covering | 5000 | 2.6 | 160.4 | 5.59 (5.47–7.14) | 748 (748–749) | 35.4 (34.8–35.4) | index row requires 12072 bytes, maximum size is 8191 |
| 10k | none | 5000 | 0.0 | 0.0 | 4.36 (4.34–4.45) | 365 (365–367) | 27.8 (27.4–27.8) | ok |
## Кривая наполнения 10k: запись при росте хранилища, 32 клиента
| Порция | Сообщений после | RPS | p50, мс | p95, мс | p99, мс | max, мс | CPU API, ядер | CPU БД, ядер | RSS, МиБ | Пометки |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 13500 | 515 | 56.009 | 121.243 | 188.234 | 417.242 | 0.996 | 0.22 | 125.1 | — |