{ "environment": { "postgres": "16.15 (Ubuntu 16.15-0ubuntu0.24.04.1)", "shared_buffers": "128MB", "work_mem": "4MB", "fsync": "on", "synchronous_commit": "on", "cpus": 1, "python": "3.12.3", "platform": "Linux-6.18.44-fc-v114-x86_64-with-glibc2.39" }, "dataset": { "messages": 100000, "chats": 563, "chat_size_distribution": { "50000": 1, "20000": 1, "10000": 1, "1000": 10, "100": 50, "10": 500 }, "text_length_chars": "10..400 (равномерно)", "page_size": 50, "read_runs": 300, "warmup": 20, "single_inserts": 2000, "bulk_repeats": 3, "order": "reverse" }, "configs": { "C4_global_created_id": { "ddl": "CREATE INDEX hist_idx ON messages (created_at, id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.193, 1.12, 1.154 ], "median": 1.154 }, "single_insert_ms": { "n": 2000, "mean": 0.683, "p50": 0.631, "p95": 1.128, "p99": 1.724 }, "history_index_bytes": 5185536, "table_bytes": 49528832, "pk_index_bytes": 4423680 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 2.973, "p95_ms": 3.433, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 1.295, "shared_buffers": 5505, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.38, "p95_ms": 0.561, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.044, "shared_buffers": 8, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 25.688, "p95_ms": 44.275, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 15.299, "shared_buffers": 6046, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.505, "p95_ms": 0.915, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.18, "shared_buffers": 669, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 41.86, "p95_ms": 61.732, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 76.728, "shared_buffers": 6134, "rows": 51 } } } }, "C3_covering_include": { "ddl": "CREATE INDEX hist_idx ON messages (chat_id, created_at, id) INCLUDE (sender_id, text)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.276, 1.46, 1.42 ], "median": 1.42 }, "single_insert_ms": { "n": 2000, "mean": 0.567, "p50": 0.507, "p95": 0.923, "p99": 1.459 }, "history_index_bytes": 38543360, "table_bytes": 49528832, "pk_index_bytes": 4431872 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 0.212, "p95_ms": 0.399, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.032, "shared_buffers": 7, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.329, "p95_ms": 0.613, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.029, "shared_buffers": 6, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.08, "p95_ms": 0.133, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.016, "shared_buffers": 4, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.327, "p95_ms": 0.551, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.039, "shared_buffers": 6, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 4.339, "p95_ms": 7.16, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 7.172, "shared_buffers": 1468, "rows": 51 } } } }, "C2_chat_created_id": { "ddl": "CREATE INDEX hist_idx ON messages (chat_id, created_at, id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.25, 1.182, 1.198 ], "median": 1.198 }, "single_insert_ms": { "n": 2000, "mean": 0.813, "p50": 0.758, "p95": 1.324, "p99": 2.348 }, "history_index_bytes": 7487488, "table_bytes": 49528832, "pk_index_bytes": 4423680 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 0.214, "p95_ms": 0.29, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.033, "shared_buffers": 7, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.326, "p95_ms": 0.596, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.048, "shared_buffers": 9, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.121, "p95_ms": 0.293, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.025, "shared_buffers": 6, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.297, "p95_ms": 0.561, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.031, "shared_buffers": 8, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 40.25, "p95_ms": 54.269, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 96.889, "shared_buffers": 6139, "rows": 51 } } } }, "C1_chat_id": { "ddl": "CREATE INDEX hist_idx ON messages (chat_id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.408, 1.338, 1.259 ], "median": 1.338 }, "single_insert_ms": { "n": 2000, "mean": 0.609, "p50": 0.573, "p95": 0.947, "p99": 1.226 }, "history_index_bytes": 876544, "table_bytes": 49528832, "pk_index_bytes": 4415488 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 8.119, "p95_ms": 13.049, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 31.511, "shared_buffers": 6134, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 8.103, "p95_ms": 15.315, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 17.174, "shared_buffers": 3151, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.144, "p95_ms": 0.229, "plan": { "nodes": [ "Index Scan", "Sort", "Limit" ], "execution_ms": 0.037, "shared_buffers": 5, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.642, "p95_ms": 0.925, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 0.363, "shared_buffers": 90, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 36.041, "p95_ms": 48.493, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 79.39, "shared_buffers": 6134, "rows": 51 } } } }, "C0_pk_only": { "ddl": null, "writes": { "bulk_insert_100k_seconds": { "runs": [ 0.963, 1.098, 1.406 ], "median": 1.098 }, "single_insert_ms": { "n": 2000, "mean": 0.944, "p50": 0.847, "p95": 1.616, "p99": 2.599 }, "history_index_bytes": 0, "table_bytes": 49528832, "pk_index_bytes": 4415488 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 26.853, "p95_ms": 44.262, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 33.108, "shared_buffers": 6134, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 33.107, "p95_ms": 46.562, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 32.472, "shared_buffers": 6076, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 16.6, "p95_ms": 24.988, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 14.32, "shared_buffers": 6046, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 21.05, "p95_ms": 33.296, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 18.585, "shared_buffers": 6046, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 45.405, "p95_ms": 66.359, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 82.673, "shared_buffers": 6134, "rows": 51 } } } } } }