explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zcGG

Settings
# exclusive inclusive rows x rows loops node
1. 22.960 1,158.272 ↑ 1.0 200 1

Limit (cost=3,376.41..368,192.17 rows=200 width=121) (actual time=93.850..1,158.272 rows=200 loops=1)

2. 2.091 1,135.312 ↑ 3.5 200 1

Nested Loop (cost=3,376.41..1,274,759.34 rows=697 width=121) (actual time=93.849..1,135.312 rows=200 loops=1)

3. 0.689 1,062.821 ↑ 3.0 200 1

Nested Loop (cost=3,376.14..1,156,480.09 rows=608 width=42) (actual time=93.601..1,062.821 rows=200 loops=1)

4. 0.000 816.332 ↑ 3.0 200 1

Nested Loop (cost=1,533.36..36,052.58 rows=608 width=30) (actual time=92.664..816.332 rows=200 loops=1)

5. 0.000 159.981 ↓ 23.6 14,330 1

Gather (cost=1,524.74..30,795.81 rows=608 width=32) (actual time=88.610..159.981 rows=14,330 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
6. 16.882 256.386 ↓ 22.2 4,350 4 / 4

Nested Loop (cost=524.74..29,735.01 rows=196 width=32) (actual time=82.197..256.386 rows=4,350 loops=4)

7. 117.182 130.748 ↓ 1.4 4,350 4 / 4

Parallel Bitmap Heap Scan on contrato c (cost=524.31..17,198.82 rows=3,075 width=22) (actual time=82.091..130.748 rows=4,350 loops=4)

  • Recheck Cond: ((carcod = 100) AND (conati = 0) AND (convalsal > '0'::numeric))
  • Heap Blocks: exact=5
8. 13.566 13.566 ↓ 28.2 268,384 1 / 4

Bitmap Index Scan on contrato_iu0014 (cost=0.00..521.93 rows=9,534 width=0) (actual time=54.263..54.263 rows=268,384 loops=1)

  • Index Cond: (carcod = 100)
9. 108.756 108.756 ↑ 1.0 1 17,401 / 4

Index Scan using devedor_pkey on devedor d (cost=0.43..4.08 rows=1 width=22) (actual time=0.025..0.025 rows=1 loops=17,401)

  • Index Cond: ((carcod = 100) AND (devcod = c.devcod))
  • Filter: (devsal > '0'::numeric)
10. 14.330 659.180 ↓ 0.0 0 14,330

Subquery Scan on p (cost=8.62..8.64 rows=1 width=6) (actual time=0.046..0.046 rows=0 loops=14,330)

  • Filter: ((p.atraso >= 5) AND (p.atraso <= 360))
  • Rows Removed by Filter: 1
11. 28.660 644.850 ↑ 1.0 1 14,330

Limit (cost=8.62..8.62 rows=1 width=10) (actual time=0.044..0.045 rows=1 loops=14,330)

12. 157.630 616.190 ↑ 3.0 1 14,330

Sort (cost=8.62..8.63 rows=3 width=10) (actual time=0.043..0.043 rows=1 loops=14,330)

  • Sort Key: cp.conpardatven DESC
  • Sort Method: top-N heapsort Memory: 25kB
13. 458.560 458.560 ↓ 2.0 6 14,330

Index Scan using contrato_parcela_iu0023 on contrato_parcela cp (cost=0.56..8.60 rows=3 width=10) (actual time=0.019..0.032 rows=6 loops=14,330)

  • Index Cond: ((concod = c.concod) AND (conparati = 0) AND (conparvalsal > '0'::numeric))
14. 2.400 245.800 ↑ 1.0 1 200

Aggregate (cost=1,842.78..1,842.79 rows=1 width=12) (actual time=1.229..1.229 rows=1 loops=200)

15. 243.400 243.400 ↑ 15.7 19 200

Index Scan using ret_car_dev_usu on retorno r (cost=0.57..1,841.28 rows=299 width=4) (actual time=0.079..1.217 rows=19 loops=200)

  • Index Cond: ((carcod = d.carcod) AND (devcod = d.devcod))
  • Filter: ((rettip = 0) AND (usucod <> ALL ('{7,43,10,15,9,21,777,37,74,3028,39,6300,1111,5,960,1986,1930,188,285,958,555,222,2018,2019,1987,9090,1996,1997,1992,39,1111,1117,780,2000,51,17}'::integer[])))
  • Rows Removed by Filter: 550
16. 1.800 1.800 ↑ 1.0 1 200

Index Scan using carteira_situacao_iu0003 on carteira_situacao cs (cost=0.28..0.30 rows=1 width=25) (actual time=0.009..0.009 rows=1 loops=200)

  • Index Cond: ((sitcod = d.devsitcod) AND (carcod = 100))
17.          

SubPlan (for Nested Loop)

18. 0.400 68.600 ↑ 1.0 1 200

Limit (cost=0.57..169.40 rows=1 width=20) (actual time=0.343..0.343 rows=1 loops=200)

19. 68.200 68.200 ↑ 11.0 1 200

Index Scan Backward using retorno_iu0001 on retorno r_1 (cost=0.57..1,857.70 rows=11 width=20) (actual time=0.340..0.341 rows=1 loops=200)

  • Index Cond: ((devcod = d.devcod) AND (carcod = d.carcod))
  • Filter: ((rettip = ANY ('{0,8}'::integer[])) AND (usucod <> ALL ('{1992,1996}'::integer[])) AND (sitcod = ANY ('{11,1054,1055,1056,1057,1062,1065,1067,1075,1350,1355,2001,2002,2004,2005,2031,2032,2033,2034,1360}'::integer[])))
  • Rows Removed by Filter: 201
Planning time : 3.366 ms
Execution time : 1,158.540 ms