explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uMw

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 12,995.458 ↑ 1.0 1 1

HashAggregate (cost=13,313.47..13,313.48 rows=1 width=4) (actual time=12,995.458..12,995.458 rows=1 loops=1)

  • Group Key: max(DISTINCT condicaopagamentoplanofinanceirocurso.nrparcelasperiodo)
2. 6,363.692 12,995.452 ↑ 1.0 1 1

Aggregate (cost=13,313.46..13,313.47 rows=1 width=4) (actual time=12,995.452..12,995.452 rows=1 loops=1)

3. 3,675.823 6,631.760 ↓ 273.5 6,551,055 1

Merge Join (cost=8,518.75..13,253.59 rows=23,950 width=4) (actual time=314.092..6,631.760 rows=6,551,055 loops=1)

  • Merge Cond: (turma.indicereajuste = indicereajusteperiodo.indicereajuste)
4. 20.080 1,407.313 ↓ 40.1 8,913 1

Nested Loop (cost=8,452.40..37,887.64 rows=222 width=12) (actual time=313.365..1,407.313 rows=8,913 loops=1)

5. 29.912 1,298.103 ↓ 39.8 8,913 1

Nested Loop (cost=8,452.13..37,819.17 rows=224 width=16) (actual time=313.341..1,298.103 rows=8,913 loops=1)

6. 21.919 1,063.192 ↓ 39.8 8,913 1

Nested Loop (cost=8,451.71..37,680.49 rows=224 width=25) (actual time=313.293..1,063.192 rows=8,913 loops=1)

7. 22.366 967.001 ↓ 22.6 9,284 1

Nested Loop (cost=8,451.43..37,543.41 rows=411 width=25) (actual time=312.319..967.001 rows=9,284 loops=1)

  • Join Filter: (turma.indicereajuste = indicereajuste.codigo)
  • Rows Removed by Join Filter: 34792
8. 0.047 0.047 ↑ 1.0 2 1

Index Only Scan using indicereajuste_pkey on indicereajuste (cost=0.13..8.16 rows=2 width=4) (actual time=0.042..0.047 rows=2 loops=1)

  • Heap Fetches: 0
9. 34.041 944.588 ↓ 8.3 22,038 2

Materialize (cost=8,451.30..37,461.97 rows=2,665 width=21) (actual time=155.657..472.294 rows=22,038 loops=2)

10. 43.934 910.547 ↓ 8.3 22,038 1

Hash Join (cost=8,451.30..37,448.64 rows=2,665 width=21) (actual time=311.306..910.547 rows=22,038 loops=1)

  • Hash Cond: (matriculaperiodo.turma = turma.codigo)
11. 98.182 858.691 ↓ 8.3 22,038 1

Hash Join (cost=8,249.89..37,200.59 rows=2,665 width=21) (actual time=303.344..858.691 rows=22,038 loops=1)

  • Hash Cond: (contareceber.matriculaperiodo = matriculaperiodo.codigo)
12. 206.687 457.663 ↓ 8.2 22,038 1

Index Scan using idx_contareceber_sit_datavenc_tporigem_unidade on contareceber (cost=0.43..28,887.72 rows=2,674 width=4) (actual time=0.390..457.663 rows=22,038 loops=1)

  • Index Cond: (((tipoorigem)::text = 'MEN'::text) AND ((situacao)::text = 'AR'::text) AND (datavencimento >= '2019-08-20 00:00:00'::timestamp without time zone) AND (datavencimento <= '2019-08-20 00:00:00'::timestamp without time zone))
  • Filter: (NOT (SubPlan 1))
  • Rows Removed by Filter: 778
13.          

SubPlan (forIndex Scan)

14. 22.816 250.976 ↓ 0.0 0 22,816

Unique (cost=0.42..4.52 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=22,816)

15. 228.160 228.160 ↓ 0.0 0 22,816

Index Only Scan using idx_controleremessacontareceber_contareceber on controleremessacontareceber (cost=0.42..4.51 rows=5 width=4) (actual time=0.010..0.010 rows=0 loops=22,816)

  • Index Cond: (contareceber = contareceber.codigo)
  • Heap Fetches: 209
16. 114.629 302.846 ↓ 1.0 143,079 1

Hash (cost=6,461.98..6,461.98 rows=142,998 width=25) (actual time=302.846..302.846 rows=143,079 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 8087kB
17. 188.217 188.217 ↓ 1.0 143,079 1

Seq Scan on matriculaperiodo (cost=0.00..6,461.98 rows=142,998 width=25) (actual time=0.017..188.217 rows=143,079 loops=1)

18. 1.976 7.922 ↑ 1.0 4,374 1

Hash (cost=146.74..146.74 rows=4,374 width=8) (actual time=7.922..7.922 rows=4,374 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 157kB
19. 5.946 5.946 ↑ 1.0 4,374 1

Seq Scan on turma (cost=0.00..146.74 rows=4,374 width=8) (actual time=0.010..5.946 rows=4,374 loops=1)

20. 74.272 74.272 ↑ 1.0 1 9,284

Index Scan using pk_condicaopagamentoplanofinanceirocurso on condicaopagamentoplanofinanceirocurso (cost=0.29..0.32 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=9,284)

  • Index Cond: (codigo = matriculaperiodo.condicaopagamentoplanofinanceirocurso)
  • Filter: (nrparcelasperiodo > 12)
  • Rows Removed by Filter: 0
21. 204.999 204.999 ↑ 1.0 1 8,913

Index Scan using matricula_pkey on matricula (cost=0.42..0.61 rows=1 width=17) (actual time=0.022..0.023 rows=1 loops=8,913)

  • Index Cond: ((matricula)::text = (matriculaperiodo.matricula)::text)
22. 89.130 89.130 ↑ 1.0 1 8,913

Index Scan using curso_pkey on curso (cost=0.27..0.30 rows=1 width=4) (actual time=0.008..0.010 rows=1 loops=8,913)

  • Index Cond: (codigo = matricula.curso)
  • Filter: ((periodicidade)::text = 'IN'::text)
23. 1,548.208 1,548.624 ↓ 8,900.9 6,542,143 1

Sort (cost=66.34..68.18 rows=735 width=4) (actual time=0.723..1,548.624 rows=6,542,143 loops=1)

  • Sort Key: indicereajusteperiodo.indicereajuste
  • Sort Method: quicksort Memory: 59kB
24. 0.416 0.416 ↑ 1.0 735 1

Seq Scan on indicereajusteperiodo (cost=0.00..31.35 rows=735 width=4) (actual time=0.009..0.416 rows=735 loops=1)

Planning time : 11.055 ms
Execution time : 12,997.029 ms