explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PuPy

Settings
# exclusive inclusive rows x rows loops node
1. 1.529 6,967.333 ↑ 1.0 500 1

Hash Right Join (cost=728,790.92..729,255.00 rows=500 width=32) (actual time=3.586..6,967.333 rows=500 loops=1)

  • Hash Cond: (aliasdebitossemtransacionador.numerocpfcnpjdebito = aliastransacionadores.numerocpfcnpj)
2.          

CTE aliastransacionadores

3. 3.241 3.241 ↑ 1.0 500 1

CTE Scan on codigostransacionadorcompletos (cost=5,295.52..5,305.52 rows=500 width=250) (actual time=0.039..3.241 rows=500 loops=1)

4.          

CTE transacionadores_pendentes

5. 0.032 0.160 ↑ 1.0 500 1

Limit (cost=0.42..17.77 rows=500 width=9) (actual time=0.016..0.160 rows=500 loops=1)

6. 0.128 0.128 ↑ 153.9 500 1

Index Only Scan using transacionadorcargapendpdv_pk on tb_transacionadorcargapendpdv transacionadorcargapendentepdv (cost=0.42..2,670.58 rows=76,944 width=9) (actual time=0.015..0.128 rows=500 loops=1)

  • Heap Fetches: 0
7.          

CTE codigostransacionadorcompletos

8. 0.537 3.049 ↑ 1.0 500 1

Nested Loop Left Join (cost=0.70..5,277.75 rows=500 width=250) (actual time=0.038..3.049 rows=500 loops=1)

  • Join Filter: (transacionadores_pendentes.codigotransacionador = '0'::numeric)
9. 0.185 1.512 ↑ 1.0 500 1

Nested Loop Left Join (cost=0.29..2,476.75 rows=500 width=94) (actual time=0.028..1.512 rows=500 loops=1)

10. 0.327 0.327 ↑ 1.0 500 1

CTE Scan on transacionadores_pendentes (cost=0.00..10.00 rows=500 width=40) (actual time=0.018..0.327 rows=500 loops=1)

11. 1.000 1.000 ↓ 0.0 0 500

Index Scan using transacionadorbasicopdv_pk on tb_transacionadorbasicopdv transacionadorbasicopdv (cost=0.29..4.92 rows=1 width=54) (actual time=0.002..0.002 rows=0 loops=500)

  • Index Cond: (transacionadores_pendentes.codigotransacionador = cd_transacionador)
  • Filter: (dt_exclusao IS NULL)
12. 1.000 1.000 ↓ 0.0 0 500

Index Scan using transacionadorbasicopdv_idx001 on tb_transacionadorbasicopdv transacionadordocumento (cost=0.41..5.58 rows=1 width=54) (actual time=0.002..0.002 rows=0 loops=500)

  • Index Cond: (transacionadores_pendentes.numerocpfcnpj = nr_cpfcnpj)
  • Filter: (dt_exclusao IS NULL)
13.          

CTE aliasdebitostransacionador

14. 0.314 6,959.281 ↑ 18.6 1,000 1

Append (cost=0.42..723,469.15 rows=18,560 width=28) (actual time=0.029..6,959.281 rows=1,000 loops=1)

15. 2.373 6,958.879 ↑ 16.4 1,000 1

Nested Loop (cost=0.42..716,475.28 rows=16,431 width=28) (actual time=0.029..6,958.879 rows=1,000 loops=1)

16. 2.006 2.006 ↓ 1.0 500 1

CTE Scan on aliastransacionadores aliastransacionadores_1 (cost=0.00..11.25 rows=498 width=32) (actual time=0.004..2.006 rows=500 loops=1)

  • Filter: (numerocpfcnpj <> '0'::numeric)
17. 6,954.500 6,954.500 ↑ 16.5 2 500

Index Scan using transacionadordebitopdv_pk on tb_transacionadordebitopdv transacionadordebitopdv (cost=0.42..1,438.35 rows=33 width=28) (actual time=0.037..13.909 rows=2 loops=500)

  • Index Cond: (nr_cpfcnpj = aliastransacionadores_1.numerocpfcnpj)
  • Filter: (dt_exclusao IS NULL)
18. 0.000 0.088 ↓ 0.0 0 1

Nested Loop (cost=0.42..6,808.27 rows=2,129 width=28) (actual time=0.088..0.088 rows=0 loops=1)

19. 0.088 0.088 ↓ 0.0 0 1

CTE Scan on aliastransacionadores aliastransacionadores_2 (cost=0.00..11.25 rows=498 width=32) (actual time=0.088..0.088 rows=0 loops=1)

  • Filter: (codigotransacionador <> '0'::numeric)
  • Rows Removed by Filter: 500
20. 0.000 0.000 ↓ 0.0 0

Index Scan using transacionadordebitopdv_pk on tb_transacionadordebitopdv transacionadordebitopdv_1 (cost=0.42..13.61 rows=4 width=28) (never executed)

  • Index Cond: (cd_transacionador = aliastransacionadores_2.codigotransacionador)
  • Filter: (dt_exclusao IS NULL)
21. 6,962.264 6,962.264 ↓ 500.0 500 1

CTE Scan on aliasdebitostransacionador aliasdebitossemtransacionador (cost=0.00..464.00 rows=1 width=20) (actual time=0.032..6,962.264 rows=500 loops=1)

  • Filter: ((codigotransacionadordebito = '0'::numeric) AND (identificadortipolimitedebito = '2'::numeric))
  • Rows Removed by Filter: 500
22. 0.163 3.540 ↑ 1.0 500 1

Hash (cost=10.00..10.00 rows=500 width=64) (actual time=3.540..3.540 rows=500 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
23. 3.377 3.377 ↑ 1.0 500 1

CTE Scan on aliastransacionadores (cost=0.00..10.00 rows=500 width=64) (actual time=0.041..3.377 rows=500 loops=1)

Planning time : 0.803 ms
Execution time : 6,967.794 ms