explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QS93

Settings
# exclusive inclusive rows x rows loops node
1. 197.131 1,573.176 ↑ 1.0 205,639 1

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

2.          

CTE contas

3. 133.213 731.387 ↑ 1.0 205,639 1

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

  • Hash Cond: (cr.codigo = cr_fat.contasareceber_codigo)
4. 34.722 544.213 ↑ 1.0 205,639 1

Hash Left Join (cost=19,451.88..34,781.59 rows=205,639 width=325) (actual time=175.673..544.213 rows=205,639 loops=1)

  • Hash Cond: (cr.gruposcontas_codigo = grct.codigo)
5. 59.635 509.481 ↑ 1.0 205,639 1

Hash Left Join (cost=19,431.98..33,990.53 rows=205,639 width=207) (actual time=175.659..509.481 rows=205,639 loops=1)

  • Hash Cond: (cr_sit.situacoesconta_codigo = sc.codigo)
6. 81.718 449.833 ↑ 1.0 205,639 1

Hash Left Join (cost=19,430.85..31,161.86 rows=205,639 width=85) (actual time=175.627..449.833 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = cr_sit.contasareceber_codigo)
7. 70.430 321.769 ↑ 1.0 205,639 1

Hash Left Join (cost=13,892.97..22,796.45 rows=205,639 width=81) (actual time=128.221..321.769 rows=205,639 loops=1)

  • Hash Cond: (cr.codigo = crav.contasareceber_codigo)
8. 57.971 199.668 ↑ 1.0 205,639 1

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

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

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

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

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

11. 0.034 3.286 ↑ 1.0 176 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
12. 0.137 3.252 ↑ 1.0 176 1

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

13. 1.515 2.939 ↑ 1.0 176 1

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

  • Hash Cond: (snfpg.codigo = snfpg_cr.saidasnf_pagtos_codigo)
14. 1.385 1.385 ↑ 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.385 rows=22,122 loops=1)

15. 0.019 0.039 ↑ 1.0 176 1

Hash (cost=2.76..2.76 rows=176 width=8) (actual time=0.039..0.039 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.006..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.471 72.017 ↑ 1.0 28,064 1

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

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

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

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

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

21. 4.895 41.772 ↑ 1.0 28,064 1

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

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

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

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

24. 16.397 25.982 ↑ 1.0 93,499 1

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

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

26. 33.186 51.671 ↑ 1.0 177,399 1

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

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

28. 33.585 46.346 ↑ 1.0 205,639 1

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

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

30. 0.009 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
31. 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.002..0.004 rows=6 loops=1)

32. 0.008 0.010 ↑ 110.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
33. 0.002 0.002 ↑ 110.0 4 1

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

34. 34.566 53.961 ↓ 1.0 205,443 1

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

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

36. 136.629 1,376.045 ↑ 1.0 205,639 1

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

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

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

38. 150.676 1,068.989 ↑ 1.0 205,639 1

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

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

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