explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YVVv

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 1.134 ↑ 1.2 5 1

Subquery Scan on items_0 (cost=1,174.20..1,174.81 rows=6 width=4) (actual time=1.124..1.134 rows=5 loops=1)

  • Filter: (items_0.ingredient_ranking <= 1)
  • Rows Removed by Filter: 5
2. 0.031 1.131 ↑ 1.9 10 1

WindowAgg (cost=1,174.20..1,174.58 rows=19 width=429) (actual time=1.123..1.131 rows=10 loops=1)

3. 0.029 1.100 ↑ 1.9 10 1

Sort (cost=1,174.20..1,174.24 rows=19 width=8) (actual time=1.100..1.100 rows=10 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: 25kB
4. 0.010 1.071 ↑ 1.9 10 1

Nested Loop Left Join (cost=15.62..1,173.79 rows=19 width=8) (actual time=0.710..1.071 rows=10 loops=1)

  • Filter: (COALESCE(items_availabilities.availability_score, '0.87'::double precision) > '0.525'::double precision)
5. 0.000 0.951 ↑ 5.7 10 1

Nested Loop (cost=15.34..1,076.93 rows=57 width=20) (actual time=0.683..0.951 rows=10 loops=1)

6. 0.065 0.680 ↑ 17.9 39 1

Hash Join (cost=15.05..494.07 rows=698 width=12) (actual time=0.643..0.680 rows=39 loops=1)

  • Hash Cond: (recipe_ingredient_products.ingredient_id = recipe_ingredients.ingredient_id)
7. 0.018 0.055 ↑ 235.2 54 1

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

8. 0.024 0.037 ↑ 235.2 54 1

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

9. 0.013 0.013 ↑ 158.8 8 1

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

10. 0.547 0.560 ↑ 2.2 5 1

Hash (cost=14.91..14.91 rows=11 width=4) (actual time=0.560..0.560 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.006 0.013 ↑ 2.2 5 1

Bitmap Heap Scan on recipe_ingredients (cost=4.24..14.91 rows=11 width=4) (actual time=0.012..0.013 rows=5 loops=1)

  • Recheck Cond: (recipe_id = 1)
  • Heap Blocks: exact=1
12. 0.007 0.007 ↑ 2.2 5 1

Bitmap Index Scan on index_recipe_ingredients_on_recipe_id_and_ingredient_id (cost=0.00..4.24 rows=11 width=0) (actual time=0.007..0.007 rows=5 loops=1)

  • Index Cond: (recipe_id = 1)
13. 0.273 0.273 ↓ 0.0 0 39

Index Scan using index_items_0_on_product_id_and_inventory_area_id on items_0 items_0_1 (cost=0.29..0.84 rows=1 width=16) (actual time=0.007..0.007 rows=0 loops=39)

  • Index Cond: ((product_id = (unnest(recipe_ingredient_products.product_ids))) AND (inventory_area_id = 20,636))
  • Filter: (available AND visible AND (retailer_id = 29))
  • Rows Removed by Filter: 0
14. 0.110 0.110 ↑ 1.0 1 10

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.011..0.011 rows=1 loops=10)

  • 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 : 4.537 ms
Execution time : 2.071 ms