UTC: 2026-10-02T09:42:09.839961+00:00
PostgreSQL: 17.6 (Debian 17.6-2.pgdg12+1)
Synthetic chat sizes: hot=80000, medium=15000, cold=5000; fixed 51-row pages; deep cursor=72000
Variant A: messages_history_idx
{"variant": "A", "operation": "first", "plan": {"Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 7.65, "Plan Rows": 51, "Plan Width": 75, "Actual Startup Time": 0.001, "Actual Total Time": 0.006, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 6, "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_history_idx", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 11340.4, "Plan Rows": 80004, "Plan Width": 75, "Actual Startup Time": 0.001, "Actual Total Time": 0.004, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "(chat_id = 'a9024646-24db-4984-b912-1030eea3ed60'::uuid)", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 6, "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}]}}
{"variant": "A", "operation": "deep", "plan": {"Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 53.72, "Plan Rows": 51, "Plan Width": 75, "Actual Startup Time": 0.002, "Actual Total Time": 0.006, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 6, "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_history_idx", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 6225.66, "Plan Rows": 5956, "Plan Width": 75, "Actual Startup Time": 0.001, "Actual Total Time": 0.004, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = 'a9024646-24db-4984-b912-1030eea3ed60'::uuid) AND (ROW(created_at, id) > ROW('2026-10-02 09:42:09.355081+00'::timestamp with time zone, '3101b2d4-b2be-4696-9cf8-ea625d0e9d29'::uuid)))", "Rows Removed by Index Recheck": 0, "Shared Hit Blocks": 6, "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}]}}
Variant B: messages_history_covering_idx
{"variant": "B", "operation": "first", "plan": {"Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 3.89, "Plan Rows": 51, "Plan Width": 75, "Actual Startup Time": 0.002, "Actual Total Time": 0.006, "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 Only Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Scan Direction": "Forward", "Index Name": "messages_history_covering_idx", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 5458.29, "Plan Rows": 80107, "Plan Width": 75, "Actual Startup Time": 0.002, "Actual Total Time": 0.005, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "(chat_id = 'a9024646-24db-4984-b912-1030eea3ed60'::uuid)", "Rows Removed by Index Recheck": 0, "Heap Fetches": 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}]}}
{"variant": "B", "operation": "deep", "plan": {"Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.42, "Total Cost": 4.04, "Plan Rows": 51, "Plan Width": 75, "Actual Startup Time": 0.002, "Actual Total Time": 0.006, "Actual Rows": 51, "Actual Loops": 1, "Shared Hit Blocks": 4, "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 Only Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Scan Direction": "Forward", "Index Name": "messages_history_covering_idx", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.42, "Total Cost": 523.64, "Plan Rows": 7361, "Plan Width": 75, "Actual Startup Time": 0.002, "Actual Total Time": 0.004, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = 'a9024646-24db-4984-b912-1030eea3ed60'::uuid) AND (ROW(created_at, id) > ROW('2026-10-02 09:42:09.355081+00'::timestamp with time zone, '3101b2d4-b2be-4696-9cf8-ea625d0e9d29'::uuid)))", "Rows Removed by Index Recheck": 0, "Heap Fetches": 0, "Shared Hit Blocks": 4, "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}]}}
Original history index restored; committed write rows=5000
Index size after benchmark, original A=6799360 bytes, covering B=11935744 bytes; B dropped after measurement
