forked from mtusi2026/mtusi2026lab2
917 lines
33 KiB
JSON
917 lines
33 KiB
JSON
{
|
|
"run_utc": "2026-10-09T13:21:05.722546+00:00",
|
|
"environment": {
|
|
"host_platform": "macOS-27.0-arm64-arm-64bit-Mach-O",
|
|
"host_architecture": "arm64",
|
|
"host_logical_cpus": 10,
|
|
"host_memory_bytes": 17179869184,
|
|
"postgres_image": "postgres:16.4-alpine",
|
|
"postgres_version": "16.4",
|
|
"postgres_container_memory_limit_bytes": 0,
|
|
"postgres_container_cpu_limit_nanos": 0,
|
|
"warmup": "initial data load followed by ANALYZE; plan query is executed 5 times",
|
|
"postgres_memory_setting": "128MB",
|
|
"postgres_work_mem": "4MB"
|
|
},
|
|
"method": {
|
|
"rows_per_index_variant": 100000,
|
|
"distribution": "80,000 messages in one chat; 20,000 distributed evenly across 100 chats",
|
|
"warmup": "ANALYZE followed by five executed EXPLAIN ANALYZE samples per query",
|
|
"query": "SELECT id, created_at, text FROM messages WHERE chat_id = 2 AND (created_at, id) > (timestamptz '2025-01-01 23:36:40+00', 0) ORDER BY created_at, id LIMIT 25"
|
|
},
|
|
"query_plans": {
|
|
"chat_id_only": {
|
|
"index": "(chat_id)",
|
|
"samples": [
|
|
{
|
|
"execution_ms": 0.265,
|
|
"planning_ms": 0.384,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 206,
|
|
"shared_read_blocks": 2,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.67,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.217,
|
|
"Actual Total Time": 0.22,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 206,
|
|
"Shared Read Blocks": 2,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Sort",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.68,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.216,
|
|
"Actual Total Time": 0.217,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Sort Key": [
|
|
"created_at",
|
|
"id"
|
|
],
|
|
"Sort Method": "top-N heapsort",
|
|
"Sort Space Used": 26,
|
|
"Sort Space Type": "Memory",
|
|
"Shared Hit Blocks": 206,
|
|
"Shared Read Blocks": 2,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_only_idx",
|
|
"Relation Name": "messages_chat_only",
|
|
"Alias": "messages_chat_only",
|
|
"Startup Cost": 0.29,
|
|
"Total Cost": 25.87,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.073,
|
|
"Actual Total Time": 0.182,
|
|
"Actual Rows": 150,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "(chat_id = 2)",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Filter": "(ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0))",
|
|
"Rows Removed by Filter": 50,
|
|
"Shared Hit Blocks": 200,
|
|
"Shared Read Blocks": 2,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.233,
|
|
"planning_ms": 0.353,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 208,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.67,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.195,
|
|
"Actual Total Time": 0.198,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Sort",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.68,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.194,
|
|
"Actual Total Time": 0.195,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Sort Key": [
|
|
"created_at",
|
|
"id"
|
|
],
|
|
"Sort Method": "top-N heapsort",
|
|
"Sort Space Used": 26,
|
|
"Sort Space Type": "Memory",
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_only_idx",
|
|
"Relation Name": "messages_chat_only",
|
|
"Alias": "messages_chat_only",
|
|
"Startup Cost": 0.29,
|
|
"Total Cost": 25.87,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.055,
|
|
"Actual Total Time": 0.166,
|
|
"Actual Rows": 150,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "(chat_id = 2)",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Filter": "(ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0))",
|
|
"Rows Removed by Filter": 50,
|
|
"Shared Hit Blocks": 202,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.245,
|
|
"planning_ms": 0.363,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 208,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.67,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.198,
|
|
"Actual Total Time": 0.2,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Sort",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.68,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.197,
|
|
"Actual Total Time": 0.198,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Sort Key": [
|
|
"created_at",
|
|
"id"
|
|
],
|
|
"Sort Method": "top-N heapsort",
|
|
"Sort Space Used": 26,
|
|
"Sort Space Type": "Memory",
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_only_idx",
|
|
"Relation Name": "messages_chat_only",
|
|
"Alias": "messages_chat_only",
|
|
"Startup Cost": 0.29,
|
|
"Total Cost": 25.87,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.051,
|
|
"Actual Total Time": 0.158,
|
|
"Actual Rows": 150,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "(chat_id = 2)",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Filter": "(ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0))",
|
|
"Rows Removed by Filter": 50,
|
|
"Shared Hit Blocks": 202,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.218,
|
|
"planning_ms": 0.285,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 208,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.67,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.184,
|
|
"Actual Total Time": 0.186,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Sort",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.68,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.183,
|
|
"Actual Total Time": 0.184,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Sort Key": [
|
|
"created_at",
|
|
"id"
|
|
],
|
|
"Sort Method": "top-N heapsort",
|
|
"Sort Space Used": 26,
|
|
"Sort Space Type": "Memory",
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_only_idx",
|
|
"Relation Name": "messages_chat_only",
|
|
"Alias": "messages_chat_only",
|
|
"Startup Cost": 0.29,
|
|
"Total Cost": 25.87,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.048,
|
|
"Actual Total Time": 0.155,
|
|
"Actual Rows": 150,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "(chat_id = 2)",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Filter": "(ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0))",
|
|
"Rows Removed by Filter": 50,
|
|
"Shared Hit Blocks": 202,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.268,
|
|
"planning_ms": 0.365,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 208,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.67,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.228,
|
|
"Actual Total Time": 0.23,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Sort",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 26.61,
|
|
"Total Cost": 26.68,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.227,
|
|
"Actual Total Time": 0.228,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Sort Key": [
|
|
"created_at",
|
|
"id"
|
|
],
|
|
"Sort Method": "top-N heapsort",
|
|
"Sort Space Used": 26,
|
|
"Sort Space Type": "Memory",
|
|
"Shared Hit Blocks": 208,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_only_idx",
|
|
"Relation Name": "messages_chat_only",
|
|
"Alias": "messages_chat_only",
|
|
"Startup Cost": 0.29,
|
|
"Total Cost": 25.87,
|
|
"Plan Rows": 30,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.049,
|
|
"Actual Total Time": 0.186,
|
|
"Actual Rows": 150,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "(chat_id = 2)",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Filter": "(ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0))",
|
|
"Rows Removed by Filter": 50,
|
|
"Shared Hit Blocks": 202,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"composite_history": {
|
|
"index": "(chat_id, created_at, id)",
|
|
"samples": [
|
|
{
|
|
"execution_ms": 0.085,
|
|
"planning_ms": 0.331,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 25,
|
|
"shared_read_blocks": 3,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 50.6,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.034,
|
|
"Actual Total Time": 0.055,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 25,
|
|
"Shared Read Blocks": 3,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_history_idx",
|
|
"Relation Name": "messages_composite",
|
|
"Alias": "messages_composite",
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 62.64,
|
|
"Plan Rows": 31,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.033,
|
|
"Actual Total Time": 0.053,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "((chat_id = 2) AND (ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0)))",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Shared Hit Blocks": 25,
|
|
"Shared Read Blocks": 3,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.087,
|
|
"planning_ms": 0.362,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 28,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 50.6,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.022,
|
|
"Actual Total Time": 0.043,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_history_idx",
|
|
"Relation Name": "messages_composite",
|
|
"Alias": "messages_composite",
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 62.64,
|
|
"Plan Rows": 31,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.021,
|
|
"Actual Total Time": 0.041,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "((chat_id = 2) AND (ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0)))",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.065,
|
|
"planning_ms": 0.307,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 28,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 50.6,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.015,
|
|
"Actual Total Time": 0.035,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_history_idx",
|
|
"Relation Name": "messages_composite",
|
|
"Alias": "messages_composite",
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 62.64,
|
|
"Plan Rows": 31,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.014,
|
|
"Actual Total Time": 0.032,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "((chat_id = 2) AND (ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0)))",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.079,
|
|
"planning_ms": 0.365,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 28,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 50.6,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.021,
|
|
"Actual Total Time": 0.042,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_history_idx",
|
|
"Relation Name": "messages_composite",
|
|
"Alias": "messages_composite",
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 62.64,
|
|
"Plan Rows": 31,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.02,
|
|
"Actual Total Time": 0.039,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "((chat_id = 2) AND (ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0)))",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"execution_ms": 0.066,
|
|
"planning_ms": 0.299,
|
|
"actual_rows": 25,
|
|
"shared_hit_blocks": 28,
|
|
"shared_read_blocks": 0,
|
|
"plan": {
|
|
"Node Type": "Limit",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 50.6,
|
|
"Plan Rows": 25,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.015,
|
|
"Actual Total Time": 0.036,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0,
|
|
"Plans": [
|
|
{
|
|
"Node Type": "Index Scan",
|
|
"Parent Relationship": "Outer",
|
|
"Parallel Aware": false,
|
|
"Async Capable": false,
|
|
"Scan Direction": "Forward",
|
|
"Index Name": "messages_chat_history_idx",
|
|
"Relation Name": "messages_composite",
|
|
"Alias": "messages_composite",
|
|
"Startup Cost": 0.42,
|
|
"Total Cost": 62.64,
|
|
"Plan Rows": 31,
|
|
"Plan Width": 41,
|
|
"Actual Startup Time": 0.014,
|
|
"Actual Total Time": 0.033,
|
|
"Actual Rows": 25,
|
|
"Actual Loops": 1,
|
|
"Index Cond": "((chat_id = 2) AND (ROW(created_at, id) > ROW('2025-01-01 23:36:40+00'::timestamp with time zone, 0)))",
|
|
"Rows Removed by Index Recheck": 0,
|
|
"Shared Hit Blocks": 28,
|
|
"Shared Read Blocks": 0,
|
|
"Shared Dirtied Blocks": 0,
|
|
"Shared Written Blocks": 0,
|
|
"Local Hit Blocks": 0,
|
|
"Local Read Blocks": 0,
|
|
"Local Dirtied Blocks": 0,
|
|
"Local Written Blocks": 0,
|
|
"Temp Read Blocks": 0,
|
|
"Temp Written Blocks": 0
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"write_cost": {
|
|
"chat_id_only": {
|
|
"samples": [
|
|
{
|
|
"execution_ms": 4.163,
|
|
"planning_ms": 0.062,
|
|
"shared_write_blocks": 25
|
|
},
|
|
{
|
|
"execution_ms": 3.936,
|
|
"planning_ms": 0.05,
|
|
"shared_write_blocks": 40
|
|
},
|
|
{
|
|
"execution_ms": 3.97,
|
|
"planning_ms": 0.051,
|
|
"shared_write_blocks": 25
|
|
},
|
|
{
|
|
"execution_ms": 3.722,
|
|
"planning_ms": 0.05,
|
|
"shared_write_blocks": 24
|
|
},
|
|
{
|
|
"execution_ms": 4.037,
|
|
"planning_ms": 0.059,
|
|
"shared_write_blocks": 25
|
|
}
|
|
],
|
|
"median_execution_ms": 3.97,
|
|
"median_shared_write_blocks": 25,
|
|
"rows_per_sample": 2000,
|
|
"rolled_back_after_each_measurement": true
|
|
},
|
|
"composite_history": {
|
|
"samples": [
|
|
{
|
|
"execution_ms": 5.166,
|
|
"planning_ms": 0.062,
|
|
"shared_write_blocks": 26
|
|
},
|
|
{
|
|
"execution_ms": 7.163,
|
|
"planning_ms": 0.051,
|
|
"shared_write_blocks": 120
|
|
},
|
|
{
|
|
"execution_ms": 4.777,
|
|
"planning_ms": 0.05,
|
|
"shared_write_blocks": 23
|
|
},
|
|
{
|
|
"execution_ms": 4.501,
|
|
"planning_ms": 0.049,
|
|
"shared_write_blocks": 24
|
|
},
|
|
{
|
|
"execution_ms": 5.049,
|
|
"planning_ms": 0.05,
|
|
"shared_write_blocks": 25
|
|
}
|
|
],
|
|
"median_execution_ms": 5.049,
|
|
"median_shared_write_blocks": 25,
|
|
"rows_per_sample": 2000,
|
|
"rolled_back_after_each_measurement": true
|
|
}
|
|
},
|
|
"backup_restore": {
|
|
"format": "pg_dump custom format",
|
|
"dump_bytes": 1596489,
|
|
"dump_seconds": 0.25986058299895376,
|
|
"restore_seconds": 0.31837804202223197,
|
|
"restored_counts": {
|
|
"messages_chat_only": 100000,
|
|
"messages_composite": 100000
|
|
},
|
|
"source_selected_checksums": {
|
|
"messages_chat_only": "59b4843022f2d85760e29d81bb6ca73c",
|
|
"messages_composite": "59b4843022f2d85760e29d81bb6ca73c"
|
|
},
|
|
"restored_selected_checksums": {
|
|
"messages_chat_only": "59b4843022f2d85760e29d81bb6ca73c",
|
|
"messages_composite": "59b4843022f2d85760e29d81bb6ca73c"
|
|
},
|
|
"verification": "PASS"
|
|
}
|
|
}
|