explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QbGh

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 223.043 ↑ 1.0 1 1

Aggregate (cost=16,402.18..16,402.19 rows=1 width=8) (actual time=223.042..223.043 rows=1 loops=1)

  • Buffers: shared hit=71634
2. 27.903 239.148 ↓ 1.0 427 1

Gather (cost=9,750.80..16,401.12 rows=425 width=16) (actual time=33.241..239.148 rows=427 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
  • Buffers: shared hit=71634
3. 3.304 211.245 ↑ 1.2 142 3 / 3

Nested Loop (cost=8,750.80..15,358.62 rows=177 width=16) (actual time=35.966..211.245 rows=142 loops=3)

  • Buffers: shared hit=71634
4. 4.171 199.378 ↓ 1.0 1,713 3 / 3

Nested Loop (cost=8,750.52..14,796.61 rows=1,701 width=4) (actual time=34.192..199.378 rows=1,713 loops=3)

  • Buffers: shared hit=60927
5. 35.780 159.241 ↓ 1.0 1,713 3 / 3

Hash Join (cost=8,750.10..13,766.30 rows=1,672 width=14) (actual time=34.120..159.241 rows=1,713 loops=3)

  • Hash Cond: (matricula2_.unidadeensino = unidadeens3_.codigo)
  • Join Filter: ((pessoasei5_.codigo = 556882) OR (unidadeens3_.codigo = ANY ('{2,56}'::integer[])))
  • Rows Removed by Join Filter: 49803
  • Buffers: shared hit=40325
6. 64.220 123.196 ↑ 1.2 51,516 3 / 3

Hash Left Join (cost=8,739.84..13,586.77 rows=64,349 width=22) (actual time=33.488..123.196 rows=51,516 loops=3)

  • Hash Cond: (matricula2_.consultor = funcionari4_.codigo)
  • Buffers: shared hit=40130
7. 25.533 25.533 ↑ 1.2 51,516 3 / 3

Parallel Seq Scan on matricula matricula2_ (cost=0.00..4,204.49 rows=64,349 width=22) (actual time=0.016..25.533 rows=51,516 loops=3)

  • Buffers: shared hit=3561
8. 2.242 33.443 ↑ 1.0 3,831 3 / 3

Hash (cost=8,691.95..8,691.95 rows=3,831 width=8) (actual time=33.443..33.443 rows=3,831 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 182kB
  • Buffers: shared hit=36569
9. 6.927 31.201 ↑ 1.0 3,831 3 / 3

Nested Loop Left Join (cost=0.42..8,691.95 rows=3,831 width=8) (actual time=0.077..31.201 rows=3,831 loops=3)

  • Buffers: shared hit=36569
10. 1.288 1.288 ↑ 1.0 3,831 3 / 3

Seq Scan on funcionario funcionari4_ (cost=0.00..74.31 rows=3,831 width=8) (actual time=0.021..1.288 rows=3,831 loops=3)

  • Buffers: shared hit=108
11. 22.986 22.986 ↑ 1.0 1 11,493 / 3

Index Only Scan using pessoa_pkey on pessoa pessoasei5_ (cost=0.42..2.25 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=11,493)

  • Index Cond: (codigo = funcionari4_.pessoa)
  • Heap Fetches: 1959
  • Buffers: shared hit=36461
12. 0.039 0.265 ↑ 1.0 77 3 / 3

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=107
13. 0.226 0.226 ↑ 1.0 77 3 / 3

Index Only Scan using unidadeensino_pkey on unidadeensino unidadeens3_ (cost=0.14..9.30 rows=77 width=4) (actual time=0.056..0.226 rows=77 loops=3)

  • Heap Fetches: 105
  • Buffers: shared hit=107
14. 35.966 35.966 ↑ 1.0 1 5,138 / 3

Index Scan using ch_matriculaperiodo_matricula on matriculaperiodo matriculap1_ (cost=0.42..0.61 rows=1 width=22) (actual time=0.021..0.021 rows=1 loops=5,138)

  • Index Cond: ((matricula)::text = (matricula2_.matricula)::text)
  • Buffers: shared hit=20602
15. 8.563 8.563 ↓ 0.0 0 5,138 / 3

Index Scan using idx_bd_tb_gestao_contrato_matricula_periodo on tb_gestao_contrato contrato0_ (cost=0.29..0.32 rows=1 width=20) (actual time=0.005..0.005 rows=0 loops=5,138)

  • Index Cond: (matricula_periodo = matriculap1_.codigo)
  • Filter: (status = 1)
  • Buffers: shared hit=10707
Planning time : 3.242 ms
Execution time : 239.805 ms