explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yfYi

Settings
# exclusive inclusive rows x rows loops node
1. 481.177 10,540.806 ↓ 207.0 207 1

HashAggregate (cost=507,631.00..507,631.01 rows=1 width=26) (actual time=10,540.774..10,540.806 rows=207 loops=1)

2. 0.000 10,059.629 ↓ 1,440,830.0 1,440,830 1

Nested Loop (cost=474,374.57..507,630.98 rows=1 width=26) (actual time=3,392.338..10,059.629 rows=1,440,830 loops=1)

3. 480.495 8,989.604 ↓ 1,471,020.0 1,471,020 1

Nested Loop Left Join (cost=474,374.43..507,626.58 rows=1 width=30) (actual time=3,392.334..8,989.604 rows=1,471,020 loops=1)

  • Filter: ((boleto.vl_cobrado > 0::numeric) OR (COALESCE(boleto_novo.vl_cobrado, 0::numeric) > 0::numeric))
  • Rows Removed by Filter: 414
4. 566.602 8,509.109 ↓ 1,471,434.0 1,471,434 1

Nested Loop (cost=474,374.01..507,621.04 rows=1 width=40) (actual time=3,392.327..8,509.109 rows=1,471,434 loops=1)

5. 349.607 6,471.072 ↓ 1,471,435.0 1,471,435 1

Nested Loop Left Join (cost=474,373.59..507,615.52 rows=1 width=19) (actual time=3,392.320..6,471.072 rows=1,471,435 loops=1)

6. 494.314 4,650.030 ↓ 1,471,435.0 1,471,435 1

Merge Join (cost=474,373.17..507,610.01 rows=1 width=19) (actual time=3,392.304..4,650.030 rows=1,471,435 loops=1)

  • Merge Cond: ((dc.cd_caixa = debito.cd_caixa) AND (dc.cd_processamento = debito.cd_processamento) AND (dc.cd_unidade = debito.cd_unidade) AND (dc.cd_condomino_tipo = debito.cd_condomino_tipo) AND (dc.cd_condomino = debito.cd_condomino))
7. 2,596.283 2,833.510 ↑ 1.0 1,507,237 1

Sort (cost=308,050.59..311,818.98 rows=1,507,354 width=34) (actual time=2,336.503..2,833.510 rows=1,507,237 loops=1)

  • Sort Key: dc.cd_caixa, dc.cd_processamento, dc.cd_unidade, dc.cd_condomino_tipo, dc.cd_condomino
  • Sort Method: external merge Disk: 67,720kB
8. 237.227 237.227 ↑ 1.0 1,507,354 1

Seq Scan on debito_composicao dc (cost=0.00..29,710.54 rows=1,507,354 width=34) (actual time=0.038..237.227 rows=1,507,354 loops=1)

9. 78.060 1,322.206 ↓ 1.6 1,553,515 1

Materialize (cost=166,321.92..171,328.36 rows=1,001,289 width=25) (actual time=1,055.795..1,322.206 rows=1,553,515 loops=1)

10. 1,090.509 1,244.146 ↑ 1.8 543,971 1

Sort (cost=166,321.92..168,825.14 rows=1,001,289 width=25) (actual time=1,055.790..1,244.146 rows=543,971 loops=1)

  • Sort Key: debito.cd_caixa, debito.cd_processamento, debito.cd_unidade, debito.cd_condomino_tipo, debito.cd_condomino
  • Sort Method: external merge Disk: 35,528kB
11. 153.637 153.637 ↓ 1.0 1,005,273 1

Seq Scan on debito (cost=0.00..18,611.31 rows=1,001,289 width=25) (actual time=0.007..153.637 rows=1,005,273 loops=1)

  • Filter: fl_pago
  • Rows Removed by Filter: 67,958
12. 1,471.435 1,471.435 ↑ 1.0 1 1,471,435

Index Scan using lancamento_pkey on lancamento l (cost=0.42..5.50 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1,471,435)

  • Index Cond: (cd_lancamento = dc.cd_lancamento)
13. 1,471.435 1,471.435 ↑ 1.0 1 1,471,435

Index Scan using boleto_pkey on boleto (cost=0.42..5.51 rows=1 width=29) (actual time=0.001..0.001 rows=1 loops=1,471,435)

  • Index Cond: (cd_boleto = debito.cd_boleto)
  • Filter: (dt_exclusao IS NULL)
  • Rows Removed by Filter: 0
14. 0.000 0.000 ↓ 0.0 0 1,471,434

Index Scan using boleto_pkey on boleto boleto_novo (cost=0.42..5.52 rows=1 width=10) (actual time=0.000..0.000 rows=0 loops=1,471,434)

  • Index Cond: (cd_boleto = boleto.cd_boleto_novo)
  • Filter: (dt_exclusao IS NULL)
15. 1,471.020 1,471.020 ↑ 1.0 1 1,471,020

Index Scan using condominio_pkey on condominio (cost=0.14..4.39 rows=1 width=4) (actual time=0.000..0.001 rows=1 loops=1,471,020)

  • Index Cond: (cd_condominio = boleto.cd_condominio)
  • Filter: (dt_exclusao IS NULL)
  • Rows Removed by Filter: 0
Total runtime : 10,553.384 ms