explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bCAj

Settings
# exclusive inclusive rows x rows loops node
1. 17.961 603.013 ↑ 1.0 200 1

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

2. 1.092 585.052 ↑ 3.5 200 1

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

3. 0.412 546.760 ↑ 3.0 200 1

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

4. 0.000 410.748 ↑ 3.0 200 1

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

5. 0.000 100.554 ↓ 23.6 14,330 1

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

  • Workers Planned: 3
  • Workers Launched: 3
6. 9.097 159.094 ↓ 22.2 4,350 4 / 4

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

7. 78.987 89.093 ↓ 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=60.462..89.093 rows=4,350 loops=4)

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

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

  • Index Cond: (carcod = 100)
9. 60.904 60.904 ↑ 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.014..0.014 rows=1 loops=17,401)

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

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

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

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

12. 57.320 300.930 ↑ 3.0 1 14,330

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

  • Sort Key: cp.conpardatven DESC
  • Sort Method: top-N heapsort Memory: 25kB
13. 243.610 243.610 ↓ 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.009..0.017 rows=6 loops=14,330)

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

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

15. 134.600 134.600 ↑ 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.046..0.673 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: 552
16. 1.000 1.000 ↑ 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.005..0.005 rows=1 loops=200)

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

SubPlan (for Nested Loop)

18. 0.200 36.200 ↑ 1.0 1 200

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

19. 36.000 36.000 ↑ 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.180..0.180 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: 209
Planning time : 2.352 ms
Execution time : 603.207 ms