explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ejOQ : Optimization for: plan #ZNIR

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.017 2,828.676 ↑ 1.0 1 1

Aggregate (cost=4,978,458.36..4,978,458.37 rows=1 width=8) (actual time=2,828.675..2,828.676 rows=1 loops=1)

  • Functions: 24
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 6.202 ms, Inlining 10.778 ms, Optimization 346.972 ms, Emission 210.589 ms, Total 574.541 ms
2. 787.466 2,828.659 ↓ 0.0 0 1

Index Scan using consumer_pkey on consumer (cost=0.42..4,978,440.13 rows=1,458 width=924) (actual time=2,828.659..2,828.659 rows=0 loops=1)

  • Filter: (((SubPlan 1))::text ~~ 'B%'::text)
  • Rows Removed by Filter: 291,599
3.          

SubPlan (for Index Scan)

4. 291.599 2,041.193 ↑ 1.0 1 291,599

Nested Loop (cost=0.71..16.89 rows=1 width=32) (actual time=0.006..0.007 rows=1 loops=291,599)

5. 291.599 1,457.995 ↑ 1.0 1 291,599

Nested Loop (cost=0.56..16.63 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=291,599)

6. 583.198 583.198 ↑ 1.0 1 291,599

Index Scan using installation_point_pkey on installation_point (cost=0.29..8.30 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=291,599)

  • Index Cond: (id = consumer.installation_point_id)
7. 583.198 583.198 ↑ 1.0 1 291,599

Index Scan using feeder_pkey on feeder (cost=0.27..8.29 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=291,599)

  • Index Cond: (id = installation_point.feeder_id)
8. 291.599 291.599 ↑ 1.0 1 291,599

Index Scan using substation_pkey on substation (cost=0.15..0.26 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=291,599)

  • Index Cond: (id = feeder.substation_id)
Execution time : 2,835.045 ms