explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hKOZ : teste

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 21,896.330 ↑ 1.0 1 1

Aggregate (cost=56,389.12..56,389.13 rows=1 width=8) (actual time=21,896.330..21,896.330 rows=1 loops=1)

2. 35.587 21,896.315 ↓ 5.0 5 1

Nested Loop Left Join (cost=0.00..56,389.12 rows=1 width=8) (actual time=18,586.245..21,896.315 rows=5 loops=1)

  • Filter: (((SubPlan 1) AND ((pfv.* IS NULL) OR (NOT (SubPlan 2))) AND (ac.alteracao >= '2020-02-26 00:00:00'::timestamp without time zone) AND (ac.alteracao <= '2020-03-26 00:00:00'::timestamp without time zone)) OR ((NOT (SubPlan 3)) AND (pfv.id_pr (...)
  • Rows Removed by Filter: 18590
3. 7.804 21,654.348 ↓ 642.3 11,562 1

Nested Loop Left Join (cost=0.00..55,831.25 rows=18 width=44) (actual time=29.173..21,654.348 rows=11,562 loops=1)

  • Join Filter: (ac.id_evento = evento.id_evento)
  • Rows Removed by Join Filter: 29
4. 4.804 21,611.858 ↓ 642.3 11,562 1

Nested Loop (cost=0.00..55,804.69 rows=18 width=36) (actual time=29.156..21,611.858 rows=11,562 loops=1)

5. 9.979 21,583.930 ↓ 642.3 11,562 1

Nested Loop (cost=0.00..55,798.92 rows=18 width=36) (actual time=29.131..21,583.930 rows=11,562 loops=1)

6. 12.071 21,550.827 ↓ 642.3 11,562 1

Nested Loop (cost=0.00..55,793.32 rows=18 width=36) (actual time=29.103..21,550.827 rows=11,562 loops=1)

7. 3.853 21,515.632 ↓ 642.3 11,562 1

Nested Loop (cost=0.00..55,760.42 rows=18 width=32) (actual time=29.087..21,515.632 rows=11,562 loops=1)

  • Join Filter: (evento_participante.id_evento = c.id_evento)
8. 12.053 21,477.093 ↓ 642.3 11,562 1

Nested Loop Left Join (cost=0.00..55,738.40 rows=18 width=32) (actual time=29.064..21,477.093 rows=11,562 loops=1)

9. 276.479 21,418.792 ↓ 642.3 11,562 1

Nested Loop (cost=0.00..55,706.76 rows=18 width=32) (actual time=29.046..21,418.792 rows=11,562 loops=1)

10. 1,616.160 5,407.877 ↓ 747.8 7,867,218 1

Nested Loop (cost=0.00..42,976.26 rows=10,521 width=28) (actual time=0.079..5,407.877 rows=7,867,218 loops=1)

  • Join Filter: ((evento.inicio >= colaborador.admissao) AND (evento.inicio <= COALESCE((colaborador.rescisao)::timestamp without time zone, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 9305
11. 0.039 0.145 ↑ 1.0 1 1

Nested Loop (cost=0.00..17.79 rows=1 width=12) (actual time=0.044..0.145 rows=1 loops=1)

  • Join Filter: (colaborador.id_tipo_contrato = tipo_contrato.id_tipo_contrato)
  • Rows Removed by Join Filter: 5
12. 0.011 0.074 ↓ 2.0 2 1

Nested Loop (cost=0.00..16.65 rows=1 width=16) (actual time=0.033..0.074 rows=2 loops=1)

13. 0.030 0.030 ↑ 1.0 1 1

Index Only Scan using pk_pessoa on pessoa (cost=0.00..8.37 rows=1 width=4) (actual time=0.020..0.030 rows=1 loops=1)

  • Index Cond: (id_pessoa = 73380)
  • Heap Fetches: 1
14. 0.033 0.033 ↓ 2.0 2 1

Index Scan using ix_pessoa_pa_colaborador on colaborador (cost=0.00..8.28 rows=1 width=16) (actual time=0.010..0.033 rows=2 loops=1)

  • Index Cond: (id_pessoa = 73380)
15. 0.032 0.032 ↑ 1.0 3 2

Seq Scan on tipo_contrato (cost=0.00..1.10 rows=3 width=4) (actual time=0.005..0.016 rows=3 loops=2)

  • Filter: ((nome)::text = ANY ('{Mensalista,Professor,Estagiário}'::text[]))
  • Rows Removed by Filter: 4
16. 1,668.056 3,791.572 ↓ 35.7 7,876,523 1

Nested Loop (cost=0.00..39,092.12 rows=220,935 width=24) (actual time=0.030..3,791.572 rows=7,876,523 loops=1)

17. 0.039 0.039 ↑ 1.0 1 1

Seq Scan on tipo_evento (cost=0.00..1.45 rows=1 width=4) (actual time=0.007..0.039 rows=1 loops=1)

  • Filter: ((nome)::text = 'Aula'::text)
  • Rows Removed by Filter: 35
18. 2,123.477 2,123.477 ↓ 17.8 7,876,523 1

Index Scan using ix_tipo_evento_pa_evento on evento (cost=0.00..34,671.96 rows=441,871 width=32) (actual time=0.022..2,123.477 rows=7,876,523 loops=1)

  • Index Cond: (id_tipo_evento = tipo_evento.id_tipo_evento)
19. 15,734.436 15,734.436 ↓ 0.0 0 7,867,218

Index Scan using ix_evento_id_evento_participante on evento_participante (cost=0.00..1.20 rows=1 width=12) (actual time=0.002..0.002 rows=0 loops=7,867,218)

  • Index Cond: (id_evento = evento.id_evento)
  • Filter: (id_pessoa = 73380)
  • Rows Removed by Filter: 1
20. 7.114 46.248 ↑ 1.0 1 11,562

Nested Loop (cost=0.00..1.75 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=11,562)

21. 23.124 23.124 ↑ 1.0 1 11,562

Index Scan using idx_repeticoes_id_evento on repeticoes (cost=0.00..1.18 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=11,562)

  • Index Cond: (id_evento = evento.id_evento)
22. 16.010 16.010 ↑ 1.0 1 8,005

Index Only Scan using pk_repeticao on repeticao (cost=0.00..0.55 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=8,005)

  • Index Cond: (id_repeticao = repeticoes.id_repeticao)
  • Heap Fetches: 8005
23. 34.686 34.686 ↑ 1.0 1 11,562

Index Scan using ix_evento_id_calendario_especifico on calendario c (cost=0.00..1.21 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=11,562)

  • Index Cond: (id_evento = evento.id_evento)
24. 23.124 23.124 ↑ 1.0 1 11,562

Index Scan using pk_aula on aula a (cost=0.00..1.82 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=11,562)

  • Index Cond: (id_aula = c.id_aula)
25. 23.124 23.124 ↑ 1.0 1 11,562

Index Scan using ix_diario_id_diario on diario di (cost=0.00..0.30 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=11,562)

  • Index Cond: (id_diario = a.id_diario)
26. 23.124 23.124 ↑ 1.0 1 11,562

Index Only Scan using pk_turma on turma tu (cost=0.00..0.31 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=11,562)

  • Index Cond: (id_turma = di.id_turma)
  • Heap Fetches: 11562
27. 34.686 34.686 ↑ 1.0 1 11,562

Index Scan using ix_aula_calend_id_aula_conf on aula_confirmacao ac (cost=0.00..1.46 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=11,562)

  • Index Cond: (id_aula = a.id_aula)
28. 23.124 23.124 ↓ 2.0 2 11,562

Index Scan using ix_turma_pa_proj_finan on projeto_financeiro_vigencia pfv (cost=0.00..0.37 rows=1 width=138) (actual time=0.002..0.002 rows=2 loops=11,562)

  • Index Cond: (id_turma = tu.id_turma)
29.          

SubPlan (for Nested Loop Left Join)

30. 37.190 37.190 ↑ 1.0 1 18,595

Index Scan using ix_evento_id_evento_confirmacao on evento_confirmacao (cost=0.00..9.09 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=18,595)

  • Index Cond: (id_evento = evento.id_evento)
  • Filter: confirmado
31. 16.646 108.876 ↑ 1.0 1 18,146

Nested Loop (cost=0.00..24.84 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=18,146)

32. 16.646 72.584 ↑ 1.0 1 18,146

Nested Loop (cost=0.00..16.56 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=18,146)

33. 36.292 36.292 ↑ 1.0 1 18,146

Index Scan using ix_turma_pa_proj_finan on projeto_financeiro_vigencia pfv2 (cost=0.00..8.28 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=18,146)

  • Index Cond: (id_turma = tu.id_turma)
  • Filter: ((ac.alteracao >= inicio) AND (((termino IS NOT NULL) AND (ac.alteracao <= termino)) OR (pfv.termino IS NULL)))
  • Rows Removed by Filter: 1
34. 19.646 19.646 ↑ 1.0 1 19,646

Index Only Scan using pk_projeto_financeiro on projeto_financeiro pf2 (cost=0.00..8.27 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=19,646)

  • Index Cond: (id_projeto_financeiro = pfv2.id_projeto_financeiro)
  • Heap Fetches: 19646
35. 19.646 19.646 ↑ 1.0 1 19,646

Index Only Scan using pk_centro_responsabilidade on centro_responsabilidade cr2 (cost=0.00..8.27 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=19,646)

  • Index Cond: (id_centro_responsabilidade = pfv2.id_centro_responsabilidade)
  • Heap Fetches: 19646
36. 37.190 37.190 ↑ 1.0 1 18,595

Index Scan using ix_evento_id_evento_confirmacao on evento_confirmacao (cost=0.00..9.09 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=18,595)

  • Index Cond: (id_evento = evento.id_evento)
  • Filter: confirmado
Total runtime : 21,896.820 ms