{ "environment": { "postgres": "17.6", "shared_buffers": "128MB", "work_mem": "4MB", "fsync": "on", "synchronous_commit": "on", "cpus": 8, "python": "3.14.0", "platform": "Windows-11-10.0.26200-SP0" }, "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": [ 3.384, 3.279, 3.452 ], "median": 3.384 }, "single_insert_ms": { "n": 2000, "mean": 1.787, "p50": 1.714, "p95": 2.309, "p99": 2.722 }, "history_index_bytes": 5201920, "table_bytes": 49471488, "pk_index_bytes": 4358144 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 3.433, "p95_ms": 4.326, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 2.116, "shared_buffers": 5503, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 1.418, "p95_ms": 2.031, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.11, "shared_buffers": 8, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 15.92, "p95_ms": 33.715, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 12.834, "shared_buffers": 6039, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 1.455, "p95_ms": 2.026, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.302, "shared_buffers": 669, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 72.363, "p95_ms": 134.385, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 71.893, "shared_buffers": 6127, "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": [ 5.342, 4.847, 5.174 ], "median": 5.174 }, "single_insert_ms": { "n": 2000, "mean": 2.497, "p50": 2.267, "p95": 3.945, "p99": 6.674 }, "history_index_bytes": 37232640, "table_bytes": 49471488, "pk_index_bytes": 4374528 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 2.224, "p95_ms": 4.071, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.249, "shared_buffers": 6, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 1.837, "p95_ms": 2.794, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.106, "shared_buffers": 6, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 1.347, "p95_ms": 2.536, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.121, "shared_buffers": 4, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 2.845, "p95_ms": 5.62, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 0.112, "shared_buffers": 7, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 10.613, "p95_ms": 15.66, "plan": { "nodes": [ "Index Only Scan", "Limit" ], "execution_ms": 9.475, "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": [ 3.81, 3.621, 3.556 ], "median": 3.621 }, "single_insert_ms": { "n": 2000, "mean": 1.942, "p50": 1.847, "p95": 2.499, "p99": 3.009 }, "history_index_bytes": 7200768, "table_bytes": 49471488, "pk_index_bytes": 4358144 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 1.327, "p95_ms": 1.95, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.071, "shared_buffers": 6, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 1.861, "p95_ms": 2.543, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.09, "shared_buffers": 9, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 1.095, "p95_ms": 1.511, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 0.262, "shared_buffers": 5, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 1.564, "p95_ms": 2.092, "plan": { "nodes": [ "Index Scan", "Limit" ], "execution_ms": 0.075, "shared_buffers": 12, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 62.262, "p95_ms": 89.574, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 81.055, "shared_buffers": 6127, "rows": 51 } } } }, "C1_chat_id": { "ddl": "CREATE INDEX hist_idx ON messages (chat_id)", "writes": { "bulk_insert_100k_seconds": { "runs": [ 5.229, 3.858, 3.608 ], "median": 3.858 }, "single_insert_ms": { "n": 2000, "mean": 2.301, "p50": 2.258, "p95": 2.911, "p99": 3.367 }, "history_index_bytes": 892928, "table_bytes": 49471488, "pk_index_bytes": 4399104 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 17.321, "p95_ms": 21.988, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 22.421, "shared_buffers": 6127, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 16.562, "p95_ms": 21.11, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 14.295, "shared_buffers": 3142, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 1.417, "p95_ms": 1.895, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 0.136, "shared_buffers": 4, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 2.429, "p95_ms": 3.066, "plan": { "nodes": [ "Bitmap Index Scan", "Bitmap Heap Scan", "Sort", "Limit" ], "execution_ms": 0.556, "shared_buffers": 92, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 77.773, "p95_ms": 114.858, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 69.741, "shared_buffers": 6127, "rows": 51 } } } }, "C0_pk_only": { "ddl": null, "writes": { "bulk_insert_100k_seconds": { "runs": [ 3.645, 3.652, 3.632 ], "median": 3.645 }, "single_insert_ms": { "n": 2000, "mean": 1.889, "p50": 1.822, "p95": 2.427, "p99": 2.731 }, "history_index_bytes": 0, "table_bytes": 49471488, "pk_index_bytes": 4366336 }, "reads": { "Q1_first_page_giant_50k": { "p50_ms": 18.452, "p95_ms": 21.713, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 20.771, "shared_buffers": 6127, "rows": 51 } }, "Q2_deep_keyset_giant_at_40k": { "p50_ms": 18.306, "p95_ms": 21.371, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 16.318, "shared_buffers": 6069, "rows": 51 } }, "Q3_first_page_tiny_10": { "p50_ms": 14.635, "p95_ms": 16.207, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 12.85, "shared_buffers": 6039, "rows": 10 } }, "Q4_keyset_mid_1k_at_500": { "p50_ms": 17.253, "p95_ms": 19.007, "plan": { "nodes": [ "Seq Scan", "Sort", "Limit" ], "execution_ms": 15.036, "shared_buffers": 6039, "rows": 51 } }, "Q5_OFFSET_40000_giant": { "p50_ms": 68.051, "p95_ms": 73.12, "plan": { "nodes": [ "Seq Scan", "Sort", "Gather Merge", "Limit" ], "execution_ms": 49.273, "shared_buffers": 6127, "rows": 51 } } } } } }