explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jVYP : Optimization for: plan #0Mwg

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.721 27,020.284 ↑ 2.4 35 1

Subquery Scan on a (cost=47,537.31..6,465,225.21 rows=84 width=68) (actual time=1,524.732..27,020.284 rows=35 loops=1)

  • Functions: 45
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 11.747 ms, Inlining 422.033 ms, Optimization 556.674 ms, Emission 422.679 ms, Total 1413.133 ms
2. 0.163 774.253 ↑ 2.4 35 1

Finalize GroupAggregate (cost=47,537.31..47,582.58 rows=84 width=36) (actual time=773.407..774.253 rows=35 loops=1)

  • Group Key: asp.id_grupo, asp.ano, asp.mes, asp.status_produto
3. 46.283 774.090 ↑ 1.9 175 1

Gather Merge (cost=47,537.31..47,577.54 rows=336 width=36) (actual time=773.379..774.090 rows=175 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 0.128 727.807 ↑ 2.4 35 5 / 5

Sort (cost=46,537.25..46,537.46 rows=84 width=36) (actual time=727.793..727.807 rows=35 loops=5)

  • Sort Key: asp.ano, asp.mes, asp.status_produto
  • Sort Method: quicksort Memory: 27kB
  • Worker 0: Sort Method: quicksort Memory: 27kB
  • Worker 1: Sort Method: quicksort Memory: 27kB
  • Worker 2: Sort Method: quicksort Memory: 27kB
  • Worker 3: Sort Method: quicksort Memory: 27kB
5. 36.440 727.679 ↑ 2.4 35 5 / 5

Partial HashAggregate (cost=46,533.72..46,534.56 rows=84 width=36) (actual time=727.669..727.679 rows=35 loops=5)

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

Parallel Index Only Scan using analise_status_produto_id_grupo_idx on analise_status_produto asp (cost=0.43..45,102.77 rows=114,476 width=28) (actual time=313.821..691.239 rows=90,487 loops=5)

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

SubPlan (for Subquery Scan)

8. 222.565 26,245.310 ↑ 1.0 1 35

Aggregate (cost=76,400.47..76,400.48 rows=1 width=8) (actual time=749.866..749.866 rows=1 loops=35)

9. 26,022.745 26,022.745 ↓ 2.0 64,634 35

Index Only Scan using analise_status_produto_id_grupo_idx on analise_status_produto asp_1 (cost=0.43..76,318.70 rows=32,708 width=0) (actual time=31.480..743.507 rows=64,634 loops=35)

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