explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KPlA

Settings
# exclusive inclusive rows x rows loops node
1. 11.375 27.795 ↑ 1.0 8,002 1

GroupAggregate (cost=3,145.55..271,449.00 rows=8,003 width=663) (actual time=14.736..27.795 rows=8,002 loops=1)

  • Group Key: p.id, pt.id
2. 5.892 16.416 ↑ 1.0 8,002 1

Sort (cost=3,145.55..3,165.56 rows=8,003 width=629) (actual time=14.716..16.416 rows=8,002 loops=1)

  • Sort Key: p.id, pt.id
  • Sort Method: quicksort Memory: 1093kB
3. 3.644 10.524 ↑ 1.0 8,002 1

Hash Left Join (cost=18.83..383.21 rows=8,003 width=629) (actual time=0.035..10.524 rows=8,002 loops=1)

  • Hash Cond: (p.id = vp.product_id)
4. 3.598 6.875 ↑ 1.0 8,002 1

Hash Left Join (cost=10.68..345.03 rows=8,003 width=621) (actual time=0.019..6.875 rows=8,002 loops=1)

  • Hash Cond: (p.producttype_id = pt.id)
5. 3.276 3.276 ↑ 1.0 8,002 1

Seq Scan on t_product p (cost=0.00..233.32 rows=8,003 width=59) (actual time=0.009..3.276 rows=8,002 loops=1)

  • Filter: (retired_date IS NULL)
  • Rows Removed by Filter: 29
6. 0.000 0.001 ↓ 0.0 0 1

Hash (cost=10.30..10.30 rows=30 width=570) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
7. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on t_producttype pt (cost=0.00..10.30 rows=30 width=570) (actual time=0.001..0.001 rows=0 loops=1)

8. 0.001 0.005 ↓ 0.0 0 1

Hash (cost=8.14..8.14 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.004 0.004 ↓ 0.0 0 1

Index Scan using uq_vendor_product_name on t_vendorproduct vp (cost=0.12..8.14 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=1)

10.          

SubPlan (forGroupAggregate)

11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.27..16.31 rows=1 width=0) (never executed)

  • Join Filter: (i.recipe_id = r.id)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ingredient_input_product_id on t_ingredient i (cost=0.14..8.16 rows=1 width=8) (never executed)

  • Index Cond: (p.id = input_product_id)
  • Filter: (retired_date IS NULL)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using uq_recipe_name on t_recipe r (cost=0.12..8.14 rows=1 width=8) (never executed)

14. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.27..16.31 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1)

15. 0.002 0.002 ↓ 0.0 0 1

Index Scan using uq_recipe_name on t_recipe r_1 (cost=0.12..8.14 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1)

16. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ingredient_recipe_id on t_ingredient i_1 (cost=0.14..8.16 rows=1 width=16) (never executed)

  • Index Cond: (recipe_id = r_1.id)
  • Filter: (retired_date IS NULL)
17. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..17.19 rows=1 width=0) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..16.43 rows=1 width=8) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_fk_inventorysectionproduct_product_id on t_inventorysectionitem isp (cost=0.14..8.16 rows=1 width=8) (never executed)

  • Index Cond: (p.id = product_id)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using t_inventorysectionpk on t_inventorysection sec (cost=0.14..8.16 rows=1 width=16) (never executed)

  • Index Cond: (id = isp.section_id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_t_inventory on t_inventory inv (cost=0.14..0.45 rows=1 width=8) (never executed)

  • Index Cond: (id = sec.inventory_id)
  • Filter: (retired_date IS NULL)
22. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.29..20.00 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=1)

23. 0.001 0.002 ↓ 0.0 0 1

Nested Loop (cost=0.14..19.07 rows=2 width=8) (actual time=0.002..0.002 rows=0 loops=1)

24. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on t_inventory inv_1 (cost=0.00..10.90 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (retired_date IS NULL)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_inventorysection_inventory_id on t_inventorysection sec_1 (cost=0.14..8.16 rows=1 width=16) (never executed)

  • Index Cond: (inventory_id = inv_1.id)
26. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_fk_inventorysectionproduct_section_id on t_inventorysectionitem isp_1 (cost=0.14..0.45 rows=1 width=16) (never executed)

  • Index Cond: (section_id = sec_1.id)