explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xVye

Settings
# exclusive inclusive rows x rows loops node
1. 33.958 1,255,952.647 ↑ 1.0 1 1

Aggregate (cost=367,561.02..367,561.03 rows=1 width=8) (actual time=1,255,952.647..1,255,952.647 rows=1 loops=1)

2. 174.523 1,255,918.689 ↓ 30,562.0 30,562 1

Nested Loop Semi Join (cost=2.45..367,561.02 rows=1 width=8) (actual time=395.299..1,255,918.689 rows=30,562 loops=1)

3. 642.782 1,255,092.596 ↓ 43,438.0 43,438 1

Nested Loop Semi Join (cost=2.02..367,560.47 rows=1 width=12) (actual time=395.183..1,255,092.596 rows=43,438 loops=1)

4. 157,992.587 1,252,382.714 ↓ 516,775.0 516,775 1

Nested Loop (cost=1.74..367,560.15 rows=1 width=16) (actual time=4.643..1,252,382.714 rows=516,775 loops=1)

  • Join Filter: (vav.codareavara = av.cod_area)
  • Rows Removed by Join Filter: 1850054500
5. 211,845.638 941,941.502 ↓ 516,775.0 516,775 1

Nested Loop (cost=1.74..367,479.29 rows=1 width=16) (actual time=4.043..941,941.502 rows=516,775 loops=1)

  • Join Filter: (v.cod_vara = vav.codvara)
  • Rows Removed by Join Filter: 2569922075
6. 167,373.857 552,325.264 ↓ 516,775.0 516,775 1

Nested Loop (cost=1.74..367,367.26 rows=1 width=20) (actual time=3.468..552,325.264 rows=516,775 loops=1)

  • Join Filter: (distrant.codvara = v.cod_vara)
  • Rows Removed by Join Filter: 2394735350
7. 574.373 52,148.307 ↓ 516,775.0 516,775 1

Nested Loop (cost=1.74..367,261.95 rows=1 width=16) (actual time=1.869..52,148.307 rows=516,775 loops=1)

8. 449.993 44,339.084 ↓ 516,775.0 516,775 1

Nested Loop (cost=1.30..367,261.49 rows=1 width=32) (actual time=1.844..44,339.084 rows=516,775 loops=1)

9. 667.678 24,698.375 ↓ 8.6 518,668 1

Nested Loop (cost=0.87..310,018.04 rows=60,416 width=32) (actual time=1.695..24,698.375 rows=518,668 loops=1)

10. 10,547.669 10,547.669 ↓ 1.4 518,578 1

Index Scan using idx_suporte_distribuicao_processo_data on distribuicao_processo dp (cost=0.43..121,176.10 rows=383,961 width=28) (actual time=0.521..10,547.669 rows=518,578 loops=1)

  • Index Cond: ((datadistribuicao >= '2016-01-01 00:00:00'::timestamp without time zone) AND (datadistribuicao <= '2018-12-31 23:59:59'::timestamp without time zone))
  • Filter: ((codvara IS NOT NULL) AND (tipodistribuicao = ANY ('{5,6,7,8,9}'::integer[])))
  • Rows Removed by Filter: 4088609
11. 13,483.028 13,483.028 ↑ 1.0 1 518,578

Index Scan using idx683_fk_historico_processo_classe_processo on historico_processo_classe hpc (cost=0.43..0.48 rows=1 width=28) (actual time=0.024..0.026 rows=1 loops=518,578)

  • Index Cond: (numeroprocesso = dp.numeroprocesso)
  • Filter: ((dp.datadistribuicao >= datainicio) AND (dp.datadistribuicao <= COALESCE(datafim, '2018-12-31 23:59:59'::timestamp without time zone)))
  • Rows Removed by Filter: 1
12. 12,148.740 19,190.716 ↑ 1.0 1 518,668

Index Scan using idx620_fk_processo_distribuicao on distribuicao_processo distrant (cost=0.43..0.94 rows=1 width=20) (actual time=0.030..0.037 rows=1 loops=518,668)

  • Index Cond: (numeroprocesso = dp.numeroprocesso)
  • Filter: ((codvara IS NOT NULL) AND (dp.codvara <> codvara) AND ((SubPlan 1) = coddistribuicaoprocesso))
  • Rows Removed by Filter: 2
13.          

SubPlan (for Index Scan)

14. 880.247 7,041.976 ↑ 1.0 1 880,247

Aggregate (cost=0.47..0.48 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=880,247)

15. 6,161.729 6,161.729 ↓ 2.0 2 880,247

Index Scan using idx620_fk_processo_distribuicao on distribuicao_processo dp2 (cost=0.43..0.47 rows=1 width=8) (actual time=0.003..0.007 rows=2 loops=880,247)

  • Index Cond: (numeroprocesso = dp.numeroprocesso)
  • Filter: (coddistribuicaoprocesso < dp.coddistribuicaoprocesso)
  • Rows Removed by Filter: 2
16. 7,234.850 7,234.850 ↑ 1.0 1 516,775

Index Only Scan using processo_pkey on processo p (cost=0.43..0.45 rows=1 width=8) (actual time=0.013..0.014 rows=1 loops=516,775)

  • Index Cond: (numeroprocesso = dp.numeroprocesso)
  • Heap Fetches: 116560
17. 332,803.100 332,803.100 ↑ 1.0 4,635 516,775

Seq Scan on vara v (cost=0.00..47.38 rows=4,635 width=4) (actual time=0.002..0.644 rows=4,635 loops=516,775)

18. 177,770.600 177,770.600 ↑ 1.0 4,974 516,775

Seq Scan on vara_area vav (cost=0.00..49.86 rows=4,974 width=8) (actual time=0.004..0.344 rows=4,974 loops=516,775)

19. 152,448.625 152,448.625 ↑ 1.0 3,581 516,775

Seq Scan on areadevaras av (cost=0.00..36.09 rows=3,581 width=8) (actual time=0.002..0.295 rows=3,581 loops=516,775)

20. 2,067.100 2,067.100 ↓ 0.0 0 516,775

Index Only Scan using pk_indicador_competencia on indicador_competencia _ic (cost=0.28..0.30 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=516,775)

  • Index Cond: ((codindicador = 77) AND (tipocompetencia = av.tipocompetencia))
  • Heap Fetches: 0
21. 130.314 651.570 ↑ 1.0 1 43,438

Nested Loop (cost=0.43..0.49 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=43,438)

22. 217.190 217.190 ↑ 1.0 1 43,438

Index Only Scan using pk_indicador_grupo on indicador_grupo _ig (cost=0.14..0.17 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=43,438)

  • Index Cond: (codindicador = 77)
  • Heap Fetches: 0
23. 304.066 304.066 ↑ 1.0 1 43,438

Index Only Scan using uk_grupo_classe_classe on grupo_classe_classe_processual _gccp (cost=0.28..0.31 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=43,438)

  • Index Cond: ((codgrupoclasse = _ig.codgrupoclasse) AND (codclasse = hpc.codclasseprocessual))
  • Heap Fetches: 0
Planning time : 9.322 ms
Execution time : 1,255,953.106 ms