explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6RrY

Settings
# exclusive inclusive rows x rows loops node
1. 208.910 1,624.657 ↑ 1.0 205,639 1

WindowAgg (cost=182,013.24..190,238.80 rows=205,639 width=484) (actual time=1,407.880..1,624.657 rows=205,639 loops=1)

2.          

CTE contas

3. 88.013 760.517 ↑ 1.0 205,639 1

Hash Left Join (cost=26,539.51..47,521.90 rows=205,639 width=329) (actual time=231.611..760.517 rows=205,639 loops=1)

  • Hash Cond: (cr_sit.situacoesconta_codigo = sc.codigo)
4. 87.455 672.491 ↑ 1.0 205,639 1

Hash Left Join (cost=26,538.38..44,693.23 rows=205,639 width=207) (actual time=231.586..672.491 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = cr_sit.contasareceber_codigo)
5. 88.901 541.058 ↑ 1.0 205,639 1

Hash Left Join (cost=21,000.50..36,327.82 rows=205,639 width=203) (actual time=186.483..541.058 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = crav.contasareceber_codigo)
6. 34.549 402.083 ↑ 1.0 205,639 1

Hash Left Join (cost=16,046.19..28,827.11 rows=205,639 width=195) (actual time=135.336..402.083 rows=205,639 loops=1)

  • Hash Cond: (snfpg.codsaidasnf = snf.codigo)
7. 83.611 360.727 ↑ 1.0 205,639 1

Hash Left Join (cost=14,603.63..24,557.02 rows=205,639 width=191) (actual time=128.397..360.727 rows=205,639 loops=1)

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

Hash Left Join (cost=8,871.13..15,999.37 rows=205,639 width=187) (actual time=75.189..224.988 rows=205,639 loops=1)

  • Hash Cond: (cr.gruposcontas_codigo = grct.codigo)
9. 28.898 199.237 ↑ 1.0 205,639 1

Hash Left Join (cost=8,851.23..15,208.31 rows=205,639 width=69) (actual time=75.173..199.237 rows=205,639 loops=1)

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

Hash Left Join (cost=8,243.87..13,828.05 rows=205,639 width=65) (actual time=72.331..167.509 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = pvpg_cr.contasareceber_codigo)
11. 21.114 21.114 ↑ 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..21.114 rows=205,639 loops=1)

12. 5.543 72.183 ↑ 1.0 28,064 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 1572kB
13. 17.243 66.640 ↑ 1.0 28,064 1

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

  • Hash Cond: (pv.codigo = pvpg.codprevenda)
14. 7.701 7.701 ↓ 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.701 rows=91,560 loops=1)

15. 4.682 41.696 ↑ 1.0 28,064 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 1462kB
16. 9.180 37.014 ↑ 1.0 28,064 1

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

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
17. 1.673 1.673 ↑ 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.006..1.673 rows=28,064 loops=1)

18. 16.606 26.161 ↑ 1.0 93,499 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4677kB
19. 9.555 9.555 ↑ 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.555 rows=93,499 loops=1)

20. 0.025 2.830 ↑ 1.0 176 1

Hash (cost=605.16..605.16 rows=176 width=8) (actual time=2.830..2.830 rows=176 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
21. 1.479 2.805 ↑ 1.0 176 1

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

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

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

23. 0.023 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
24. 0.017 0.017 ↑ 1.0 176 1

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

25. 0.005 0.008 ↑ 110.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 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)

27. 32.425 52.128 ↓ 1.0 205,443 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 9271kB
28. 19.703 19.703 ↓ 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.004..19.703 rows=205,443 loops=1)

29. 3.319 6.807 ↑ 1.0 22,247 1

Hash (cost=1,164.47..1,164.47 rows=22,247 width=8) (actual time=6.807..6.807 rows=22,247 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1126kB
30. 3.488 3.488 ↑ 1.0 22,247 1

Seq Scan on saidasnf snf (cost=0.00..1,164.47 rows=22,247 width=8) (actual time=0.003..3.488 rows=22,247 loops=1)

31. 31.582 50.074 ↑ 1.0 177,399 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 9671kB
32. 18.492 18.492 ↑ 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..18.492 rows=177,399 loops=1)

33. 30.461 43.978 ↑ 1.0 205,639 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 10081kB
34. 13.517 13.517 ↑ 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..13.517 rows=205,639 loops=1)

35. 0.010 0.013 ↑ 1.0 6 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.003 0.003 ↑ 1.0 6 1

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

37. 139.224 1,415.747 ↑ 1.0 205,639 1

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

  • Sort Key: contas.entidade_codigo, contas.entidade, contas.datavencimento, contas.codigo
  • Sort Method: quicksort Memory: 56673kB
38. 179.961 1,276.523 ↑ 1.0 205,639 1

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

39. 147.909 1,096.562 ↑ 1.0 205,639 1

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

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

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