Skip to content

Instantly share code, notes, and snippets.

@teburd
Created May 10, 2013 17:17
Show Gist options
  • Save teburd/5555879 to your computer and use it in GitHub Desktop.
Save teburd/5555879 to your computer and use it in GitHub Desktop.
with rank, order by, and limit
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=4633.95..4634.20 rows=100 width=51) (actual time=13.523..13.535 rows=100 loops=1)
-> Sort (cost=4633.95..4639.60 rows=2258 width=51) (actual time=13.518..13.522 rows=100 loops=1)
Sort Key: (ts_rank(name_fts, plainto_tsquery('school'::text)))
Sort Method: top-N heapsort Memory: 32kB
-> Bitmap Heap Scan on vertices (cost=37.50..4547.65 rows=2258 width=51) (actual time=2.052..12.442 rows=2307 loops=1)
Recheck Cond: (name_fts @@ plainto_tsquery('school'::text))
-> Bitmap Index Scan on vertices_name_fts_gin_idx (cost=0.00..36.94 rows=2258 width=0) (actual time=1.621..1.621 rows=2307 loops=1)
Index Cond: (name_fts @@ plainto_tsquery('school'::text))
Total runtime: 13.614 ms
(9 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment