{ "hypothesis": "Keyset pagination on (chat_id, created_at, id) avoids large offsets; redundant (chat_id)-only index does not improve reads but slows writes.", "hot_chat_id": "9d97f9d9-1ad0-4ab6-b95a-f35411c401b6", "read_plans": { "keyset_limit_50": { "node_type": "Index Only Scan", "index_name": "messages_chat_history_idx", "execution_ms": 0.323, "plan_rows": 50 }, "offset_50000_limit_50": { "node_type": "Index Only Scan", "index_name": "messages_chat_history_idx", "execution_ms": 5.577, "plan_rows": 50 }, "keyset_with_extra_chat_id_index": { "node_type": "Index Only Scan", "index_name": "messages_chat_history_idx", "execution_ms": 0.055, "plan_rows": 50 } }, "write_messages_per_second": { "with_extra_chat_id_index": 17808.1, "production_indexes_only": 22943.3 } }