explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0x2G

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 4.888 ↓ 11.0 77 1

Limit (cost=321.76..321.78 rows=7 width=77) (actual time=4.859..4.888 rows=77 loops=1)

2. 0.135 4.873 ↓ 11.0 77 1

Sort (cost=321.76..321.78 rows=7 width=77) (actual time=4.857..4.873 rows=77 loops=1)

  • Sort Key: retailer_term_v2s.score DESC NULLS LAST, generic_term_v2s.score DESC NULLS LAST, ((((ts_rank(items_0.full_text_v2, '''water'''::tsquery, 1) * '100'::double precision) + (COALESCE(products_conversions.score, '0'::double precision) * '1000'::double precision)) * '1'::double precision)) DESC, items_0.item_id DESC
  • Sort Method: quicksort Memory: 35kB
3. 1.208 4.738 ↓ 11.0 77 1

WindowAgg (cost=142.58..321.67 rows=7 width=77) (actual time=3.721..4.738 rows=77 loops=1)

4. 0.004 3.530 ↓ 11.0 77 1

Nested Loop Left Join (cost=142.58..321.44 rows=7 width=413) (actual time=2.614..3.530 rows=77 loops=1)

  • Join Filter: (generic_term_v2s.product_id = items_0.product_id)
5. 0.071 3.449 ↓ 11.0 77 1

Nested Loop Left Join (cost=142.43..313.16 rows=7 width=409) (actual time=2.573..3.449 rows=77 loops=1)

6. 0.011 3.301 ↓ 11.0 77 1

Nested Loop Left Join (cost=142.28..297.26 rows=7 width=405) (actual time=2.540..3.301 rows=77 loops=1)

7. 0.073 2.982 ↓ 11.0 77 1

Nested Loop Left Join (cost=141.86..237.42 rows=7 width=397) (actual time=2.508..2.982 rows=77 loops=1)

  • Join Filter: ((items_availabilities.inventory_area_id = items_0.inventory_area_id) AND (items_availabilities.item_id = items_0.item_id))
  • Filter: (COALESCE(items_availabilities.availability_score, '0.87'::double precision) > '0.5'::double precision)
8. 0.454 2.909 ↓ 3.5 77 1

Bitmap Heap Scan on items_0 (cost=137.65..219.97 rows=22 width=393) (actual time=2.482..2.909 rows=77 loops=1)

  • Recheck Cond: ((full_text_v2 @@ '''water'''::tsquery) AND (inventory_area_id = 20,636))
  • Filter: (visible AND available)
  • Heap Blocks: exact=73
9. 0.021 2.455 ↓ 0.0 0 1

BitmapAnd (cost=137.65..137.65 rows=22 width=0) (actual time=2.454..2.455 rows=0 loops=1)

10. 1.552 1.552 ↓ 1.1 167 1

Bitmap Index Scan on search_index_v2_items_0 (cost=0.00..21.46 rows=146 width=0) (actual time=1.552..1.552 rows=167 loops=1)

  • Index Cond: ((full_text_v2 @@ '''water'''::tsquery) AND (inventory_area_id = 20,636))
11. 0.882 0.882 ↓ 1.5 4,223 1

Bitmap Index Scan on items_0_available_visible_idx (cost=0.00..115.93 rows=2,764 width=0) (actual time=0.882..0.882 rows=4,223 loops=1)

  • Index Cond: ((available = true) AND (visible = true))
12. 0.000 0.000 ↓ 0.0 0 77

Materialize (cost=4.21..14.39 rows=7 width=20) (actual time=0.000..0.000 rows=0 loops=77)

13. 0.002 0.005 ↓ 0.0 0 1

Bitmap Heap Scan on items_availabilities_0 items_availabilities (cost=4.21..14.35 rows=7 width=20) (actual time=0.004..0.005 rows=0 loops=1)

  • Recheck Cond: (inventory_area_id = 20,636)
14. 0.003 0.003 ↓ 0.0 0 1

Bitmap Index Scan on items_availabilities_0_inventory_area_id_idx (cost=0.00..4.21 rows=7 width=0) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (inventory_area_id = 20,636)
15. 0.308 0.308 ↓ 0.0 0 77

Index Scan using index_products_conversions_on_cpk on products_conversions (cost=0.42..8.44 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=77)

  • Index Cond: ((version = 1) AND (product_id = items_0.product_id) AND ((query)::text = 'water'::text))
16. 0.077 0.077 ↓ 0.0 0 77

Index Scan using index_retailer_products_term_v2s_on_natural_key on retailer_products_term_v2s retailer_term_v2s (cost=0.15..2.17 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=77)

  • Index Cond: ((term = 'water'::text) AND (retailer_id = items_0.retailer_id) AND (product_id = items_0.product_id))
17. 0.047 0.077 ↓ 0.0 0 77

Materialize (cost=0.15..8.18 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=77)

18. 0.030 0.030 ↓ 0.0 0 1

Index Scan using index_retailer_products_term_v2s_on_natural_key on retailer_products_term_v2s generic_term_v2s (cost=0.15..8.17 rows=1 width=12) (actual time=0.030..0.030 rows=0 loops=1)

  • Index Cond: ((term = 'water'::text) AND (retailer_id = '-1'::integer))
Planning time : 2.283 ms