explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MVyB

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 9.317 ↑ 1.0 1 1

Result (cost=3,056.27..3,056.28 rows=1 width=32) (actual time=9.316..9.317 rows=1 loops=1)

2.          

CTE merchantsbysearchterm

3. 0.132 0.993 ↑ 1.0 23 1

Bitmap Heap Scan on merchants (cost=216.30..260.91 rows=24 width=20) (actual time=0.873..0.993 rows=23 loops=1)

  • Recheck Cond: ((search_vectors @@ plainto_tsquery('shoes'::text)) OR (search_vectors @@ phraseto_tsquery('shoes'::text)))
  • Heap Blocks: exact=57
4. 0.001 0.861 ↓ 0.0 0 1

BitmapOr (cost=216.30..216.30 rows=24 width=0) (actual time=0.861..0.861 rows=0 loops=1)

5. 0.471 0.471 ↓ 9.2 111 1

Bitmap Index Scan on search_vectors_idx (cost=0.00..108.14 rows=12 width=0) (actual time=0.471..0.471 rows=111 loops=1)

  • Index Cond: (search_vectors @@ plainto_tsquery('shoes'::text))
6. 0.389 0.389 ↓ 9.2 111 1

Bitmap Index Scan on search_vectors_idx (cost=0.00..108.14 rows=12 width=0) (actual time=0.389..0.389 rows=111 loops=1)

  • Index Cond: (search_vectors @@ phraseto_tsquery('shoes'::text))
7.          

Initplan (for Result)

8. 0.008 9.310 ↑ 1.5 16 1

Sort (cost=2,795.30..2,795.36 rows=24 width=20) (actual time=9.309..9.310 rows=16 loops=1)

  • Sort Key: merchantsbysearchterm.ranks DESC
  • Sort Method: quicksort Memory: 26kB
9. 0.642 9.302 ↑ 1.5 16 1

HashAggregate (cost=2,794.51..2,794.75 rows=24 width=20) (actual time=9.299..9.302 rows=16 loops=1)

  • Group Key: merchantsbysearchterm.ranks, merchantsbysearchterm.merchant_id
10. 0.547 8.660 ↓ 3.6 3,707 1

Nested Loop (cost=0.42..2,789.37 rows=1,029 width=20) (actual time=0.903..8.660 rows=3,707 loops=1)

11. 1.006 1.006 ↑ 1.0 23 1

CTE Scan on merchantsbysearchterm (cost=0.00..0.48 rows=24 width=20) (actual time=0.875..1.006 rows=23 loops=1)

12. 7.107 7.107 ↓ 3.7 161 23

Index Scan using offers_offering_merchant_id_index on offers (cost=0.42..115.77 rows=43 width=16) (actual time=0.084..0.309 rows=161 loops=23)

  • Index Cond: (offering_merchant_id = merchantsbysearchterm.merchant_id)
  • Filter: (status = 'ON'::offer_status)
  • Rows Removed by Filter: 255
Planning time : 0.335 ms
Execution time : 9.366 ms