explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4V8B

Settings
# exclusive inclusive rows x rows loops node
1. 373.527 19,189.426 ↓ 1.0 1,690 1

GroupAggregate (cost=0.28..169,136.90 rows=1,687 width=532) (actual time=21.201..19,189.426 rows=1,690 loops=1)

  • Group Key: dgp_deal_unit.id
2. 18,231.941 18,815.899 ↓ 1.1 26,535 1

Nested Loop (cost=0.28..168,739.94 rows=24,496 width=536) (actual time=8.437..18,815.899 rows=26,535 loops=1)

  • Join Filter: (((dgp_deal_unit."productLevelValue")::text = (dgp_product.name)::text) OR ((dgp_deal_unit."productLevelValue")::text = (dgp_product.hierarchy ->> (("substring"((dgp_deal_unit."productLevelKey")::text, '.$'::text))::integer - 1))))
  • Rows Removed by Join Filter: 5596095
3. 9.358 9.358 ↓ 1.0 1,690 1

Index Scan using dgp_deal_unit_pkey on dgp_deal_unit (cost=0.28..184.88 rows=1,687 width=436) (actual time=0.021..9.358 rows=1,690 loops=1)

  • Filter: (("productLevelValue")::text <> 'Total'::text)
  • Rows Removed by Filter: 247
4. 573.137 574.600 ↑ 1.0 3,327 1,690

Materialize (cost=0.00..183.91 rows=3,327 width=100) (actual time=0.000..0.340 rows=3,327 loops=1,690)

5. 1.463 1.463 ↑ 1.0 3,327 1

Seq Scan on dgp_product (cost=0.00..167.27 rows=3,327 width=100) (actual time=0.008..1.463 rows=3,327 loops=1)

Planning time : 0.320 ms
Execution time : 19,190.641 ms