explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ypJc

Settings
# exclusive inclusive rows x rows loops node
1. 0.028 243.874 ↑ 1.0 1 1

Aggregate (cost=26,980.06..26,980.07 rows=1 width=8) (actual time=243.874..243.874 rows=1 loops=1)

2. 0.005 243.846 ↓ 4.0 4 1

Nested Loop (cost=17,919.28..26,980.06 rows=1 width=16) (actual time=226.266..243.846 rows=4 loops=1)

3. 0.044 243.817 ↓ 4.0 4 1

Nested Loop (cost=17,919.00..26,971.74 rows=1 width=32) (actual time=226.252..243.817 rows=4 loops=1)

4. 0.000 243.757 ↓ 4.0 4 1

Nested Loop (cost=17,918.72..26,971.45 rows=1 width=36) (actual time=226.203..243.757 rows=4 loops=1)

5. 31.646 250.313 ↓ 4.0 4 1

Gather (cost=17,918.44..26,971.15 rows=1 width=36) (actual time=226.186..250.313 rows=4 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 2.418 218.667 ↑ 1.0 1 3 / 3

Hash Join (cost=16,918.44..25,971.05 rows=1 width=36) (actual time=216.905..218.667 rows=1 loops=3)

  • Hash Cond: (contrato0_.id = assinatura10_.id_contrato)
7. 4.329 216.162 ↑ 1.3 6,981 3 / 3

Hash Join (cost=16,905.56..25,925.36 rows=8,746 width=20) (actual time=104.815..216.162 rows=6,981 loops=3)

  • Hash Cond: (matricula3_.unidadeensino = unidadeens5_.codigo)
8. 9.531 211.648 ↑ 1.3 6,981 3 / 3

Nested Loop (cost=16,895.30..25,890.87 rows=8,746 width=24) (actual time=104.587..211.648 rows=6,981 loops=3)

9. 3.979 174.194 ↑ 1.3 6,981 3 / 3

Hash Join (cost=16,894.88..21,655.33 rows=8,746 width=28) (actual time=104.556..174.194 rows=6,981 loops=3)

  • Hash Cond: (contrato0_.id_contrato_sei = textopadra1_.codigo)
10. 5.393 170.107 ↑ 1.3 6,981 3 / 3

Hash Join (cost=16,885.80..21,621.27 rows=8,746 width=32) (actual time=104.427..170.107 rows=6,981 loops=3)

  • Hash Cond: (matricula3_.consultor = funcionari6_.codigo)
11. 39.526 144.985 ↑ 1.3 6,987 3 / 3

Parallel Hash Join (cost=8,027.65..12,674.75 rows=8,746 width=36) (actual time=84.663..144.985 rows=6,987 loops=3)

  • Hash Cond: ((matricula3_.matricula)::text = (matriculap2_.matricula)::text)
12. 21.068 21.068 ↑ 1.2 52,794 3 / 3

Parallel Seq Scan on matricula matricula3_ (cost=0.00..4,363.39 rows=65,939 width=26) (actual time=0.022..21.068 rows=52,794 loops=3)

13. 4.490 84.391 ↑ 1.3 6,987 3 / 3

Parallel Hash (cost=7,918.33..7,918.33 rows=8,746 width=38) (actual time=84.391..84.391 rows=6,987 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,952kB
14. 33.449 79.901 ↑ 1.3 6,987 3 / 3

Hash Join (cost=1,286.57..7,918.33 rows=8,746 width=38) (actual time=29.044..79.901 rows=6,987 loops=3)

  • Hash Cond: (matriculap2_.codigo = contrato0_.matricula_periodo)
15. 17.529 17.529 ↑ 1.2 53,814 3 / 3

Parallel Seq Scan on matriculaperiodo matriculap2_ (cost=0.00..5,704.13 rows=67,213 width=22) (actual time=0.011..17.529 rows=53,814 loops=3)

16. 9.435 28.923 ↑ 1.0 20,990 3 / 3

Hash (cost=1,024.19..1,024.19 rows=20,990 width=24) (actual time=28.923..28.923 rows=20,990 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,404kB
17. 19.488 19.488 ↑ 1.0 20,990 3 / 3

Seq Scan on tb_gestao_contrato contrato0_ (cost=0.00..1,024.19 rows=20,990 width=24) (actual time=0.016..19.488 rows=20,990 loops=3)

  • Filter: (((gestao_contrato_status)::text <> 'FALHA_GERACAO'::text) AND (status = 1))
  • Rows Removed by Filter: 23
18. 1.406 19.729 ↑ 1.0 3,916 3 / 3

Hash (cost=8,809.20..8,809.20 rows=3,916 width=4) (actual time=19.729..19.729 rows=3,916 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 170kB
19. 1.684 18.323 ↑ 1.0 3,916 3 / 3

Nested Loop (cost=0.42..8,809.20 rows=3,916 width=4) (actual time=0.058..18.323 rows=3,916 loops=3)

20. 0.975 0.975 ↑ 1.0 3,916 3 / 3

Seq Scan on funcionario funcionari6_ (cost=0.00..78.16 rows=3,916 width=8) (actual time=0.019..0.975 rows=3,916 loops=3)

21. 15.664 15.664 ↑ 1.0 1 11,748 / 3

Index Only Scan using pessoa_pkey on pessoa pessoasei7_ (cost=0.42..2.23 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=11,748)

  • Index Cond: (codigo = funcionari6_.pessoa)
  • Heap Fetches: 1,860
22. 0.021 0.108 ↑ 1.0 48 3 / 3

Hash (cost=8.48..8.48 rows=48 width=4) (actual time=0.108..0.108 rows=48 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
23. 0.087 0.087 ↑ 1.0 48 3 / 3

Seq Scan on textopadrao textopadra1_ (cost=0.00..8.48 rows=48 width=4) (actual time=0.032..0.087 rows=48 loops=3)

24. 27.923 27.923 ↑ 1.0 1 20,942 / 3

Index Only Scan using pessoa_pkey on pessoa pessoasei4_ (cost=0.42..0.48 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=20,942)

  • Index Cond: (codigo = matricula3_.aluno)
  • Heap Fetches: 3,723
25. 0.023 0.185 ↑ 1.0 77 3 / 3

Hash (cost=9.30..9.30 rows=77 width=4) (actual time=0.185..0.185 rows=77 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
26. 0.162 0.162 ↑ 1.0 77 3 / 3

Index Only Scan using unidadeensino_pkey on unidadeensino unidadeens5_ (cost=0.14..9.30 rows=77 width=4) (actual time=0.031..0.162 rows=77 loops=3)

  • Heap Fetches: 90
27. 0.007 0.087 ↓ 4.0 4 3 / 3

Hash (cost=12.87..12.87 rows=1 width=32) (actual time=0.087..0.087 rows=4 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
28. 0.080 0.080 ↓ 4.0 4 3 / 3

Index Scan using idx_bd_tb_contrato_assinatura_tipo_is_usuario on tb_contrato_assinatura assinatura10_ (cost=0.42..12.87 rows=1 width=32) (actual time=0.053..0.080 rows=4 loops=3)

  • Index Cond: (((tipo)::text = ANY ('{ALUNO,EMPRESA}'::text[])) AND (is_usuario = '09ec9ec9-6ede-4147-8a2e-4bfcca971891'::uuid))
29. 0.020 0.020 ↑ 1.0 1 4

Index Scan using turma_pkey on turma turma8_ (cost=0.28..0.30 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=4)

  • Index Cond: (codigo = matriculap2_.turma)
30. 0.016 0.016 ↑ 1.0 1 4

Index Only Scan using curso_pkey on curso curso9_ (cost=0.27..0.29 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=4)

  • Index Cond: (codigo = turma8_.curso)
  • Heap Fetches: 0
31. 0.024 0.024 ↑ 1.0 1 4

Index Only Scan using tb_usuario_pkey on tb_usuario usuario11_ (cost=0.29..8.30 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=4)

  • Index Cond: (id = '09ec9ec9-6ede-4147-8a2e-4bfcca971891'::uuid)
  • Heap Fetches: 0
Planning time : 6.655 ms
Execution time : 250.672 ms