explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bcsn

Settings
# exclusive inclusive rows x rows loops node
1. 3.991 101.217 ↓ 1,015.0 1,015 1

Nested Loop Left Join (cost=1,459.12..4,111.10 rows=1 width=255) (actual time=61.869..101.217 rows=1,015 loops=1)

2. 0.176 93.166 ↓ 1,015.0 1,015 1

Nested Loop (cost=1,459.07..4,106.98 rows=1 width=271) (actual time=61.833..93.166 rows=1,015 loops=1)

  • Join Filter: ("*SELECT* 1".id_customer = tb_core_customer_data.id_customer)
3. 0.250 89.945 ↓ 1,015.0 1,015 1

Nested Loop (cost=1,459.04..4,106.95 rows=1 width=265) (actual time=61.820..89.945 rows=1,015 loops=1)

4. 0.341 87.665 ↓ 56.4 1,015 1

Hash Join (cost=1,459.00..4,034.11 rows=18 width=265) (actual time=61.814..87.665 rows=1,015 loops=1)

  • Hash Cond: ("*SELECT* 1".id_instrument = tb_dist_fund_selected.id_instrument)
5. 0.126 86.699 ↓ 40.6 1,015 1

Append (cost=1,452.47..4,027.55 rows=25 width=217) (actual time=61.180..86.699 rows=1,015 loops=1)

6. 0.000 0.016 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=1,452.47..2,074.50 rows=1 width=237) (actual time=0.016..0.016 rows=0 loops=1)

7. 0.000 0.016 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,452.47..2,074.50 rows=1 width=165) (actual time=0.016..0.016 rows=0 loops=1)

8. 0.000 0.016 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,444.13..2,049.45 rows=1 width=117) (actual time=0.016..0.016 rows=0 loops=1)

9. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1,444.08..2,037.32 rows=1 width=113) (actual time=0.016..0.016 rows=0 loops=1)

  • Join Filter: ((a.id_instrument = d.id_instrument) AND (a.dt_reference = d.dt_reference))
10. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1,444.04..2,037.27 rows=1 width=113) (actual time=0.016..0.016 rows=0 loops=1)

  • Join Filter: ((a.id_certificate = b.id_certificate) AND (a.id_instrument = b.id_instrument) AND (a.id_customer = b.id_customer))
11. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1,444.00..2,037.22 rows=1 width=105) (actual time=0.016..0.016 rows=0 loops=1)

12. 0.007 0.016 ↓ 0.0 0 1

Hash Right Join (cost=1,443.94..2,033.16 rows=1 width=81) (actual time=0.016..0.016 rows=0 loops=1)

  • Hash Cond: ((tb_dist_operation_withdraw.id_contract = a.id_contract) AND (tb_dist_operation_withdraw.id_customer = a.id_customer) AND (tb_dist_operation_withdraw.id_instrument = a.id_instrument) AND (tb_dist_operation_withdraw_certificate.id_certificate = a.id_certificate) AND (tb_dist_operation_withdraw.dt_levy = a.dt_reference))
13. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=1,439.90..1,618.45 rows=142,841 width=29) (never executed)

  • Group Key: tb_dist_operation_withdraw.id_contract, tb_dist_operation_withdraw.id_customer, tb_dist_operation_withdraw.id_instrument, tb_dist_operation_withdraw_certificate.id_certificate, tb_dist_operation_withdraw.dt_levy
14. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=588.49..1,225.63 rows=142,841 width=29) (never executed)

  • Hash Cond: (tb_dist_operation_withdraw_certificate.id_dist_operation_withdraw = tb_dist_operation_withdraw.id_dist_operation_withdraw)
15. 0.000 0.000 ↓ 0.0 0

Seq Scan on tb_dist_operation_withdraw_certificate (cost=0.00..439.03 rows=147,386 width=21) (never executed)

  • Filter: (id_contract = 8)
16. 0.000 0.000 ↓ 0.0 0

Hash (cost=467.01..467.01 rows=97,183 width=20) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on tb_dist_operation_withdraw (cost=0.00..467.01 rows=97,183 width=20) (never executed)

  • Filter: ((id_status_order <> 6) AND (id_contract = 8))
18. 0.001 0.009 ↓ 0.0 0 1

Hash (cost=4.04..4.04 rows=1 width=49) (actual time=0.009..0.009 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
19. 0.008 0.008 ↓ 0.0 0 1

Index Scan using tb_dist_certificate_quote_erosion_executed_idx1 on tb_dist_certificate_quote_erosion_executed a (cost=0.04..4.04 rows=1 width=49) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((id_contract = 8) AND (dt_reference >= 20191001) AND (dt_reference <= 20191002))
  • Filter: ((cd_cc_type)::text <> 'CC-IMPORT'::text)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_daily_pk on tb_dist_certificate_daily c (cost=0.06..4.06 rows=1 width=28) (never executed)

  • Index Cond: ((id_customer = a.id_customer) AND (id_instrument = a.id_instrument) AND (id_contract = 8) AND (id_certificate = a.id_certificate) AND (dt_reference = a.dt_reference))
21. 0.000 0.000 ↓ 0.0 0

Index Only Scan using tb_dist_certificate_pk on tb_dist_certificate b (cost=0.04..0.05 rows=1 width=16) (never executed)

  • Index Cond: ((id_customer = c.id_customer) AND (id_instrument = c.id_instrument) AND (id_contract = 8) AND (id_certificate = c.id_certificate))
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_fund_daily_pk on tb_dist_fund_daily d (cost=0.04..0.04 rows=1 width=20) (never executed)

  • Index Cond: ((id_contract = 8) AND (id_instrument = c.id_instrument) AND (dt_reference = c.dt_reference))
23. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_tudo_de_come_cotas (cost=0.04..12.14 rows=1 width=32) (never executed)

  • Index Cond: ((a.id_customer = id_customer) AND (a.id_instrument = id_instrument) AND (a.id_certificate = id_certificate) AND (a.dt_event > dt_event))
  • Filter: ((id_contract = 8) AND (a.id_contract = id_contract) AND ((dt_reference = (SubPlan 4)) OR ((SubPlan 6) IS NULL)))
24.          

SubPlan (forIndex Scan)

25. 0.000 0.000 ↓ 0.0 0

Result (cost=4.05..4.05 rows=1 width=0) (never executed)

26.          

Initplan (forResult)

27. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.05 rows=1 width=4) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_reg_cond_idx on tb_dist_certificate_quote_erosion_executed tb_exec (cost=0.04..4.05 rows=1 width=4) (never executed)

  • Index Cond: ((id_contract = a.id_contract) AND (id_instrument = a.id_instrument) AND (id_certificate = a.id_certificate) AND (id_customer = a.id_customer) AND (dt_reference IS NOT NULL) AND (dt_reference <= a.dt_reference))
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0

Result (cost=4.05..4.05 rows=1 width=0) (never executed)

30.          

Initplan (forResult)

31. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.05 rows=1 width=4) (never executed)

32. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_reg_cond_idx on tb_dist_certificate_quote_erosion_executed tb_exec_1 (cost=0.04..4.05 rows=1 width=4) (never executed)

  • Index Cond: ((id_contract = a.id_contract) AND (id_instrument = a.id_instrument) AND (id_certificate = a.id_certificate) AND (id_customer = a.id_customer) AND (dt_reference IS NOT NULL) AND (dt_reference <= a.dt_reference))
  • Heap Fetches: 0
33. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=8.34..25.04 rows=1 width=80) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=4.17..15.38 rows=1 width=56) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.08..9.16 rows=1 width=45) (never executed)

  • Join Filter: ((tb_dist_incorporation_certificate.id_instrument_orig = tb_dist_incorporation_request.id_instrument_orig) AND (tb_dist_incorporation_certificate.id_instrument_dest = tb_dist_incorporation_request.id_instrument_dest))
36. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.07..9.12 rows=1 width=40) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_incorporation_certificate_pk on tb_dist_incorporation_certificate (cost=0.03..5.79 rows=1 width=28) (never executed)

  • Index Cond: ((id_contract = a.id_contract) AND (id_contract = 8) AND (id_customer = a.id_customer))
  • Filter: ((id_instrument_dest = a.id_instrument) AND (id_certificate_dest = a.id_certificate))
38. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_pk on tb_dist_certificate tb_dist_certificate_1 (cost=0.04..3.34 rows=1 width=20) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate.id_customer) AND (id_instrument = tb_dist_incorporation_certificate.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate.id_certificate_orig))
39. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_incorporation_request_pk on tb_dist_incorporation_request (cost=0.01..0.03 rows=1 width=17) (never executed)

  • Index Cond: (id_instrument_orig = tb_dist_certificate_1.id_instrument)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_1 (cost=4.09..6.22 rows=1 width=24) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate.id_customer) AND (id_instrument = tb_dist_incorporation_certificate.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate.id_certificate_orig) AND (dt_event = (SubPlan 8)))
41.          

SubPlan (forIndex Scan)

42. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

43.          

Initplan (forResult)

44. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

45. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_4 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate.id_customer) AND (id_instrument = tb_dist_incorporation_certificate.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
46. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

47.          

Initplan (forResult)

48. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_4 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate.id_customer) AND (id_instrument = tb_dist_incorporation_certificate.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
50. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=4.17..9.66 rows=1 width=48) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.08..3.43 rows=1 width=45) (never executed)

  • Join Filter: ((tb_dist_incorporation_certificate_1.id_instrument_orig = tb_dist_incorporation_request_1.id_instrument_orig) AND (tb_dist_incorporation_certificate_1.id_instrument_dest = tb_dist_incorporation_request_1.id_instrument_dest))
52. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.07..3.40 rows=1 width=40) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_incorporation_certificate_pk on tb_dist_incorporation_certificate tb_dist_incorporation_certificate_1 (cost=0.03..0.06 rows=1 width=28) (never executed)

  • Index Cond: ((id_contract = tb_dist_incorporation_certificate.id_contract) AND (id_contract = 8) AND (id_customer = tb_dist_incorporation_certificate.id_customer))
  • Filter: ((id_instrument_dest = tb_dist_incorporation_certificate.id_instrument_orig) AND (id_certificate_dest = tb_dist_incorporation_certificate.id_certificate_orig))
54. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_pk on tb_dist_certificate tb_dist_certificate_2 (cost=0.04..3.34 rows=1 width=20) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_1.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_1.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_1.id_certificate_orig))
55. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_incorporation_request_pk on tb_dist_incorporation_request tb_dist_incorporation_request_1 (cost=0.01..0.03 rows=1 width=17) (never executed)

  • Index Cond: (id_instrument_orig = tb_dist_certificate_2.id_instrument)
56. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_2 (cost=4.09..6.22 rows=1 width=24) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_1.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_1.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_1.id_certificate_orig) AND (dt_event = (SubPlan 10)))
57.          

SubPlan (forIndex Scan)

58. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

59.          

Initplan (forResult)

60. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

61. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_5 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_1.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_1.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_1.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
62. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

63.          

Initplan (forResult)

64. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_5 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_1.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_1.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_1.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
66. 0.804 86.557 ↓ 42.3 1,015 1

Subquery Scan on *SELECT* 2 (cost=547.35..1,953.05 rows=24 width=216) (actual time=61.164..86.557 rows=1,015 loops=1)

67. 2.688 85.753 ↓ 42.3 1,015 1

Nested Loop Left Join (cost=547.35..1,953.03 rows=24 width=153) (actual time=61.154..85.753 rows=1,015 loops=1)

  • Join Filter: ((tb_dist_operation_withdraw_1.dt_levy >= tb_tudo_de_come_cotas_1.dt_reference) AND ((tb_tudo_de_come_cotas_1.dt_reference = (SubPlan 12)) OR ((SubPlan 14) IS NULL)))
  • Rows Removed by Join Filter: 421
68. 0.073 76.619 ↓ 42.3 1,015 1

Nested Loop Left Join (cost=547.30..1,754.56 rows=24 width=145) (actual time=61.129..76.619 rows=1,015 loops=1)

69. 0.447 74.516 ↓ 42.3 1,015 1

Nested Loop (cost=543.13..1,523.40 rows=24 width=73) (actual time=61.118..74.516 rows=1,015 loops=1)

70. 8.626 70.009 ↑ 1.0 1,015 1

Hash Join (cost=543.09..1,075.26 rows=1,024 width=65) (actual time=61.099..70.009 rows=1,015 loops=1)

  • Hash Cond: (tb_dist_operation_withdraw_certificate_1.id_dist_operation_withdraw = tb_dist_operation_withdraw_1.id_dist_operation_withdraw)
71. 35.764 35.764 ↓ 1.0 147,583 1

Seq Scan on tb_dist_operation_withdraw_certificate tb_dist_operation_withdraw_certificate_1 (cost=0.00..475.88 rows=147,378 width=48) (actual time=0.005..35.764 rows=147,583 loops=1)

  • Filter: ((qtd_quotes <> '0'::numeric) AND (id_contract = 8))
  • Rows Removed by Filter: 8
72. 0.119 25.619 ↓ 1.1 734 1

Hash (cost=542.22..542.22 rows=697 width=29) (actual time=25.619..25.619 rows=734 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 54kB
73. 25.500 25.500 ↓ 1.1 734 1

Seq Scan on tb_dist_operation_withdraw tb_dist_operation_withdraw_1 (cost=0.00..542.22 rows=697 width=29) (actual time=19.396..25.500 rows=734 loops=1)

  • Filter: ((dt_levy >= 20191001) AND (dt_levy <= 20191002) AND (id_status_order <> 6) AND ((cd_operation_type)::text <> 'RESG-IMPORT'::text) AND (id_contract = 8))
  • Rows Removed by Filter: 99650
74. 4.060 4.060 ↑ 1.0 1 1,015

Index Scan using tb_dist_certificate_pk on tb_dist_certificate tb_dist_certificate_3 (cost=0.04..0.44 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=1,015)

  • Index Cond: ((id_customer = tb_dist_operation_withdraw_certificate_1.id_customer) AND (id_instrument = tb_dist_operation_withdraw_certificate_1.id_instrument) AND (id_contract = 8) AND (id_certificate = tb_dist_operation_withdraw_certificate_1.id_certificate))
75. 0.000 2.030 ↓ 0.0 0 1,015

Nested Loop Left Join (cost=4.17..9.63 rows=1 width=88) (actual time=0.002..0.002 rows=0 loops=1,015)

76. 1.015 2.030 ↓ 0.0 0 1,015

Nested Loop (cost=0.08..3.41 rows=1 width=54) (actual time=0.002..0.002 rows=0 loops=1,015)

  • Join Filter: ((tb_dist_incorporation_certificate_2.id_instrument_orig = tb_dist_incorporation_request_2.id_instrument_orig) AND (tb_dist_incorporation_certificate_2.id_instrument_dest = tb_dist_incorporation_request_2.id_instrument_dest))
77. 0.000 1.015 ↓ 0.0 0 1,015

Nested Loop (cost=0.07..3.38 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=1,015)

78. 1.015 1.015 ↓ 0.0 0 1,015

Index Scan using tb_dist_incorporation_certificate_pk on tb_dist_incorporation_certificate tb_dist_incorporation_certificate_2 (cost=0.03..0.04 rows=1 width=28) (actual time=0.001..0.001 rows=0 loops=1,015)

  • Index Cond: ((id_contract = tb_dist_operation_withdraw_certificate_1.id_contract) AND (id_contract = 8) AND (id_customer = tb_dist_operation_withdraw_certificate_1.id_customer))
  • Filter: ((id_instrument_dest = tb_dist_operation_withdraw_certificate_1.id_instrument) AND (id_certificate_dest = tb_dist_operation_withdraw_certificate_1.id_certificate))
  • Rows Removed by Filter: 0
79. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_pk on tb_dist_certificate tb_dist_certificate_4 (cost=0.04..3.34 rows=1 width=20) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_2.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_2.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_2.id_certificate_orig))
80. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_incorporation_request_pk on tb_dist_incorporation_request tb_dist_incorporation_request_2 (cost=0.01..0.03 rows=1 width=26) (never executed)

  • Index Cond: (id_instrument_orig = tb_dist_certificate_4.id_instrument)
81. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_3 (cost=4.09..6.22 rows=1 width=24) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_2.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_2.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_2.id_certificate_orig) AND (dt_event = (SubPlan 16)))
82.          

SubPlan (forIndex Scan)

83. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

84.          

Initplan (forResult)

85. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_6 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_2.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_2.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_2.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
87. 0.000 0.000 ↓ 0.0 0

Result (cost=4.04..4.05 rows=1 width=0) (never executed)

88.          

Initplan (forResult)

89. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.04..4.04 rows=1 width=4) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_dist_certificate_quote_erosion_executed_6 (cost=0.04..4.04 rows=1 width=4) (never executed)

  • Index Cond: ((id_customer = tb_dist_incorporation_certificate_2.id_customer) AND (id_instrument = tb_dist_incorporation_certificate_2.id_instrument_orig) AND (id_certificate = tb_dist_incorporation_certificate_2.id_certificate_orig) AND (dt_event IS NOT NULL))
  • Heap Fetches: 0
91. 3.045 3.045 ↑ 1.0 1 1,015

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed tb_tudo_de_come_cotas_1 (cost=0.04..0.17 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=1,015)

  • Index Cond: ((tb_dist_operation_withdraw_certificate_1.id_customer = id_customer) AND (tb_dist_operation_withdraw_certificate_1.id_instrument = id_instrument) AND (tb_dist_operation_withdraw_certificate_1.id_certificate = id_certificate))
  • Filter: ((id_contract = 8) AND (tb_dist_operation_withdraw_certificate_1.id_contract = id_contract))
92.          

SubPlan (forNested Loop Left Join)

93. 0.000 2.559 ↑ 1.0 1 853

Result (cost=4.05..4.05 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=853)

94.          

Initplan (forResult)

95. 0.000 2.559 ↑ 1.0 1 853

Limit (cost=0.04..4.05 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=853)

96. 2.559 2.559 ↑ 1.0 1 853

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_reg_cond_idx on tb_dist_certificate_quote_erosion_executed tb_exec_2 (cost=0.04..4.05 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=853)

  • Index Cond: ((id_contract = tb_dist_operation_withdraw_certificate_1.id_contract) AND (id_instrument = tb_dist_operation_withdraw_certificate_1.id_instrument) AND (id_certificate = tb_dist_operation_withdraw_certificate_1.id_certificate) AND (id_customer = tb_dist_operation_withdraw_certificate_1.id_customer) AND (dt_reference IS NOT NULL) AND (dt_reference <= tb_dist_operation_withdraw_1.dt_levy))
  • Heap Fetches: 192
97. 0.000 0.842 ↑ 1.0 1 421

Result (cost=4.05..4.05 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=421)

98.          

Initplan (forResult)

99. 0.000 0.842 ↑ 1.0 1 421

Limit (cost=0.04..4.05 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=421)

100. 0.842 0.842 ↑ 1.0 1 421

Index Only Scan Backward using tb_dist_certificate_quote_erosion_executed_reg_cond_idx on tb_dist_certificate_quote_erosion_executed tb_exec_3 (cost=0.04..4.05 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=421)

  • Index Cond: ((id_contract = tb_dist_operation_withdraw_certificate_1.id_contract) AND (id_instrument = tb_dist_operation_withdraw_certificate_1.id_instrument) AND (id_certificate = tb_dist_operation_withdraw_certificate_1.id_certificate) AND (id_customer = tb_dist_operation_withdraw_certificate_1.id_customer) AND (dt_reference IS NOT NULL) AND (dt_reference <= tb_dist_operation_withdraw_1.dt_levy))
  • Heap Fetches: 86
101. 0.107 0.625 ↑ 1.0 552 1

Hash (cost=5.84..5.84 rows=552 width=48) (actual time=0.625..0.625 rows=552 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 53kB
102. 0.518 0.518 ↑ 1.0 552 1

Seq Scan on tb_dist_fund_selected (cost=0.00..5.84 rows=552 width=48) (actual time=0.010..0.518 rows=552 loops=1)

  • Filter: ((NOT is_from_minicom) AND (id_contract = 8))
  • Rows Removed by Filter: 201
103. 2.030 2.030 ↑ 1.0 1 1,015

Index Scan using tb_dist_certificate_pk on tb_dist_certificate (cost=0.04..4.05 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=1,015)

  • Index Cond: ((id_customer = "*SELECT* 1".id_customer) AND (id_instrument = "*SELECT* 1".id_instrument) AND (id_contract = 8) AND (id_certificate = "*SELECT* 1".id_certificate))
104. 3.045 3.045 ↑ 1.0 1 1,015

Index Scan using tb_core_customer_data_pk on tb_core_customer_data (cost=0.03..0.04 rows=1 width=18) (actual time=0.003..0.003 rows=1 loops=1,015)

  • Index Cond: ((id_contract = 8) AND (id_customer = tb_dist_certificate.id_customer))
105. 2.664 4.060 ↓ 0.0 0 1,015

Index Scan using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed (cost=0.04..4.11 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=1,015)

  • Index Cond: ((tb_dist_certificate.id_customer = id_customer) AND (tb_dist_certificate.id_instrument = id_instrument) AND (tb_dist_certificate.id_certificate = id_certificate))
  • Filter: (((cd_cc_type)::text <> 'CC-IMPORT'::text) AND (id_contract = 8) AND (tb_dist_certificate.id_contract = id_contract) AND (dt_event = (SubPlan 2)))
  • Rows Removed by Filter: 0
106.          

SubPlan (forIndex Scan)

107. 0.000 1.396 ↑ 1.0 1 698

Result (cost=4.04..4.05 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=698)

108.          

Initplan (forResult)

109. 0.000 1.396 ↑ 1.0 1 698

Limit (cost=0.04..4.04 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=698)

110. 1.396 1.396 ↑ 1.0 1 698

Index Scan Backward using tb_dist_certificate_quote_erosion_executed_sub_idx on tb_dist_certificate_quote_erosion_executed a_1 (cost=0.04..4.04 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=698)

  • Index Cond: ((id_customer = tb_dist_certificate_quote_erosion_executed.id_customer) AND (id_instrument = tb_dist_certificate_quote_erosion_executed.id_instrument) AND (id_certificate = tb_dist_certificate_quote_erosion_executed.id_certificate) AND (dt_event IS NOT NULL))
  • Filter: (((cd_cc_type)::text <> 'CC-IMPORT'::text) AND (id_contract = tb_dist_certificate_quote_erosion_executed.id_contract))
Planning time : 69.986 ms
Execution time : 102.931 ms