explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wLPR : vcontasareceber

Settings
# exclusive inclusive rows x rows loops node
1. 217.681 1,700.888 ↑ 1.0 205,639 1

WindowAgg (cost=177,830.57..186,056.13 rows=205,639 width=484) (actual time=1,473.916..1,700.888 rows=205,639 loops=1)

2.          

CTE contas

3. 74.675 788.577 ↑ 1.0 205,639 1

Hash Left Join (cost=25,184.38..43,339.23 rows=205,639 width=329) (actual time=256.634..788.577 rows=205,639 loops=1)

  • Hash Cond: (cr.gruposcontas_codigo = grct.codigo)
4. 61.807 713.888 ↑ 1.0 205,639 1

Hash Left Join (cost=25,164.48..42,548.18 rows=205,639 width=211) (actual time=256.613..713.888 rows=205,639 loops=1)

  • Hash Cond: (cr_sit.situacoesconta_codigo = sc.codigo)
5. 98.142 652.072 ↑ 1.0 205,639 1

Hash Left Join (cost=25,163.35..39,719.51 rows=205,639 width=89) (actual time=256.593..652.072 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = cr_sit.contasareceber_codigo)
6. 78.396 490.980 ↑ 1.0 205,639 1

Hash Left Join (cost=19,625.47..31,354.09 rows=205,639 width=85) (actual time=192.227..490.980 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = crav.contasareceber_codigo)
7. 81.901 351.695 ↑ 1.0 205,639 1

Hash Left Join (cost=14,671.16..23,853.38 rows=205,639 width=77) (actual time=130.133..351.695 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = cr_fat.contasareceber_codigo)
8. 65.442 213.304 ↑ 1.0 205,639 1

Hash Left Join (cost=8,938.66..15,295.74 rows=205,639 width=73) (actual time=72.428..213.304 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = pvpg_cr.contasareceber_codigo)
9. 51.647 78.719 ↑ 1.0 205,639 1

Hash Left Join (cost=694.78..6,000.08 rows=205,639 width=61) (actual time=3.149..78.719 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = snfpg_cr.contasareceber_codigo)
10. 23.933 23.933 ↑ 1.0 205,639 1

Seq Scan on contasareceber cr (cost=0.00..4,532.39 rows=205,639 width=53) (actual time=0.005..23.933 rows=205,639 loops=1)

11. 0.029 3.139 ↑ 1.0 176 1

Hash (cost=692.58..692.58 rows=176 width=12) (actual time=3.139..3.139 rows=176 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
12. 0.115 3.110 ↑ 1.0 176 1

Nested Loop Left Join (cost=5.25..692.58 rows=176 width=12) (actual time=2.076..3.110 rows=176 loops=1)

13. 1.455 2.819 ↑ 1.0 176 1

Hash Right Join (cost=4.96..605.16 rows=176 width=8) (actual time=2.059..2.819 rows=176 loops=1)

  • Hash Cond: (snfpg.codigo = snfpg_cr.saidasnf_pagtos_codigo)
14. 1.324 1.324 ↑ 1.0 22,122 1

Seq Scan on saidasnf_pagto snfpg (cost=0.00..377.22 rows=22,122 width=8) (actual time=0.003..1.324 rows=22,122 loops=1)

15. 0.020 0.040 ↑ 1.0 176 1

Hash (cost=2.76..2.76 rows=176 width=8) (actual time=0.040..0.040 rows=176 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
16. 0.020 0.020 ↑ 1.0 176 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..2.76 rows=176 width=8) (actual time=0.004..0.020 rows=176 loops=1)

17. 0.176 0.176 ↑ 1.0 1 176

Index Scan using saidasnf_codigo_index on saidasnf snf (cost=0.29..0.49 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=176)

  • Index Cond: (snfpg.codsaidasnf = codigo)
18. 5.483 69.143 ↑ 1.0 28,064 1

Hash (cost=7,893.07..7,893.07 rows=28,064 width=16) (actual time=69.143..69.143 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1572kB
19. 15.790 63.660 ↑ 1.0 28,064 1

Hash Right Join (cost=3,859.05..7,893.07 rows=28,064 width=16) (actual time=40.251..63.660 rows=28,064 loops=1)

  • Hash Cond: (pv.codigo = pvpg.codprevenda)
20. 7.767 7.767 ↓ 1.0 91,560 1

Seq Scan on prevendas pv (cost=0.00..3,295.59 rows=91,559 width=8) (actual time=0.002..7.767 rows=91,560 loops=1)

21. 5.094 40.103 ↑ 1.0 28,064 1

Hash (cost=3,508.25..3,508.25 rows=28,064 width=12) (actual time=40.103..40.103 rows=28,064 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1462kB
22. 10.069 35.009 ↑ 1.0 28,064 1

Hash Left Join (cost=2,716.73..3,508.25 rows=28,064 width=12) (actual time=23.958..35.009 rows=28,064 loops=1)

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
23. 1.737 1.737 ↑ 1.0 28,064 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr (cost=0.00..405.64 rows=28,064 width=8) (actual time=0.005..1.737 rows=28,064 loops=1)

24. 13.507 23.203 ↑ 1.0 93,499 1

Hash (cost=1,547.99..1,547.99 rows=93,499 width=8) (actual time=23.203..23.203 rows=93,499 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
25. 9.696 9.696 ↑ 1.0 93,499 1

Seq Scan on prevenda_pagto pvpg (cost=0.00..1,547.99 rows=93,499 width=8) (actual time=0.005..9.696 rows=93,499 loops=1)

26. 36.933 56.490 ↓ 1.0 205,443 1

Hash (cost=3,165.00..3,165.00 rows=205,400 width=4) (actual time=56.490..56.490 rows=205,443 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9271kB
27. 19.557 19.557 ↓ 1.0 205,443 1

Seq Scan on contasareceber_faturamentos cr_fat (cost=0.00..3,165.00 rows=205,400 width=4) (actual time=0.006..19.557 rows=205,443 loops=1)

28. 40.790 60.889 ↑ 1.0 177,399 1

Hash (cost=2,735.25..2,735.25 rows=177,525 width=12) (actual time=60.889..60.889 rows=177,399 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 9671kB
29. 20.099 20.099 ↑ 1.0 177,399 1

Seq Scan on contasareceber_avulsas crav (cost=0.00..2,735.25 rows=177,525 width=12) (actual time=0.005..20.099 rows=177,399 loops=1)

30. 48.471 62.950 ↑ 1.0 205,639 1

Hash (cost=2,967.39..2,967.39 rows=205,639 width=8) (actual time=62.950..62.950 rows=205,639 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 10081kB
31. 14.479 14.479 ↑ 1.0 205,639 1

Seq Scan on contasareceber_situacao cr_sit (cost=0.00..2,967.39 rows=205,639 width=8) (actual time=0.007..14.479 rows=205,639 loops=1)

32. 0.005 0.009 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=126) (actual time=0.009..0.009 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
33. 0.004 0.004 ↑ 1.0 6 1

Seq Scan on situacoescontas sc (cost=0.00..1.06 rows=6 width=126) (actual time=0.003..0.004 rows=6 loops=1)

34. 0.011 0.014 ↑ 110.0 4 1

Hash (cost=14.40..14.40 rows=440 width=122) (actual time=0.014..0.014 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 0.003 0.003 ↑ 110.0 4 1

Seq Scan on gruposcontas grct (cost=0.00..14.40 rows=440 width=122) (actual time=0.002..0.003 rows=4 loops=1)

36. 141.684 1,483.207 ↑ 1.0 205,639 1

Sort (cost=134,491.34..135,005.44 rows=205,639 width=484) (actual time=1,473.883..1,483.207 rows=205,639 loops=1)

  • Sort Key: contas.entidade_codigo, contas.entidade, contas.datavencimento, contas.codigo
  • Sort Method: quicksort Memory: 56673kB
37. 185.179 1,341.523 ↑ 1.0 205,639 1

WindowAgg (cost=67,245.67..71,358.45 rows=205,639 width=484) (actual time=1,147.290..1,341.523 rows=205,639 loops=1)

38. 162.972 1,156.344 ↑ 1.0 205,639 1

Sort (cost=67,245.67..67,759.77 rows=205,639 width=484) (actual time=1,147.279..1,156.344 rows=205,639 loops=1)

  • Sort Key: contas.entidade_codigo, contas.entidade
  • Sort Method: quicksort Memory: 50245kB
39. 993.372 993.372 ↑ 1.0 205,639 1

CTE Scan on contas (cost=0.00..4,112.78 rows=205,639 width=484) (actual time=256.639..993.372 rows=205,639 loops=1)