explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n7vA

Settings
# exclusive inclusive rows x rows loops node
1. 24.292 2,235.554 ↑ 1.0 200 1

Limit (cost=3,376.41..368,192.17 rows=200 width=121) (actual time=225.686..2,235.554 rows=200 loops=1)

2. 1.949 2,211.262 ↑ 3.5 200 1

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

3. 0.729 2,129.913 ↑ 3.0 200 1

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

4. 0.000 1,057.584 ↑ 3.0 200 1

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

5. 0.000 203.667 ↓ 23.5 14,301 1

Gather (cost=1,524.74..30,795.81 rows=608 width=32) (actual time=129.912..203.667 rows=14,301 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
6. 14.929 286.786 ↓ 22.2 4,343 4 / 4

Nested Loop (cost=524.74..29,735.01 rows=196 width=32) (actual time=121.285..286.786 rows=4,343 loops=4)

7. 153.585 171.968 ↓ 1.4 4,343 4 / 4

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

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

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

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

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

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

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

  • Filter: ((p.atraso >= 5) AND (p.atraso <= 360))
  • Rows Removed by Filter: 1
11. 14.301 843.759 ↑ 1.0 1 14,301

Limit (cost=8.62..8.62 rows=1 width=10) (actual time=0.059..0.059 rows=1 loops=14,301)

12. 128.709 829.458 ↑ 3.0 1 14,301

Sort (cost=8.62..8.63 rows=3 width=10) (actual time=0.057..0.058 rows=1 loops=14,301)

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

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

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

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

15. 1,069.400 1,069.400 ↑ 14.9 20 200

Index Scan using ret_car_dev_usu on retorno r (cost=0.57..1,841.28 rows=299 width=4) (actual time=0.098..5.347 rows=20 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: 555
16. 1.600 1.600 ↑ 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.008..0.008 rows=1 loops=200)

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

SubPlan (for Nested Loop)

18. 0.400 77.800 ↑ 1.0 1 200

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

19. 77.400 77.400 ↑ 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.387..0.387 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: 206
Planning time : 5.355 ms
Execution time : 2,235.930 ms