# Result: NZXo

Settings
# exclusive inclusive rows x rows loops node
1. 19.991 1,213.499 ↓ 200.0 200 1

(cost=1,001.73..429,083.68 rows=1 width=121) (actual time=47.712..1,213.499 rows=200 loops=1)

2. 4.009 1,193.508 ↓ 200.0 200 1

(cost=1,001.73..429,083.68 rows=1 width=121) (actual time=47.711..1,193.508 rows=200 loops=1)

3. 22.394 817.099 ↓ 200.0 200 1

(cost=1,001.46..427,065.00 rows=1 width=30) (actual time=46.841..817.099 rows=200 loops=1)

4. 0.000 181.993 ↓ 34.8 21,128 1

Gather Merge (cost=1,001.02..34,964.64 rows=608 width=32) (actual time=46.738..181.993 rows=21,128 loops=1)

• Workers Planned: 3
• Workers Launched: 3
5. 27.097 270.595 ↓ 30.9 6,056 4 / 4

(cost=0.98..33,893.16 rows=196 width=32) (actual time=0.179..270.595 rows=6,056 loops=4)

6. 92.111 92.111 ↓ 2.0 6,056 4 / 4

Parallel Index Scan using contrato_iu0010 on contrato c (cost=0.56..21,356.97 rows=3,075 width=22) (actual time=0.066..92.111 rows=6,056 loops=4)

• Index Cond: ((carcod = 100) AND (conati = 0) AND (convalsal > '0'::numeric))
7. 151.388 151.388 ↑ 1.0 1 24,222 / 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=24,222)

• Index Cond: ((carcod = 100) AND (devcod = c.devcod))
• Filter: (devsal > '0'::numeric)
8. 563.536 612.712 ↓ 0.0 0 21,128

Index Scan using contrato_parcela_iu0021 on contrato_parcela p (cost=0.43..644.89 rows=1 width=14) (actual time=0.029..0.029 rows=0 loops=21,128)

• Index Cond: (concod = c.concod)
• Filter: (((CURRENT_DATE - conpardatven) >= 5) AND ((CURRENT_DATE - conpardatven) <= 360) AND (conparseq = (SubPlan 4)))
• Rows Removed by Filter: 8
9.

SubPlan (for Index Scan)

10. 2.732 49.176 ↑ 1.0 1 1,366

(cost=8.60..8.61 rows=1 width=12) (actual time=0.035..0.036 rows=1 loops=1,366)

11. 15.026 46.444 ↑ 3.0 1 1,366

(cost=8.60..8.61 rows=3 width=12) (actual time=0.034..0.034 rows=1 loops=1,366)

• Sort Key: x.conpardatven
• Sort Method: top-N heapsort Memory: 25kB
12. 31.418 31.418 ↓ 2.7 8 1,366

Index Scan using contrato_parcela_iu0023 on contrato_parcela x (cost=0.56..8.59 rows=3 width=12) (actual time=0.014..0.023 rows=8 loops=1,366)

• Index Cond: ((concod = p.concod) AND (conparati = 0) AND (conparvalsal > '0'::numeric))
13. 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))
14.

SubPlan (for Nested Loop)

15. 0.600 21.400 ↑ 1.0 1 200

(cost=0.57..6.82 rows=1 width=12) (actual time=0.106..0.107 rows=1 loops=200)

16. 20.800 20.800 ↑ 299.0 1 200

Index Scan Backward using retorno_iu0011 on retorno r (cost=0.57..1,870.35 rows=299 width=12) (actual time=0.104..0.104 rows=1 loops=200)

• Index Cond: ((devcod = d.devcod) AND (carcod = d.carcod))
• 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: 35
17. 0.600 81.200 ↑ 1.0 1 200

(cost=0.57..169.40 rows=1 width=20) (actual time=0.405..0.406 rows=1 loops=200)

18. 80.600 80.600 ↑ 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.403..0.403 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: 142
19. 4.200 268.000 ↑ 1.0 1 200

Aggregate (cost=1,842.03..1,842.04 rows=1 width=8) (actual time=1.340..1.340 rows=1 loops=200)

20. 263.800 263.800 ↑ 8.5 35 200

Index Scan using ret_car_dev_usu on retorno r_2 (cost=0.57..1,841.28 rows=299 width=0) (actual time=0.064..1.319 rows=35 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: 585
Planning time Execution time : 8.408 ms : 1,213.947 ms