Files
mtusi2026lab2/evidence/sql-research-domain.json

1185 lines
45 KiB
JSON

{
"date_utc": "2026-10-07T11:54:58.801374+00:00",
"hypothesis": "A composite history index reduces late-page reads compared with a chat-only index, at an additional write cost.",
"method": "100000 synthetic messages: 90% in chat 1, 9% in chat 2, 1% in chat 3. Compare identical late-page SELECT and 1000-row INSERT EXPLAIN ANALYZE BUFFERS (rolled back), three repetitions after ANALYZE.",
"versions": {
"postgres": "PostgreSQL 17.6 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit"
},
"limitations": "Single local Docker host; synthetic isolated schema using the actual application migration; logical backup requires a quiescent comparison dataset; no WAL/PITR; restore shares the same PostgreSQL instance but uses a new database.",
"variants": [
{
"name": "chat_only",
"columns": "chat_id",
"select_sql": "SELECT id,chat_id,sender_id,text,created_at FROM research_9d526446.messages WHERE chat_id=md5('1')::uuid AND (created_at,id)>('2026-01-01Z'::timestamptz+85000*interval '1 microsecond',md5('85000')::uuid) ORDER BY created_at,id LIMIT 51",
"insert_sql": "INSERT INTO research_9d526446.messages SELECT md5(n::text)::uuid,md5('1')::uuid,'11111111-1111-4111-8111-111111111111','new-synthetic-'||n,'2026-01-01Z'::timestamptz+n*interval '1 microsecond' FROM generate_series(100001,101000) AS n",
"select_plans": [
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 3685.76,
"Total Cost": 3685.88,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 7.601,
"Actual Total Time": 7.607,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 1241,
"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": 3685.76,
"Total Cost": 3719.53,
"Plan Rows": 13511,
"Plan Width": 71,
"Actual Startup Time": 7.6,
"Actual Total Time": 7.603,
"Actual Rows": 51,
"Actual Loops": 1,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Used": 31,
"Sort Space Type": "Memory",
"Shared Hit Blocks": 1241,
"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": "Seq Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 3235.0,
"Plan Rows": 13511,
"Plan Width": 71,
"Actual Startup Time": 6.144,
"Actual Total Time": 7.191,
"Actual Rows": 5000,
"Actual Loops": 1,
"Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Filter": 95000,
"Shared Hit Blocks": 1235,
"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
}
]
}
]
},
"Planning": {
"Shared Hit Blocks": 103,
"Shared Read Blocks": 1,
"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
},
"Planning Time": 0.608,
"Triggers": [],
"Execution Time": 7.646
}
],
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 3724.55,
"Total Cost": 3724.68,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 8.31,
"Actual Total Time": 8.317,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 1254,
"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": 3724.55,
"Total Cost": 3758.69,
"Plan Rows": 13653,
"Plan Width": 71,
"Actual Startup Time": 8.308,
"Actual Total Time": 8.311,
"Actual Rows": 51,
"Actual Loops": 1,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Used": 31,
"Sort Space Type": "Memory",
"Shared Hit Blocks": 1254,
"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": "Seq Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 3269.06,
"Plan Rows": 13653,
"Plan Width": 71,
"Actual Startup Time": 6.567,
"Actual Total Time": 7.899,
"Actual Rows": 5000,
"Actual Loops": 1,
"Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Filter": 95000,
"Shared Hit Blocks": 1248,
"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
}
]
}
]
},
"Planning": {
"Shared Hit Blocks": 104,
"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
},
"Planning Time": 0.68,
"Triggers": [],
"Execution Time": 8.36
}
],
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 3766.35,
"Total Cost": 3766.48,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 8.553,
"Actual Total Time": 8.559,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 1268,
"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": 3766.35,
"Total Cost": 3800.87,
"Plan Rows": 13807,
"Plan Width": 71,
"Actual Startup Time": 8.551,
"Actual Total Time": 8.553,
"Actual Rows": 51,
"Actual Loops": 1,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Used": 31,
"Sort Space Type": "Memory",
"Shared Hit Blocks": 1268,
"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": "Seq Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 3305.72,
"Plan Rows": 13807,
"Plan Width": 71,
"Actual Startup Time": 6.921,
"Actual Total Time": 8.184,
"Actual Rows": 5000,
"Actual Loops": 1,
"Filter": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Filter": 95000,
"Shared Hit Blocks": 1262,
"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
}
]
}
]
},
"Planning": {
"Shared Hit Blocks": 104,
"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
},
"Planning Time": 0.66,
"Triggers": [],
"Execution Time": 8.604
}
]
],
"insert_plans": [
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 7.514,
"Actual Total Time": 7.515,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 6080,
"Shared Read Blocks": 3,
"Shared Dirtied Blocks": 22,
"Shared Written Blocks": 19,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.081,
"Actual Total Time": 1.819,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.411,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 7.609,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 7.276,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 7.618,
"Calls": 1000
}
],
"Execution Time": 30.26
}
],
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 7.615,
"Actual Total Time": 7.616,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 7091,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 15,
"Shared Written Blocks": 15,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.063,
"Actual Total Time": 1.659,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.385,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 7.476,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 7.355,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 7.321,
"Calls": 1000
}
],
"Execution Time": 30.009
}
],
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 7.642,
"Actual Total Time": 7.643,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 7103,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 14,
"Shared Written Blocks": 14,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.072,
"Actual Total Time": 1.706,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.439,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 7.438,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 6.98,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 7.291,
"Calls": 1000
}
],
"Execution Time": 29.615
}
]
]
},
{
"name": "history_keyset",
"columns": "chat_id,created_at,id",
"select_sql": "SELECT id,chat_id,sender_id,text,created_at FROM research_9d526446.messages WHERE chat_id=md5('1')::uuid AND (created_at,id)>('2026-01-01Z'::timestamptz+85000*interval '1 microsecond',md5('85000')::uuid) ORDER BY created_at,id LIMIT 51",
"insert_sql": "INSERT INTO research_9d526446.messages SELECT md5(n::text)::uuid,md5('1')::uuid,'11111111-1111-4111-8111-111111111111','new-synthetic-'||n,'2026-01-01Z'::timestamptz+n*interval '1 microsecond' FROM generate_series(100001,101000) AS n",
"select_plans": [
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 0.42,
"Total Cost": 11.78,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.085,
"Actual Total Time": 0.097,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 2,
"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": "candidate",
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.42,
"Total Cost": 2985.49,
"Plan Rows": 13397,
"Plan Width": 71,
"Actual Startup Time": 0.084,
"Actual Total Time": 0.092,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Index Recheck": 0,
"Shared Hit Blocks": 2,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 122,
"Shared Read Blocks": 1,
"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
},
"Planning Time": 0.71,
"Triggers": [],
"Execution Time": 0.136
}
],
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 0.42,
"Total Cost": 11.8,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.02,
"Actual Total Time": 0.028,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 5,
"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": "candidate",
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.42,
"Total Cost": 3020.1,
"Plan Rows": 13534,
"Plan Width": 71,
"Actual Startup Time": 0.019,
"Actual Total Time": 0.025,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Index Recheck": 0,
"Shared Hit Blocks": 5,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 115,
"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
},
"Planning Time": 0.469,
"Triggers": [],
"Execution Time": 0.055
}
],
[
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 0.42,
"Total Cost": 11.78,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.018,
"Actual Total Time": 0.026,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 5,
"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": "candidate",
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.42,
"Total Cost": 3048.66,
"Plan Rows": 13681,
"Plan Width": 71,
"Actual Startup Time": 0.018,
"Actual Total Time": 0.023,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = 'c4ca4238-a0b9-2382-0dcc-509a6f75849b'::uuid) AND (ROW(created_at, id) > ROW(('2026-01-01 00:00:00+00'::timestamp with time zone + '00:00:00.085'::interval), 'dedbbd60-c592-c7ad-b64f-8ef8f0a025dc'::uuid)))",
"Rows Removed by Index Recheck": 0,
"Shared Hit Blocks": 5,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 115,
"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
},
"Planning Time": 0.598,
"Triggers": [],
"Execution Time": 0.062
}
]
],
"insert_plans": [
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 7.335,
"Actual Total Time": 7.337,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 8151,
"Shared Read Blocks": 3,
"Shared Dirtied Blocks": 29,
"Shared Written Blocks": 26,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.07,
"Actual Total Time": 1.075,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.39,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 6.761,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 6.278,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 6.428,
"Calls": 1000
}
],
"Execution Time": 26.984
}
],
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 7.21,
"Actual Total Time": 7.21,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 8119,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 15,
"Shared Written Blocks": 15,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.042,
"Actual Total Time": 1.326,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.239,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 8.345,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 7.26,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 7.663,
"Calls": 1000
}
],
"Execution Time": 30.715
}
],
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Parallel Aware": false,
"Async Capable": false,
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 0,
"Plan Width": 0,
"Actual Startup Time": 6.15,
"Actual Total Time": 6.151,
"Actual Rows": 0,
"Actual Loops": 1,
"Shared Hit Blocks": 8149,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 13,
"Shared Written Blocks": 13,
"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": "Function Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Function Name": "generate_series",
"Alias": "n",
"Startup Cost": 0.0,
"Total Cost": 37.5,
"Plan Rows": 1000,
"Plan Width": 88,
"Actual Startup Time": 0.058,
"Actual Total Time": 1.152,
"Actual Rows": 1000,
"Actual Loops": 1,
"Shared Hit Blocks": 0,
"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
}
]
},
"Planning": {
"Shared Hit Blocks": 21,
"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
},
"Planning Time": 0.542,
"Triggers": [
{
"Trigger Name": "RI_ConstraintTrigger_c_17391",
"Constraint Name": "messages_chat_id_fkey",
"Relation": "messages",
"Time": 6.747,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17396",
"Constraint Name": "messages_sender_id_fkey",
"Relation": "messages",
"Time": 6.355,
"Calls": 1000
},
{
"Trigger Name": "RI_ConstraintTrigger_c_17401",
"Constraint Name": "messages_chat_id_sender_id_fkey",
"Relation": "messages",
"Time": 6.588,
"Calls": 1000
}
],
"Execution Time": 26.067
}
]
]
}
],
"source_snapshot_sha256": "df5a6a8d97058191dfc0a2f1378a09a0d1d43c918f268c0b79e00579b317aa80",
"backup_seconds": 0.25334600001224317,
"backup_bytes": 15684575,
"restore_seconds": 0.46191787501447834,
"verification": {
"before": "100000|aad2b0e3a8548b1c909b9a7826835a07",
"after": "100000|aad2b0e3a8548b1c909b9a7826835a07",
"equal": true
},
"samples": [
{
"id": "c4ca4238-a0b9-2382-0dcc-509a6f75849b",
"chat_id": "c4ca4238-a0b9-2382-0dcc-509a6f75849b",
"sender_id": "11111111-1111-4111-8111-111111111111",
"text": "synthetic-1",
"created_at": "2026-01-01T00:00:00.000001+00:00"
},
{
"id": "1017bfd4-6739-55ff-ee46-41ad3d481b1c",
"chat_id": "c4ca4238-a0b9-2382-0dcc-509a6f75849b",
"sender_id": "11111111-1111-4111-8111-111111111111",
"text": "synthetic-50000",
"created_at": "2026-01-01T00:00:00.05+00:00"
},
{
"id": "e98ff526-ad76-393f-7dfb-9717aa548154",
"chat_id": "c4ca4238-a0b9-2382-0dcc-509a6f75849b",
"sender_id": "11111111-1111-4111-8111-111111111111",
"text": "synthetic-90000",
"created_at": "2026-01-01T00:00:00.09+00:00"
},
{
"id": "5256ce97-fefe-0f76-9da7-cb6e350dfc0e",
"chat_id": "c81e728d-9d4c-2f63-6f06-7f89cc14862c",
"sender_id": "11111111-1111-4111-8111-111111111111",
"text": "synthetic-99000",
"created_at": "2026-01-01T00:00:00.099+00:00"
},
{
"id": "14ee22ea-ba29-7944-c96a-fdbe5b16c65b",
"chat_id": "eccbc87e-4b5c-e2fe-2830-8fd9f2a7baf3",
"sender_id": "11111111-1111-4111-8111-111111111111",
"text": "synthetic-100000",
"created_at": "2026-01-01T00:00:00.1+00:00"
}
]
}