{ "messages": 10000, "cursor_position": 9000, "page_limit": 50, "fetched_with_lookahead": 51, "sql": "SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id = %s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s", "explain": [ { "Plan": { "Node Type": "Limit", "Parallel Aware": false, "Async Capable": false, "Startup Cost": 0.29, "Total Cost": 17.77, "Plan Rows": 51, "Plan Width": 68, "Actual Startup Time": 0.008, "Actual Total Time": 0.025, "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 Scan", "Parent Relationship": "Outer", "Parallel Aware": false, "Async Capable": false, "Scan Direction": "Forward", "Index Name": "messages_history", "Relation Name": "messages", "Alias": "messages", "Startup Cost": 0.29, "Total Cost": 473.36, "Plan Rows": 1380, "Plan Width": 68, "Actual Startup Time": 0.007, "Actual Total Time": 0.021, "Actual Rows": 51, "Actual Loops": 1, "Index Cond": "((chat_id = '137c9dcf-9f70-465c-862c-595c9a50d5c3'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009+00'::timestamp with time zone, '3873da86-1a3e-2129-c84e-1daf5c084a0d'::uuid)))", "Rows Removed by Index Recheck": 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 } ] }, "Planning": { "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 }, "Planning Time": 0.079, "Triggers": [], "Execution Time": 0.049 } ] }