explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0Mwg

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.725 27,055.600 ↑ 2.4 35 1

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

  • Functions: 45
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 11.343 ms, Inlining 509.867 ms, Optimization 536.635 ms, Emission 416.037 ms, Total 1473.883 ms
2. 0.169 775.685 ↑ 2.4 35 1

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

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

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

  • Workers Planned: 4
  • Workers Launched: 4
4. 0.138 732.788 ↑ 2.4 35 5 / 5

Sort (cost=46,537.25..46,537.46 rows=84 width=36) (actual time=732.772..732.788 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.608 732.650 ↑ 2.4 35 5 / 5

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

  • Group Key: asp.id_grupo, asp.ano, asp.mes, asp.status_produto
6. 696.042 696.042 ↑ 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=323.631..696.042 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. 227.815 26,279.190 ↑ 1.0 1 35

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

9. 26,051.375 26,051.375 ↓ 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.497..744.325 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,108.161 ms