explain.depesz.com

PostgreSQL's explain analyze made readable

Result: o7Rm : Optimization for: Optimization for: plan #0Mwg; plan #jVYP

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.812 3,187.202 ↑ 2.4 35 1

Subquery Scan on a (cost=1,000.61..493,161.44 rows=84 width=68) (actual time=173.809..3,187.202 rows=35 loops=1)

  • Functions: 37
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
  • Timing: Generation 9.124 ms, Inlining 0.000 ms, Optimization 1.938 ms, Emission 48.051 ms, Total 59.114 ms
2. 0.229 130.085 ↑ 2.4 35 1

Finalize GroupAggregate (cost=1,000.61..44,827.61 rows=84 width=36) (actual time=78.335..130.085 rows=35 loops=1)

  • Group Key: asp.id_grupo, asp.ano, asp.mes, asp.status_produto
3. 0.000 129.856 ↑ 2.5 137 1

Gather Merge (cost=1,000.61..44,822.57 rows=336 width=36) (actual time=77.912..129.856 rows=137 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 16.937 581.246 ↑ 3.1 27 5 / 5

Partial GroupAggregate (cost=0.56..43,782.49 rows=84 width=36) (actual time=20.101..581.246 rows=27 loops=5)

  • Group Key: asp.id_grupo, asp.ano, asp.mes, asp.status_produto
5. 564.309 564.309 ↑ 1.3 90,487 5 / 5

Parallel Index Only Scan using analise_status_produto_idx01 on analise_status_produto asp (cost=0.56..42,350.70 rows=114,476 width=28) (actual time=10.503..564.309 rows=90,487 loops=5)

  • Index Cond: (id_grupo = 1)
  • Filter: (status_produto <> 'SEM MOVIMENTO'::text)
  • Rows Removed by Filter: 343822
  • Heap Fetches: 0
6.          

SubPlan (for Subquery Scan)

7. 210.280 3,056.305 ↑ 1.0 1 35

Aggregate (cost=5,337.28..5,337.29 rows=1 width=8) (actual time=87.323..87.323 rows=1 loops=35)

8. 2,846.025 2,846.025 ↓ 2.0 64,634 35

Index Only Scan using analise_status_produto_idx01 on analise_status_produto asp_1 (cost=0.56..5,255.51 rows=32,708 width=0) (actual time=0.051..81.315 rows=64,634 loops=35)

  • Index Cond: ((id_grupo = 1) AND (ano = a.ano) AND (mes = a.mes))
  • Filter: (status_produto <> 'SEM MOVIMENTO'::text)
  • Rows Removed by Filter: 245587
  • Heap Fetches: 0
Execution time : 3,191.061 ms