explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yAa3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,029.776 ↓ 1.2 238 1

Sort (cost=34,291.03..34,291.53 rows=200 width=36) (actual time=1,029.768..1,029.776 rows=238 loops=1)

  • Sort Key: obter_contasareceber_saldo_cliente.clientes_codigo
  • Sort Method: quicksort Memory: 36kB
2.          

Initplan (for Sort)

3. 3.131 264.129 ↑ 1.0 1 1

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

4. 5.427 260.998 ↓ 1.0 20,711 1

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

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

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

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

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

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

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

8. 104.958 173.641 ↓ 1.0 11,159 1

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

  • Hash Cond: (snfpg.codigo = snfpg_cr.saidasnf_pagtos_codigo)
9. 65.117 65.117 ↓ 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.013..65.117 rows=813,167 loops=1)

10. 1.938 3.566 ↓ 1.0 11,159 1

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 564kB
11. 1.628 1.628 ↓ 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.017..1.628 rows=11,159 loops=1)

12. 55.795 55.795 ↑ 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.005..0.005 rows=1 loops=11,159)

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

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

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,066kB
14. 3.546 3.546 ↓ 1.0 20,711 1

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

15. 0.003 0.119 ↑ 125.6 18 1

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 33kB
16. 0.010 0.116 ↑ 125.6 18 1

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

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

18. 0.012 0.100 ↓ 58.5 117 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
19. 0.025 0.088 ↓ 58.5 117 1

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

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

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

21. 0.011 0.029 ↓ 58.5 117 1

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

  • Buckets: 1,024 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.008..0.018 rows=117 loops=1)

23. 1.250 2.446 ↓ 1.0 9,534 1

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 501kB
24. 1.196 1.196 ↓ 1.0 9,534 1

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

25. 6.275 1,029.728 ↓ 1.2 238 1

HashAggregate (cost=15.25..17.75 rows=200 width=36) (actual time=1,029.661..1,029.728 rows=238 loops=1)

  • Group Key: obter_contasareceber_saldo_cliente.clientes_codigo
26. 1,023.453 1,023.453 ↓ 20.5 20,524 1

Function Scan on obter_contasareceber_saldo_cliente (cost=0.25..10.25 rows=1,000 width=36) (actual time=1,020.893..1,023.453 rows=20,524 loops=1)

Planning time : 1.748 ms
Execution time : 1,030.748 ms