Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
EXPLAIN ANALYZE SELECT * FROM words WHERE word LIKE 'o%' ORDER BY word USING < LIMIT 10;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=20178.09..20178.12 rows=10 width=440) (actual time=45.203..45.215 rows=10 loops=1)
-> Sort (cost=20178.09..20199.27 rows=8471 width=440) (actual time=45.202..45.203 rows=10 loops=1)
Sort Key: word
Sort Method: top-N heapsort Memory: 29kB
-> Bitmap Heap Scan on words (cost=218.41..19995.04 rows=8471 width=440) (actual time=4.769..26.591 rows=11599 loops=1)
Filter: ((word)::text ~~ 'o%'::text)
Heap Blocks: exact=1192
-> Bitmap Index Scan on index_words_word (cost=0.00..216.29 rows=8387 width=0) (actual time=4.486..4.486 rows=11599 loops=1)
Index Cond: (((word)::text ~>=~ 'o'::text) AND ((word)::text ~<~ 'p'::text))
Planning time: 0.563 ms
Execution time: 45.315 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment