explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fV5m

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 2.339 ↓ 2.4 26 1

Limit (cost=667.80..667.83 rows=11 width=5,745) (actual time=2.324..2.339 rows=26 loops=1)

2. 0.264 2.333 ↓ 2.4 26 1

Sort (cost=667.80..667.83 rows=11 width=5,745) (actual time=2.323..2.333 rows=26 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, '''appl'''::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: 193kB
3. 0.502 2.069 ↓ 2.4 26 1

WindowAgg (cost=147.09..667.61 rows=11 width=5,745) (actual time=1.892..2.069 rows=26 loops=1)

4. 0.053 1.567 ↓ 2.4 26 1

Nested Loop Left Join (cost=147.09..667.25 rows=11 width=5,620) (actual time=0.775..1.567 rows=26 loops=1)

  • Join Filter: (generic_term_v2s.product_id = items_0.product_id)
5. 0.055 1.514 ↓ 2.4 26 1

Nested Loop Left Join (cost=146.94..658.91 rows=11 width=5,612) (actual time=0.760..1.514 rows=26 loops=1)

  • Join Filter: ((retailer_term_v2s.product_id = items_0.product_id) AND (retailer_term_v2s.retailer_id = items_0.retailer_id))
6. 0.044 1.459 ↓ 2.4 26 1

Nested Loop Left Join (cost=142.75..645.27 rows=11 width=5,604) (actual time=0.742..1.459 rows=26 loops=1)

7. 0.056 1.337 ↓ 2.4 26 1

Nested Loop Left Join (cost=142.33..551.96 rows=11 width=5,596) (actual time=0.723..1.337 rows=26 loops=1)

  • Join Filter: ((items_availabilities.inventory_area_id = items_0.inventory_area_id) AND (items_availabilities.item_id = items_0.item_id))
8. 0.062 1.281 ↓ 2.4 26 1

Nested Loop Left Join (cost=138.12..536.24 rows=11 width=5,588) (actual time=0.706..1.281 rows=26 loops=1)

9. 0.047 1.141 ↓ 2.4 26 1

Nested Loop Left Join (cost=137.83..444.80 rows=11 width=4,687) (actual time=0.685..1.141 rows=26 loops=1)

10. 0.050 1.016 ↓ 2.4 26 1

Nested Loop Left Join (cost=137.55..357.45 rows=11 width=4,659) (actual time=0.668..1.016 rows=26 loops=1)

11. 0.048 0.888 ↓ 2.4 26 1

Nested Loop (cost=137.26..270.09 rows=11 width=4,048) (actual time=0.651..0.888 rows=26 loops=1)

12. 0.071 0.684 ↓ 2.4 26 1

Bitmap Heap Scan on items_0 (cost=136.98..182.73 rows=11 width=1,107) (actual time=0.625..0.684 rows=26 loops=1)

  • Recheck Cond: ((full_text_v2 @@ '''appl'''::tsquery) AND (inventory_area_id = 20,636))
  • Filter: (visible AND available AND (NOT alcoholic))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=27
13. 0.009 0.613 ↓ 0.0 0 1

BitmapAnd (cost=136.98..136.98 rows=12 width=0) (actual time=0.612..0.613 rows=0 loops=1)

14. 0.133 0.133 ↑ 1.0 80 1

Bitmap Index Scan on search_index_v2_items_0 (cost=0.00..20.80 rows=80 width=0) (actual time=0.133..0.133 rows=80 loops=1)

  • Index Cond: ((full_text_v2 @@ '''appl'''::tsquery) AND (inventory_area_id = 20,636))
15. 0.471 0.471 ↓ 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.470..0.471 rows=4,223 loops=1)

  • Index Cond: ((available = true) AND (visible = true))
16. 0.156 0.156 ↑ 1.0 1 26

Index Scan using index_retailer_products_on_retailer_id_and_product_id on retailer_products (cost=0.29..7.94 rows=1 width=2,941) (actual time=0.006..0.006 rows=1 loops=26)

  • Index Cond: ((retailer_id = items_0.retailer_id) AND (product_id = items_0.product_id))
17. 0.078 0.078 ↑ 1.0 1 26

Index Scan using index_deprecated_retailer_products_mls_cpk on deprecated_retailer_products_mls (cost=0.29..7.94 rows=1 width=619) (actual time=0.003..0.003 rows=1 loops=26)

  • Index Cond: ((retailer_id = items_0.retailer_id) AND (product_id = items_0.product_id))
18. 0.078 0.078 ↑ 1.0 1 26

Index Scan using index_deprecated_retailer_products_cpgs_cpk on deprecated_retailer_products_cpgs (cost=0.29..7.94 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=26)

  • Index Cond: ((retailer_id = items_0.retailer_id) AND (product_id = items_0.product_id))
19. 0.078 0.078 ↑ 1.0 1 26

Index Scan using deprecated_items_denormalized_retailer_id_product_id_invent_idx on deprecated_items_denormalizeds_0 (cost=0.29..8.31 rows=1 width=901) (actual time=0.003..0.003 rows=1 loops=26)

  • Index Cond: ((retailer_id = items_0.retailer_id) AND (product_id = items_0.product_id) AND (inventory_area_id = items_0.inventory_area_id) AND (inventory_area_id = 20,636))
20. 0.000 0.000 ↓ 0.0 0 26

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

21. 0.001 0.003 ↓ 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.003..0.003 rows=0 loops=1)

  • Recheck Cond: (inventory_area_id = 20,636)
22. 0.002 0.002 ↓ 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.002..0.002 rows=0 loops=1)

  • Index Cond: (inventory_area_id = 20,636)
23. 0.078 0.078 ↓ 0.0 0 26

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

  • Index Cond: ((version = 3) AND (product_id = items_0.product_id) AND ((query)::text = 'apple'::text))
24. 0.000 0.000 ↓ 0.0 0 26

Materialize (cost=4.19..12.69 rows=5 width=16) (actual time=0.000..0.000 rows=0 loops=26)

25. 0.001 0.005 ↓ 0.0 0 1

Bitmap Heap Scan on retailer_products_term_v2s retailer_term_v2s (cost=4.19..12.66 rows=5 width=16) (actual time=0.004..0.005 rows=0 loops=1)

  • Recheck Cond: (term = 'apple'::text)
26. 0.004 0.004 ↓ 0.0 0 1

Bitmap Index Scan on index_retailer_products_term_v2s_on_natural_key (cost=0.00..4.19 rows=5 width=0) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (term = 'apple'::text)
27. 0.000 0.000 ↓ 0.0 0 26

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

28. 0.001 0.001 ↓ 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.001..0.001 rows=0 loops=1)

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