explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hzlB

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 6.575 ↑ 3.2 8 1

Subquery Scan on items_0 (cost=2,485.73..2,488.24 rows=26 width=24) (actual time=6.550..6.575 rows=8 loops=1)

  • Filter: (items_0.ingredient_ranking <= 1)
  • Rows Removed by Filter: 14
2. 0.040 6.570 ↑ 3.5 22 1

WindowAgg (cost=2,485.73..2,487.27 rows=77 width=429) (actual time=6.548..6.570 rows=22 loops=1)

3. 0.014 6.530 ↑ 3.5 22 1

Sort (cost=2,485.73..2,485.93 rows=77 width=20) (actual time=6.528..6.530 rows=22 loops=1)

  • Sort Key: recipe_ingredient_products.ingredient_id, (array_position(recipe_ingredient_products.product_ids, (unnest(recipe_ingredient_products.product_ids))))
  • Sort Method: quicksort Memory: 26kB
4. 0.025 6.516 ↑ 3.5 22 1

Nested Loop Left Join (cost=1,601.00..2,483.32 rows=77 width=20) (actual time=6.392..6.516 rows=22 loops=1)

  • Filter: (COALESCE(items_availabilities.availability_score, '0.87'::double precision) > '0.525'::double precision)
5. 0.014 5.061 ↑ 10.5 22 1

Hash Join (cost=1,600.71..2,089.08 rows=232 width=24) (actual time=5.006..5.061 rows=22 loops=1)

  • Hash Cond: (recipe_ingredient_products.ingredient_id = recipe_ingredients.ingredient_id)
6. 0.020 5.023 ↑ 60.6 17 1

Hash Join (cost=1,580.51..2,058.84 rows=1,030 width=24) (actual time=4.976..5.023 rows=17 loops=1)

  • Hash Cond: ((unnest(recipe_ingredient_products.product_ids)) = items_0_1.product_id)
7. 0.024 0.051 ↑ 235.2 54 1

Result (cost=0.00..317.98 rows=12,700 width=12) (actual time=0.016..0.051 rows=54 loops=1)

8. 0.017 0.027 ↑ 235.2 54 1

ProjectSet (cost=0.00..95.72 rows=12,700 width=40) (actual time=0.011..0.027 rows=54 loops=1)

9. 0.010 0.010 ↑ 158.8 8 1

Seq Scan on recipe_ingredient_products (cost=0.00..22.70 rows=1,270 width=36) (actual time=0.007..0.010 rows=8 loops=1)

10. 0.617 4.952 ↓ 2.5 2,054 1

Hash (cost=1,570.16..1,570.16 rows=828 width=16) (actual time=4.952..4.952 rows=2,054 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 137kB
11. 2.341 4.335 ↓ 2.5 2,054 1

Bitmap Heap Scan on items_0 items_0_1 (cost=183.11..1,570.16 rows=828 width=16) (actual time=2.173..4.335 rows=2,054 loops=1)

  • Recheck Cond: (inventory_area_id = 20,636)
  • Filter: (available AND visible AND (retailer_id = 29))
  • Heap Blocks: exact=1,067
12. 0.115 1.994 ↓ 0.0 0 1

BitmapAnd (cost=183.11..183.11 rows=828 width=0) (actual time=1.994..1.994 rows=0 loops=1)

13. 1.071 1.071 ↑ 1.0 4,404 1

Bitmap Index Scan on search_index_v2_items_0 (cost=0.00..49.03 rows=4,404 width=0) (actual time=1.071..1.071 rows=4,404 loops=1)

  • Index Cond: (inventory_area_id = 20,636)
14. 0.808 0.808 ↓ 1.8 6,025 1

Bitmap Index Scan on items_0_available_visible_idx (cost=0.00..133.42 rows=3,313 width=0) (actual time=0.808..0.808 rows=6,025 loops=1)

  • Index Cond: ((available = true) AND (visible = true))
15. 0.007 0.024 ↑ 4.5 10 1

Hash (cost=19.64..19.64 rows=45 width=4) (actual time=0.024..0.024 rows=10 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
16. 0.007 0.017 ↑ 4.5 10 1

Bitmap Heap Scan on recipe_ingredients (cost=8.96..19.64 rows=45 width=4) (actual time=0.015..0.017 rows=10 loops=1)

  • Recheck Cond: (recipe_id = ANY ('{1,2,3,4}'::integer[]))
  • Heap Blocks: exact=1
17. 0.010 0.010 ↑ 4.5 10 1

Bitmap Index Scan on index_recipe_ingredients_on_recipe_id_and_ingredient_id (cost=0.00..8.95 rows=45 width=0) (actual time=0.010..0.010 rows=10 loops=1)

  • Index Cond: (recipe_id = ANY ('{1,2,3,4}'::integer[]))
18. 1.430 1.430 ↑ 1.0 1 22

Index Scan using items_availabilities_0_item_id_idx on items_availabilities_0 items_availabilities (cost=0.29..1.69 rows=1 width=20) (actual time=0.065..0.065 rows=1 loops=22)

  • Index Cond: (item_id = items_0_1.item_id)
  • Filter: ((inventory_area_id = 20,636) AND (inventory_area_id = items_0_1.inventory_area_id))
Planning time : 3.689 ms
Execution time : 6.742 ms