explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R0pp

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 1,990.662 ↑ 1.0 10 1

Limit (cost=0.43..360.03 rows=10 width=277) (actual time=41.285..1,990.662 rows=10 loops=1)

2. 6.458 1,990.657 ↑ 3,233.0 10 1

Index Scan using idevedor3 on devedor dev (cost=0.43..1,162,581.78 rows=32,330 width=277) (actual time=41.284..1,990.657 rows=10 loops=1)

  • Index Cond: (carcod = 111)
  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 12163
3.          

SubPlan (for Index Scan)

4. 12.173 1,984.199 ↓ 0.0 0 12,173

Subquery Scan on x (cost=17.10..17.12 rows=1 width=0) (actual time=0.163..0.163 rows=0 loops=12,173)

  • Filter: ((x.parcela_mais_recente >= '100'::numeric) AND (x.parcela_mais_recente <= '110'::numeric))
  • Rows Removed by Filter: 1
5. 0.000 1,972.026 ↑ 1.0 1 12,173

Limit (cost=17.10..17.10 rows=1 width=36) (actual time=0.162..0.162 rows=1 loops=12,173)

6. 24.346 1,972.026 ↑ 1.0 1 12,173

Sort (cost=17.10..17.10 rows=1 width=36) (actual time=0.162..0.162 rows=1 loops=12,173)

  • Sort Key: y.conpardatven DESC
  • Sort Method: quicksort Memory: 25kB
7. 118.927 1,947.680 ↓ 9.0 9 12,173

Nested Loop Left Join (cost=2.94..17.09 rows=1 width=36) (actual time=0.025..0.160 rows=9 loops=12,173)

  • Join Filter: (car.carcod = x_1.carcod)
8. 0.000 389.536 ↓ 9.0 9 12,173

Nested Loop Left Join (cost=1.69..14.71 rows=1 width=14) (actual time=0.010..0.032 rows=9 loops=12,173)

9. 17.978 182.595 ↓ 9.0 9 12,173

Nested Loop (cost=1.12..13.67 rows=1 width=19) (actual time=0.008..0.015 rows=9 loops=12,173)

10. 60.865 60.865 ↑ 1.0 1 12,173

Index Only Scan using contrato_devcod_carcod_concod_idx on contrato x_1 (cost=0.56..1.68 rows=1 width=12) (actual time=0.004..0.005 rows=1 loops=12,173)

  • Index Cond: ((devcod = dev.devcod) AND (carcod = dev.carcod))
  • Heap Fetches: 17345
11. 103.752 103.752 ↓ 2.0 6 17,292

Index Scan using contrato_parcela_iu0007 on contrato_parcela y (cost=0.56..11.96 rows=3 width=23) (actual time=0.003..0.006 rows=6 loops=17,292)

  • Index Cond: ((concod = x_1.concod) AND (conparati = 0))
  • Filter: (conparvalsal > '0'::numeric)
  • Rows Removed by Filter: 0
12. 221.418 221.418 ↓ 0.0 0 110,709

Index Scan using contrato_parcela_detalhe_pkey on contrato_parcela_detalhe z (cost=0.56..1.99 rows=3 width=11) (actual time=0.002..0.002 rows=0 loops=110,709)

  • Index Cond: ((conparseq = y.conparseq) AND (conpardetcod = 95))
13. 1,328.508 1,439.217 ↑ 1.0 1 110,709

Bitmap Heap Scan on carteira car (cost=1.25..2.36 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=110,709)

  • Recheck Cond: (carcod = dev.carcod)
  • Heap Blocks: exact=1328508
14. 110.709 110.709 ↓ 14.0 14 110,709

Bitmap Index Scan on carteira_pkey (cost=0.00..1.25 rows=1 width=0) (actual time=0.001..0.001 rows=14 loops=110,709)

  • Index Cond: (carcod = dev.carcod)
Planning time : 1.434 ms
Execution time : 1,990.775 ms