Skip to content

Instantly share code, notes, and snippets.

@3manuek
Created March 13, 2016 22:26
Show Gist options
  • Save 3manuek/508d59a98e0ca2fc35aa to your computer and use it in GitHub Desktop.
Save 3manuek/508d59a98e0ca2fc35aa to your computer and use it in GitHub Desktop.
EXPLAIN article query
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=136.84..136.84 rows=1 width=168) (actual time=675.113..675.114 rows=9 loops=1)
Sort Key: (ts_rank(ls._fts, query.query))
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=57
-> Nested Loop (cost=100.15..136.83 rows=1 width=168) (actual time=606.784..675.068 rows=9 loops=1)
Buffers: shared hit=57
-> Nested Loop (cost=100.00..129.96 rows=1 width=186) (actual time=594.691..595.077 rows=9 loops=1)
Join Filter: (ls.id = rds.id)
Rows Removed by Join Filter: 441
Buffers: shared hit=3
-> Nested Loop (cost=0.00..12.70 rows=4 width=72) (actual time=0.214..0.308 rows=9 loops=1)
Buffers: shared hit=3
-> Function Scan on to_tsquery query (cost=0.00..0.01 rows=1 width=32) (actual time=0.094..0.095 rows=1 loops=1)
-> Append (cost=0.00..12.63 rows=5 width=40) (actual time=0.111..0.200 rows=9 loops=1)
Buffers: shared hit=3
-> Seq Scan on local_search ls (cost=0.00..0.00 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=1)
Filter: (_fts @@ query.query)
-> Bitmap Heap Scan on local_search_host1 ls_1 (cost=4.17..12.63 rows=4 width=40) (actual time=0.096..0.178 rows=9 loops=1)
Recheck Cond: (_fts @@ query.query)
Rows Removed by Index Recheck: 36
Heap Blocks: exact=2
Buffers: shared hit=3
-> Bitmap Index Scan on fts_index_host1 (cost=0.00..4.17 rows=4 width=0) (actual time=0.052..0.052 rows=45 loops=1)
Index Cond: (_fts @@ query.query)
Buffers: shared hit=1
-> Materialize (cost=100.00..117.09 rows=3 width=122) (actual time=66.051..66.068 rows=50 loops=9)
-> Foreign Scan on __person__pgp_rds rds (cost=100.00..117.07 rows=3 width=122) (actual time=594.445..594.485 rows=50 loops=1)
-> Index Scan using keys_pkey on keys ks (cost=0.15..6.84 rows=1 width=82) (actual time=0.017..0.019 rows=1 loops=9)
Index Cond: ((keyid)::text = (rds.keyid)::text)
Buffers: shared hit=18
Planning time: 0.969 ms
Execution time: 912.521 ms
(32 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment