Files

564 lines
14 KiB
JSON

{
"targets": [
{
"label": "hot",
"chat_id": "0ab807ce-24eb-4da8-8458-ef0836fb3470",
"messages": 24294,
"offset": 12147,
"cursor_ts": "2026-02-04 13:58:00+03",
"cursor_id": "dc3c4cd9-029a-40dd-976c-64cd71098149"
},
{
"label": "median",
"chat_id": "5455628c-0b94-4d4a-95bf-74145b899408",
"messages": 99,
"offset": 49,
"cursor_ts": "2026-02-04 03:36:40+03",
"cursor_id": "01b51bb5-cfb2-4fce-a665-02087836dd8c"
},
{
"label": "small",
"chat_id": "74d7b4ab-e4ce-4065-b97b-1b00a2383364",
"messages": 38,
"offset": 19,
"cursor_ts": "2026-02-04 08:40:15+03",
"cursor_id": "b94bd4dd-e28c-4bce-8065-8a07a85a72bd"
}
],
"repeats": 15,
"variants": {
"V0_no_index": {
"note": "только PK(id): нет индекса по chat_id",
"index_bytes": 0,
"queries": {
"hot/keyset_first": {
"exec_ms_median": 18.126,
"exec_ms_p90": 19.806,
"shared_hit": 3705,
"shared_read": 0,
"plan": [
"Limit",
"Gather Merge",
"Sort",
"Seq Scan"
]
},
"hot/keyset_middle": {
"exec_ms_median": 18.343,
"exec_ms_p90": 22.394,
"shared_hit": 3647,
"shared_read": 0,
"plan": [
"Limit",
"Gather Merge",
"Sort",
"Seq Scan"
]
},
"hot/offset_middle": {
"exec_ms_median": 28.459,
"exec_ms_p90": 33.177,
"shared_hit": 3617,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Seq Scan"
]
},
"median/keyset_first": {
"exec_ms_median": 14.429,
"exec_ms_p90": 15.984,
"shared_hit": 3617,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Seq Scan"
]
},
"median/keyset_middle": {
"exec_ms_median": 15.644,
"exec_ms_p90": 16.287,
"shared_hit": 3647,
"shared_read": 0,
"plan": [
"Limit",
"Gather Merge",
"Sort",
"Seq Scan"
]
},
"median/offset_middle": {
"exec_ms_median": 14.285,
"exec_ms_p90": 15.051,
"shared_hit": 3617,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Seq Scan"
]
},
"small/keyset_first": {
"exec_ms_median": 13.895,
"exec_ms_p90": 17.684,
"shared_hit": 3617,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Seq Scan"
]
},
"small/keyset_middle": {
"exec_ms_median": 17.617,
"exec_ms_p90": 19.349,
"shared_hit": 3647,
"shared_read": 0,
"plan": [
"Limit",
"Gather Merge",
"Sort",
"Seq Scan"
]
},
"small/offset_middle": {
"exec_ms_median": 14.198,
"exec_ms_p90": 16.743,
"shared_hit": 3617,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Seq Scan"
]
}
}
},
"V1_chat": {
"note": "btree(chat_id)",
"index_bytes": 876544,
"queries": {
"hot/keyset_first": {
"exec_ms_median": 12.668,
"exec_ms_p90": 15.04,
"shared_hit": 3636,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"hot/keyset_middle": {
"exec_ms_median": 12.078,
"exec_ms_p90": 13.361,
"shared_hit": 3636,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"hot/offset_middle": {
"exec_ms_median": 20.116,
"exec_ms_p90": 26.066,
"shared_hit": 3636,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/keyset_first": {
"exec_ms_median": 0.163,
"exec_ms_p90": 0.192,
"shared_hit": 99,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/keyset_middle": {
"exec_ms_median": 0.081,
"exec_ms_p90": 0.109,
"shared_hit": 99,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/offset_middle": {
"exec_ms_median": 0.075,
"exec_ms_p90": 0.105,
"shared_hit": 99,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/keyset_first": {
"exec_ms_median": 0.056,
"exec_ms_p90": 0.061,
"shared_hit": 40,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/keyset_middle": {
"exec_ms_median": 0.038,
"exec_ms_p90": 0.041,
"shared_hit": 40,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/offset_middle": {
"exec_ms_median": 0.038,
"exec_ms_p90": 0.041,
"shared_hit": 40,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
}
}
},
"V2_chat_created": {
"note": "btree(chat_id, created_at)",
"index_bytes": 4898816,
"queries": {
"hot/keyset_first": {
"exec_ms_median": 0.036,
"exec_ms_p90": 0.061,
"shared_hit": 10,
"shared_read": 0,
"plan": [
"Limit",
"Incremental Sort",
"Index Scan using hist_idx"
]
},
"hot/keyset_middle": {
"exec_ms_median": 0.038,
"exec_ms_p90": 0.049,
"shared_hit": 11,
"shared_read": 0,
"plan": [
"Limit",
"Incremental Sort",
"Index Scan using hist_idx"
]
},
"hot/offset_middle": {
"exec_ms_median": 21.445,
"exec_ms_p90": 25.194,
"shared_hit": 3737,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/keyset_first": {
"exec_ms_median": 0.048,
"exec_ms_p90": 0.052,
"shared_hit": 54,
"shared_read": 0,
"plan": [
"Limit",
"Incremental Sort",
"Index Scan using hist_idx"
]
},
"median/keyset_middle": {
"exec_ms_median": 0.07,
"exec_ms_p90": 0.102,
"shared_hit": 53,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/offset_middle": {
"exec_ms_median": 0.135,
"exec_ms_p90": 0.16,
"shared_hit": 100,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/keyset_first": {
"exec_ms_median": 0.054,
"exec_ms_p90": 0.082,
"shared_hit": 41,
"shared_read": 0,
"plan": [
"Limit",
"Incremental Sort",
"Index Scan using hist_idx"
]
},
"small/keyset_middle": {
"exec_ms_median": 0.048,
"exec_ms_p90": 0.056,
"shared_hit": 23,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/offset_middle": {
"exec_ms_median": 0.05,
"exec_ms_p90": 0.059,
"shared_hit": 41,
"shared_read": 0,
"plan": [
"Limit",
"Incremental Sort",
"Index Scan using hist_idx"
]
}
}
},
"V3_chat_created_id": {
"note": "btree(chat_id, created_at, id) — выбран в миграции 0001",
"index_bytes": 7094272,
"queries": {
"hot/keyset_first": {
"exec_ms_median": 0.023,
"exec_ms_p90": 0.034,
"shared_hit": 10,
"shared_read": 0,
"plan": [
"Limit",
"Index Scan using hist_idx"
]
},
"hot/keyset_middle": {
"exec_ms_median": 0.033,
"exec_ms_p90": 0.038,
"shared_hit": 12,
"shared_read": 0,
"plan": [
"Limit",
"Index Scan using hist_idx"
]
},
"hot/offset_middle": {
"exec_ms_median": 25.014,
"exec_ms_p90": 28.762,
"shared_hit": 3790,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/keyset_first": {
"exec_ms_median": 0.028,
"exec_ms_p90": 0.036,
"shared_hit": 53,
"shared_read": 0,
"plan": [
"Limit",
"Index Scan using hist_idx"
]
},
"median/keyset_middle": {
"exec_ms_median": 0.05,
"exec_ms_p90": 0.077,
"shared_hit": 52,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"median/offset_middle": {
"exec_ms_median": 0.128,
"exec_ms_p90": 0.133,
"shared_hit": 100,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/keyset_first": {
"exec_ms_median": 0.026,
"exec_ms_p90": 0.03,
"shared_hit": 42,
"shared_read": 0,
"plan": [
"Limit",
"Index Scan using hist_idx"
]
},
"small/keyset_middle": {
"exec_ms_median": 0.028,
"exec_ms_p90": 0.029,
"shared_hit": 22,
"shared_read": 0,
"plan": [
"Limit",
"Sort",
"Bitmap Heap Scan",
"Bitmap Index Scan using hist_idx"
]
},
"small/offset_middle": {
"exec_ms_median": 0.023,
"exec_ms_p90": 0.038,
"shared_hit": 42,
"shared_read": 0,
"plan": [
"Limit",
"Index Scan using hist_idx"
]
}
}
},
"V4_covering": {
"note": "covering: + INCLUDE(sender_id, text)",
"index_bytes": 31449088,
"queries": {
"hot/keyset_first": {
"exec_ms_median": 0.031,
"exec_ms_p90": 0.033,
"shared_hit": 5,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"hot/keyset_middle": {
"exec_ms_median": 0.035,
"exec_ms_p90": 0.036,
"shared_hit": 6,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"hot/offset_middle": {
"exec_ms_median": 2.14,
"exec_ms_p90": 2.4,
"shared_hit": 390,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"median/keyset_first": {
"exec_ms_median": 0.032,
"exec_ms_p90": 0.052,
"shared_hit": 6,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"median/keyset_middle": {
"exec_ms_median": 0.034,
"exec_ms_p90": 0.035,
"shared_hit": 5,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"median/offset_middle": {
"exec_ms_median": 0.042,
"exec_ms_p90": 0.044,
"shared_hit": 7,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"small/keyset_first": {
"exec_ms_median": 0.027,
"exec_ms_p90": 0.029,
"shared_hit": 5,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"small/keyset_middle": {
"exec_ms_median": 0.022,
"exec_ms_p90": 0.022,
"shared_hit": 4,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
},
"small/offset_middle": {
"exec_ms_median": 0.025,
"exec_ms_p90": 0.025,
"shared_hit": 5,
"shared_read": 0,
"plan": [
"Limit",
"Index Only Scan using hist_idx"
]
}
}
}
}
}