-- run 3 -- keyset, page 50000 (page size 20) -- SELECT id, created_at, customer, total FROM orders WHERE (created_at, id) < ($1::timestamptz, $2::bigint) ORDER BY created_at DESC, id DESC LIMIT 20 -- params: ["2026-01-01 00:07:00+00","250453"] Limit (cost=82.37..82.42 rows=20 width=37) (actual time=0.066..0.068 rows=20 loops=1) Buffers: shared hit=29 -> Sort (cost=82.37..82.42 rows=20 width=37) (actual time=0.065..0.065 rows=20 loops=1) Sort Key: created_at DESC, id DESC Sort Method: quicksort Memory: 26kB Buffers: shared hit=29 -> Bitmap Heap Scan on orders (cost=4.58..81.94 rows=20 width=37) (actual time=0.013..0.025 rows=20 loops=1) Recheck Cond: (ROW(created_at, id) < ROW('2026-01-01 00:07:00+00'::timestamp with time zone, '250453'::bigint)) Heap Blocks: exact=20 Buffers: shared hit=23 -> Bitmap Index Scan on orders_created_at_id_idx (cost=0.00..4.58 rows=20 width=0) (actual time=0.009..0.009 rows=20 loops=1) Index Cond: (ROW(created_at, id) < ROW('2026-01-01 00:07:00+00'::timestamp with time zone, '250453'::bigint)) Buffers: shared hit=3 Planning: Buffers: shared hit=4 Planning Time: 0.095 ms Execution Time: 0.099 ms