17 lines
1.2 KiB
Plaintext
Executable File
17 lines
1.2 KiB
Plaintext
Executable File
-- L15 keyset WITH sort-key index (range seek) — same deep page, offset 1980 equivalent cursor
|
|
-- FeedKeysetIT.l15ExplainOffsetScansThenDiscardsKeysetSeeksAndNeedsIndex (seed 2000)
|
|
-- SELECT fi.id, fi.first_highlighted_at FROM feed_items fi
|
|
-- WHERE (fi.first_highlighted_at, fi.id) < (TIMESTAMPTZ '...', '...'::uuid) -- cursor = 이전 페이지 마지막 행
|
|
-- ORDER BY fi.first_highlighted_at DESC, fi.id DESC LIMIT 20
|
|
-- 읽기 포인트: Index Only Scan(커버링) 으로 커서 이후 20행만 seek — actual rows=20, Heap Fetches=20, buffers 1(+2 read).
|
|
-- 순서가 인덱스로 보장돼 Sort 노드가 없다. 페이지 깊이와 무관하게 상수(vs OFFSET 의 2000).
|
|
|
|
Limit (cost=0.28..18.14 rows=20 width=24) (actual time=0.054..0.060 rows=20 loops=1)
|
|
Buffers: shared hit=1 read=2
|
|
-> Index Only Scan using ix_feed_items_keyset on feed_items fi (cost=0.28..595.95 rows=667 width=24) (actual time=0.054..0.057 rows=20 loops=1)
|
|
Index Cond: (ROW(first_highlighted_at, id) < ROW('2026-04-17 13:00:00+00'::timestamp with time zone, '17ab2b68-0981-43cc-a673-5757f7214899'::uuid))
|
|
Heap Fetches: 20
|
|
Buffers: shared hit=1 read=2
|
|
Planning Time: 0.052 ms
|
|
Execution Time: 0.076 ms
|