explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kOHm

Settings
# exclusive inclusive rows x rows loops node
1. 5,876.035 16,089.588 ↑ 1.0 1 1

GroupAggregate (cost=1,247,447,197.68..1,343,870,182.73 rows=1 width=545) (actual time=16,089.588..16,089.588 rows=1 loops=1)

  • Group Key: pp.pricing_plan_id, pltm.next_markdown_max_cur_price, pltm.next_markdown_min_cur_price, pltm.next_markdown_max_eff_price, pltm.next_markdown_min_eff_price, ppr.revenue_amt, ppr.sales_units_qty, ppr.revenue_no_vat_amt, ppr.margin_amt, pcm.margin_pct_diff_pct, pcm.margin_diff_pct, pcm.revenue_diff_pct, pcm.sales_units_diff_pct, ppr.end_inv_qty, ppr.inv_at_risk_qty, pcm.inv_at_risk_diff_pct, ppr.markdown_spend_amt, pltm.next_markdown_dt, pltm.next_markdown_min_pct, pltm.next_markdown_max_pct, ppr.promotion_spend_amt
2. 8,098.694 10,213.553 ↑ 389.4 2,303,599 1

Sort (cost=1,247,447,197.68..1,249,689,592.68 rows=896,958,000 width=545) (actual time=9,709.296..10,213.553 rows=2,303,599 loops=1)

  • Sort Key: pp.pricing_plan_id, pltm.next_markdown_max_cur_price, pltm.next_markdown_min_cur_price, pltm.next_markdown_max_eff_price, pltm.next_markdown_min_eff_price, ppr.revenue_amt, ppr.sales_units_qty, ppr.revenue_no_vat_amt, ppr.margin_amt, pcm.margin_pct_diff_pct, pcm.margin_diff_pct, pcm.revenue_diff_pct, pcm.sales_units_diff_pct, ppr.end_inv_qty, ppr.inv_at_risk_qty, pcm.inv_at_risk_diff_pct, ppr.markdown_spend_amt, pltm.next_markdown_dt, pltm.next_markdown_min_pct, pltm.next_markdown_max_pct, ppr.promotion_spend_amt
  • Sort Method: external sort Disk: 436640kB
3. 354.795 2,114.859 ↑ 389.4 2,303,599 1

Hash Left Join (cost=20.44..10,388,656.79 rows=896,958,000 width=545) (actual time=79.924..2,114.859 rows=2,303,599 loops=1)

  • Hash Cond: (pp.pricing_plan_id = par.pricing_plan_id)
4. 345.140 1,760.063 ↓ 1.0 2,303,599 1

Nested Loop Left Join (cost=0.44..292,253.30 rows=2,242,395 width=461) (actual time=79.915..1,760.063 rows=2,303,599 loops=1)

  • Join Filter: (pp.pricing_plan_id = pgpr.pricing_plan_id)
5. 0.002 0.071 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.44..25.56 rows=1 width=433) (actual time=0.051..0.071 rows=1 loops=1)

  • Join Filter: (pp.pricing_plan_id = pcm.pricing_plan_id)
6. 0.000 0.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.29..17.38 rows=1 width=333) (actual time=0.035..0.037 rows=1 loops=1)

  • Join Filter: (pp.pricing_plan_id = ppr.pricing_plan_id)
7. 0.001 0.029 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.14..9.20 rows=1 width=189) (actual time=0.027..0.029 rows=1 loops=1)

  • Join Filter: (pp.pricing_plan_id = pltm.pricing_plan_id)
8. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on pricing_plan pp (cost=0.00..1.02 rows=1 width=77) (actual time=0.016..0.018 rows=1 loops=1)

  • Filter: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)
  • Rows Removed by Filter: 1
9. 0.010 0.010 ↓ 0.0 0 1

Index Scan using plan_lead_time_metric_pk on plan_lead_time_metric pltm (cost=0.14..8.16 rows=1 width=128) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)
10. 0.008 0.008 ↓ 0.0 0 1

Index Scan using pricing_plan_result_pk on pricing_plan_result ppr (cost=0.15..8.17 rows=1 width=160) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)
11. 0.032 0.032 ↑ 1.0 1 1

Index Scan using plan_comparison_metric_pk on plan_comparison_metric pcm (cost=0.15..8.17 rows=1 width=116) (actual time=0.015..0.032 rows=1 loops=1)

  • Index Cond: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)
12. 1,414.852 1,414.852 ↓ 1.0 2,303,599 1

Seq Scan on prod_geo_period_result pgpr (cost=0.00..264,197.81 rows=2,242,395 width=44) (actual time=79.855..1,414.852 rows=2,303,599 loops=1)

  • Filter: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)
  • Rows Removed by Filter: 2794601
13. 0.001 0.001 ↓ 0.0 0 1

Hash (cost=15.00..15.00 rows=400 width=100) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
14. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on plan_actual_result par (cost=0.00..15.00 rows=400 width=100) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (pricing_plan_id = 'f150a1a1-2057-4fa2-9505-493068d91107'::uuid)