forked from mtusi2026/mtusi2026lab2
83 lines
2.1 KiB
JSON
83 lines
2.1 KiB
JSON
{
|
|
"rows_per_run": 50000,
|
|
"runs": 5,
|
|
"note": "один INSERT на строку внутри одной транзакции (без fsync на COMMIT); FK исключён, чтобы изолировать стоимость поддержки индекса истории",
|
|
"variants": {
|
|
"V0_no_index": {
|
|
"note": "только PK(id): нет индекса по chat_id",
|
|
"ms_median": 640.3,
|
|
"us_per_insert": 12.81,
|
|
"wal_bytes_per_insert": 360.4,
|
|
"index_bytes_after_run": 0,
|
|
"runs_ms": [
|
|
533.5,
|
|
646.4,
|
|
640.3,
|
|
641.4,
|
|
612.8
|
|
],
|
|
"overhead_vs_no_index_pct": 0.0
|
|
},
|
|
"V1_chat": {
|
|
"note": "btree(chat_id)",
|
|
"ms_median": 778.0,
|
|
"us_per_insert": 15.56,
|
|
"wal_bytes_per_insert": 438.4,
|
|
"index_bytes_after_run": 458752,
|
|
"runs_ms": [
|
|
778.0,
|
|
995.6,
|
|
826.4,
|
|
660.6,
|
|
758.6
|
|
],
|
|
"overhead_vs_no_index_pct": 21.5
|
|
},
|
|
"V2_chat_created": {
|
|
"note": "btree(chat_id, created_at)",
|
|
"ms_median": 772.0,
|
|
"us_per_insert": 15.44,
|
|
"wal_bytes_per_insert": 471.0,
|
|
"index_bytes_after_run": 3284992,
|
|
"runs_ms": [
|
|
805.3,
|
|
772.0,
|
|
756.2,
|
|
757.3,
|
|
817.3
|
|
],
|
|
"overhead_vs_no_index_pct": 20.5
|
|
},
|
|
"V3_chat_created_id": {
|
|
"note": "btree(chat_id, created_at, id) — выбран в миграции 0001",
|
|
"ms_median": 744.0,
|
|
"us_per_insert": 14.88,
|
|
"wal_bytes_per_insert": 501.8,
|
|
"index_bytes_after_run": 4743168,
|
|
"runs_ms": [
|
|
763.3,
|
|
676.1,
|
|
744.0,
|
|
749.5,
|
|
707.4
|
|
],
|
|
"overhead_vs_no_index_pct": 16.2
|
|
},
|
|
"V4_covering": {
|
|
"note": "covering: + INCLUDE(sender_id, text)",
|
|
"ms_median": 928.8,
|
|
"us_per_insert": 18.58,
|
|
"wal_bytes_per_insert": 849.2,
|
|
"index_bytes_after_run": 21970944,
|
|
"runs_ms": [
|
|
928.8,
|
|
973.1,
|
|
970.6,
|
|
872.0,
|
|
857.7
|
|
],
|
|
"overhead_vs_no_index_pct": 45.0
|
|
}
|
|
}
|
|
}
|