{ "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 }, "configs": { "C0_pk_only": { "ddl": null, "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.249, 1.182, 1.17 ], "median": 1.182 }, "single_insert_ms": { "n": 2000, "mean": 0.809, "p50": 0.696, "p95": 1.625, "p99": 3.319 }, "history_index_bytes": 0, "table_bytes": 49446912, "pk_index_bytes": 4644864 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 19.011, "p95_ms": 29.257, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 39.274, "shared_buffers": 6124, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 36.202, "p95_ms": 49.585, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 31.905, "shared_buffers": 6066, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 14.85, "p95_ms": 25.226, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 18.925, "shared_buffers": 6036, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 36.263, "p95_ms": 52.683, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 30.508, "shared_buffers": 6036, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 47.972, "p95_ms": 66.037, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 72.734, "shared_buffers": 6124, "rows": 51 } } } }, "C1_chat_id": { "ddl": "CREATE INDEX hist_idx ON messages (chat_id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.345, 1.301, 1.366 ], "median": 1.345 }, "single_insert_ms": { "n": 2000, "mean": 1.21, "p50": 0.944, "p95": 2.856, "p99": 5.362 }, "history_index_bytes": 925696, "table_bytes": 49446912, "pk_index_bytes": 4636672 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 16.093, "p95_ms": 22.986, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 45.496, "shared_buffers": 6124, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 11.782, "p95_ms": 20.282, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 21.566, "shared_buffers": 3140, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.157, "p95_ms": 0.32, "plan": { "nodes": [ "Index Scan", "Sort", "Limit" ], "execution_ms": 0.04, "shared_buffers": 5, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.676, "p95_ms": 1.21, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 0.296, "shared_buffers": 88, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 37.922, "p95_ms": 51.332, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 82.629, "shared_buffers": 6124, "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.245, 1.246, 1.339 ], "median": 1.246 }, "single_insert_ms": { "n": 2000, "mean": 0.755, "p50": 0.709, "p95": 1.219, "p99": 1.725 }, "history_index_bytes": 8085504, "table_bytes": 49446912, "pk_index_bytes": 4653056 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 0.446, "p95_ms": 0.916, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.059, "shared_buffers": 7, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.476, "p95_ms": 0.899, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.054, "shared_buffers": 9, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.153, "p95_ms": 0.317, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.034, "shared_buffers": 6, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.245, "p95_ms": 0.556, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.033, "shared_buffers": 9, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 38.956, "p95_ms": 53.771, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 97.936, "shared_buffers": 6124, "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.752, 1.604, 1.581 ], "median": 1.604 }, "single_insert_ms": { "n": 2000, "mean": 0.51, "p50": 0.457, "p95": 0.844, "p99": 1.189 }, "history_index_bytes": 41484288, "table_bytes": 49446912, "pk_index_bytes": 4644864 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 0.482, "p95_ms": 0.591, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.029, "shared_buffers": 6, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.253, "p95_ms": 0.484, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.031, "shared_buffers": 6, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 0.08, "p95_ms": 0.163, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.017, "shared_buffers": 4, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.238, "p95_ms": 0.433, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.03, "shared_buffers": 7, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 4.709, "p95_ms": 7.598, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 7.275, "shared_buffers": 1472, "rows": 51 } } } }, "C4_global_created_id": { "ddl": "CREATE INDEX hist_idx ON messages (created_at, id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 1.459, 1.53, 1.405 ], "median": 1.459 }, "single_insert_ms": { "n": 2000, "mean": 0.481, "p50": 0.411, "p95": 0.898, "p99": 1.397 }, "history_index_bytes": 5177344, "table_bytes": 49446912, "pk_index_bytes": 4644864 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 1.572, "p95_ms": 2.733, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 2.349, "shared_buffers": 5491, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 0.479, "p95_ms": 0.685, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.05, "shared_buffers": 8, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 33.156, "p95_ms": 51.981, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 16.027, "shared_buffers": 6036, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 0.418, "p95_ms": 0.688, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.148, "shared_buffers": 669, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 42.816, "p95_ms": 60.392, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 84.868, "shared_buffers": 6124, "rows": 51 } } } } } }