explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XJl7

Settings
# exclusive inclusive rows x rows loops node
1. 793.580 1,051.585 ↓ 20.5 20,524 1

Function Scan on obter_contasareceber_saldo_cliente (cost=34,265.89..34,275.89 rows=1,000 width=473) (actual time=1,049.460..1,051.585 rows=20,524 loops=1)

2.          

Initplan (for Function Scan)

3. 3.092 258.005 ↑ 1.0 1 1

Aggregate (cost=34,265.62..34,265.63 rows=1 width=32) (actual time=258.005..258.005 rows=1 loops=1)

4. 5.124 254.913 ↓ 1.0 20,711 1

Hash Left Join (cost=1,322.80..34,213.87 rows=20,701 width=12) (actual time=12.829..254.913 rows=20,711 loops=1)

  • Hash Cond: (cr.codigo = crav.contasareceber_codigo)
5. 3.745 247.609 ↓ 1.0 20,711 1

Hash Left Join (cost=1,056.42..33,893.14 rows=20,701 width=12) (actual time=10.592..247.609 rows=20,711 loops=1)

  • Hash Cond: (cr.codigo = pvpg_cr.contasareceber_codigo)
6. 5.427 243.734 ↓ 1.0 20,711 1

Hash Right Join (cost=981.23..33,717.72 rows=20,701 width=8) (actual time=10.447..243.734 rows=20,711 loops=1)

  • Hash Cond: (snfpg_cr.contasareceber_codigo = cr.codigo)
7. 5.001 230.916 ↓ 1.0 11,159 1

Nested Loop Left Join (cost=301.46..33,008.65 rows=11,157 width=8) (actual time=3.044..230.916 rows=11,159 loops=1)

8. 94.548 158.961 ↓ 1.0 11,159 1

Hash Right Join (cost=301.03..23,631.34 rows=11,157 width=8) (actual time=3.024..158.961 rows=11,159 loops=1)

  • Hash Cond: (snfpg.codigo = snfpg_cr.saidasnf_pagtos_codigo)
9. 61.423 61.423 ↓ 1.0 813,167 1

Seq Scan on saidasnf_pagto snfpg (cost=0.00..14,070.64 rows=813,164 width=8) (actual time=0.018..61.423 rows=813,167 loops=1)

10. 1.418 2.990 ↓ 1.0 11,159 1

Hash (cost=161.57..161.57 rows=11,157 width=8) (actual time=2.989..2.990 rows=11,159 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 564kB
11. 1.572 1.572 ↓ 1.0 11,159 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..161.57 rows=11,157 width=8) (actual time=0.007..1.572 rows=11,159 loops=1)

12. 66.954 66.954 ↑ 1.0 1 11,159

Index Scan using saidasnf_codigo_index on saidasnf snf (cost=0.43..0.84 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=11,159)

  • Index Cond: (snfpg.codsaidasnf = codigo)
13. 2.769 7.391 ↓ 1.0 20,711 1

Hash (cost=421.01..421.01 rows=20,701 width=12) (actual time=7.391..7.391 rows=20,711 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1066kB
14. 4.622 4.622 ↓ 1.0 20,711 1

Seq Scan on contasareceber cr (cost=0.00..421.01 rows=20,701 width=12) (actual time=0.005..4.622 rows=20,711 loops=1)

15. 0.004 0.130 ↑ 125.6 18 1

Hash (cost=46.94..46.94 rows=2,260 width=8) (actual time=0.130..0.130 rows=18 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 33kB
16. 0.014 0.126 ↑ 125.6 18 1

Hash Left Join (cost=5.63..46.94 rows=2,260 width=8) (actual time=0.122..0.126 rows=18 loops=1)

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
17. 0.009 0.009 ↑ 125.6 18 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.008..0.009 rows=18 loops=1)

18. 0.014 0.103 ↓ 58.5 117 1

Hash (cost=5.60..5.60 rows=2 width=8) (actual time=0.103..0.103 rows=117 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
19. 0.032 0.089 ↓ 58.5 117 1

Hash Right Join (cost=1.04..5.60 rows=2 width=8) (actual time=0.053..0.089 rows=117 loops=1)

  • Hash Cond: (pv.codigo = pvpg.codprevenda)
20. 0.025 0.025 ↓ 1.0 113 1

Seq Scan on prevendas pv (cost=0.00..4.12 rows=112 width=8) (actual time=0.012..0.025 rows=113 loops=1)

21. 0.014 0.032 ↓ 58.5 117 1

Hash (cost=1.02..1.02 rows=2 width=8) (actual time=0.032..0.032 rows=117 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
22. 0.018 0.018 ↓ 58.5 117 1

Seq Scan on prevenda_pagto pvpg (cost=0.00..1.02 rows=2 width=8) (actual time=0.009..0.018 rows=117 loops=1)

23. 1.068 2.180 ↓ 1.0 9,534 1

Hash (cost=147.28..147.28 rows=9,528 width=8) (actual time=2.180..2.180 rows=9,534 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 501kB
24. 1.112 1.112 ↓ 1.0 9,534 1

Seq Scan on contasareceber_avulsas crav (cost=0.00..147.28 rows=9,528 width=8) (actual time=0.010..1.112 rows=9,534 loops=1)

Planning time : 2.751 ms
Execution time : 1,053.104 ms