explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XPI8l

Settings
# exclusive inclusive rows x rows loops node
1. 1,228.839 1,228.839 ↑ 1.1 19 1

CTE Scan on consulta_totalizadores (cost=320.70..321.10 rows=20 width=144) (actual time=1,228.831..1,228.839 rows=19 loops=1)

  • Buffers: shared hit=43,736
2.          

CTE parametros

3. 0.003 0.003 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=96) (actual time=0.003..0.003 rows=1 loops=1)

4.          

CTE limite_devedor_atual

5. 0.000 0.442 ↑ 1.0 1 1

Limit (cost=3.76..3.76 rows=1 width=268) (actual time=0.442..0.442 rows=1 loops=1)

  • Buffers: shared hit=115
6. 0.029 0.442 ↑ 1.0 1 1

Sort (cost=3.76..3.76 rows=1 width=268) (actual time=0.442..0.442 rows=1 loops=1)

  • Sort Key: tb_gcc_limite_devedor.lid_limite_devedor DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=115
7. 0.040 0.413 ↓ 13.0 13 1

Nested Loop Left Join (cost=1.29..3.75 rows=1 width=268) (actual time=0.092..0.413 rows=13 loops=1)

  • Buffers: shared hit=115
8. 0.032 0.269 ↓ 13.0 13 1

Nested Loop Left Join (cost=0.86..3.25 rows=1 width=54) (actual time=0.046..0.269 rows=13 loops=1)

  • Buffers: shared hit=63
9. 0.008 0.146 ↓ 13.0 13 1

Nested Loop Left Join (cost=0.43..2.68 rows=1 width=43) (actual time=0.045..0.146 rows=13 loops=1)

  • Buffers: shared hit=15
10. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros (cost=0.00..0.02 rows=1 width=64) (actual time=0.001..0.001 rows=1 loops=1)

11. 0.137 0.137 ↓ 13.0 13 1

Index Scan using ix_gcc_limite_devedor_03 on tb_gcc_limite_devedor (cost=0.43..2.65 rows=1 width=43) (actual time=0.040..0.137 rows=13 loops=1)

  • Index Cond: ((lid_cod_cooperativa = parametros.cod_coop) AND (lid_nro_conta = parametros.nro_conta))
  • Buffers: shared hit=15
12. 0.091 0.091 ↑ 1.0 1 13

Index Scan using pk_gfe_emprestimo on tb_gfe_emprestimo epr (cost=0.43..0.56 rows=1 width=35) (actual time=0.007..0.007 rows=1 loops=13)

  • Index Cond: (tb_gcc_limite_devedor.lid_nro_contrato = epr_nro_contrato)
  • Buffers: shared hit=48
13. 0.104 0.104 ↑ 1.0 1 13

Index Scan using pk_gcc_conta_corrente on tb_gcc_conta_corrente cct (cost=0.43..0.47 rows=1 width=14) (actual time=0.008..0.008 rows=1 loops=13)

  • Index Cond: ((cct_cod_cooperativa = tb_gcc_limite_devedor.lid_cod_cooperativa) AND (cct_nro_conta = tb_gcc_limite_devedor.lid_nro_conta))
  • Buffers: shared hit=52
14.          

CTE saldo_cc_atual

15. 0.003 1.734 ↑ 1.0 1 1

Limit (cost=39.22..39.23 rows=1 width=8) (actual time=1.733..1.734 rows=1 loops=1)

  • Buffers: shared hit=833
16. 0.314 1.731 ↑ 33.0 1 1

Sort (cost=39.22..39.31 rows=33 width=8) (actual time=1.731..1.731 rows=1 loops=1)

  • Sort Key: tb_gcc_saldo_cc.scc_data DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=833
17. 0.306 1.417 ↓ 51.0 1,682 1

Nested Loop (cost=0.57..39.06 rows=33 width=8) (actual time=0.032..1.417 rows=1,682 loops=1)

  • Buffers: shared hit=833
18. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros parametros_1 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=1 loops=1)

19. 1.110 1.110 ↓ 51.0 1,682 1

Index Scan using ui_gcc_saldo_cc_01 on tb_gcc_saldo_cc (cost=0.57..38.71 rows=33 width=18) (actual time=0.027..1.110 rows=1,682 loops=1)

  • Index Cond: ((scc_cod_cooperativa = parametros_1.cod_coop) AND (scc_nro_conta = parametros_1.nro_conta) AND (scc_data <= parametros_1.data_gea))
  • Buffers: shared hit=833
20.          

CTE ultimo_saldo_cc

21. 0.000 6.530 ↑ 1.0 1 1

Limit (cost=39.22..39.23 rows=1 width=52) (actual time=6.530..6.530 rows=1 loops=1)

  • Buffers: shared hit=836
22. 1.002 6.530 ↑ 33.0 1 1

Sort (cost=39.22..39.31 rows=33 width=52) (actual time=6.530..6.530 rows=1 loops=1)

  • Sort Key: tb_gcc_saldo_cc_1.scc_data DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=836
23. 0.412 5.528 ↓ 51.0 1,682 1

Nested Loop (cost=0.57..39.06 rows=33 width=52) (actual time=0.071..5.528 rows=1,682 loops=1)

  • Buffers: shared hit=833
24. 0.006 0.006 ↑ 1.0 1 1

CTE Scan on parametros parametros_2 (cost=0.00..0.02 rows=1 width=68) (actual time=0.005..0.006 rows=1 loops=1)

25. 5.110 5.110 ↓ 51.0 1,682 1

Index Scan using ui_gcc_saldo_cc_01 on tb_gcc_saldo_cc tb_gcc_saldo_cc_1 (cost=0.57..38.71 rows=33 width=58) (actual time=0.062..5.110 rows=1,682 loops=1)

  • Index Cond: ((scc_cod_cooperativa = parametros_2.cod_coop) AND (scc_nro_conta = parametros_2.nro_conta) AND (scc_data <= parametros_2.data_final))
  • Buffers: shared hit=833
26.          

CTE verificar_ultimo_saldo_colmeia_e_atual

27. 0.005 1.748 ↑ 1.0 1 1

Aggregate (cost=0.06..0.07 rows=1 width=8) (actual time=1.748..1.748 rows=1 loops=1)

  • Buffers: shared hit=833
28. 0.008 1.743 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=4) (actual time=1.741..1.743 rows=1 loops=1)

  • Join Filter: (saldo_cc_atual.codigo_saldo_atual = ultimo_saldo_cc.scc_cod_saldo_cc)
  • Buffers: shared hit=833
29. 1.734 1.734 ↑ 1.0 1 1

CTE Scan on saldo_cc_atual (cost=0.00..0.02 rows=1 width=4) (actual time=1.733..1.734 rows=1 loops=1)

  • Buffers: shared hit=833
30. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1)

31.          

CTE ultimo_saldo_mes_anterior

32. 0.001 1.991 ↑ 1.0 1 1

Limit (cost=39.22..39.23 rows=1 width=11) (actual time=1.990..1.991 rows=1 loops=1)

  • Buffers: shared hit=830
33. 0.367 1.990 ↑ 33.0 1 1

Sort (cost=39.22..39.31 rows=33 width=11) (actual time=1.990..1.990 rows=1 loops=1)

  • Sort Key: tb_gcc_saldo_cc_2.scc_data DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=830
34. 0.290 1.623 ↓ 50.7 1,672 1

Nested Loop (cost=0.57..39.06 rows=33 width=11) (actual time=0.030..1.623 rows=1,672 loops=1)

  • Buffers: shared hit=830
35. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros parametros_3 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=1 loops=1)

36. 1.332 1.332 ↓ 50.7 1,672 1

Index Scan using ui_gcc_saldo_cc_01 on tb_gcc_saldo_cc tb_gcc_saldo_cc_2 (cost=0.57..38.71 rows=33 width=21) (actual time=0.027..1.332 rows=1,672 loops=1)

  • Index Cond: ((scc_cod_cooperativa = parametros_3.cod_coop) AND (scc_nro_conta = parametros_3.nro_conta) AND (scc_data <= parametros_3.ultimo_dia_mes_anterior))
  • Buffers: shared hit=830
37.          

CTE saldo_maior_data

38. 0.003 29.704 ↑ 1.0 1 1

Limit (cost=6.35..7.13 rows=1 width=103) (actual time=29.703..29.704 rows=1 loops=1)

  • Buffers: shared hit=925
39. 29.654 29.701 ↑ 4.0 1 1

Result (cost=6.35..9.46 rows=4 width=103) (actual time=29.701..29.701 rows=1 loops=1)

  • Buffers: shared hit=925
40. 0.010 0.047 ↑ 4.0 1 1

Sort (cost=6.35..6.36 rows=4 width=116) (actual time=0.047..0.047 rows=1 loops=1)

  • Sort Key: saldo.scc_data DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Buffers: shared hit=7
41. 0.008 0.037 ↓ 2.5 10 1

Nested Loop Left Join (cost=0.57..6.33 rows=4 width=116) (actual time=0.021..0.037 rows=10 loops=1)

  • Buffers: shared hit=7
42. 0.007 0.029 ↓ 2.5 10 1

Nested Loop Left Join (cost=0.57..6.24 rows=4 width=60) (actual time=0.019..0.029 rows=10 loops=1)

  • Buffers: shared hit=7
43. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on parametros parametros_4 (cost=0.00..0.02 rows=1 width=80) (actual time=0.000..0.000 rows=1 loops=1)

44. 0.022 0.022 ↓ 2.5 10 1

Index Scan using ui_gcc_saldo_cc_01 on tb_gcc_saldo_cc saldo (cost=0.57..6.18 rows=4 width=30) (actual time=0.016..0.022 rows=10 loops=1)

  • Index Cond: ((scc_cod_cooperativa = parametros_4.cod_coop) AND (scc_nro_conta = parametros_4.nro_conta) AND (scc_data <= parametros_4.data_gea) AND (scc_data >= parametros_4.primeiro_dia_mes) AND (scc_data <= parametros_4.ultimo_dia_mes))
  • Buffers: shared hit=7
45. 0.000 0.000 ↑ 1.0 1 10

CTE Scan on ultimo_saldo_cc ultimo_saldo (cost=0.00..0.02 rows=1 width=56) (actual time=0.000..0.000 rows=1 loops=10)

46.          

CTE juros_meses

47. 0.001 31.701 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.08 rows=1 width=128) (actual time=31.699..31.701 rows=1 loops=1)

  • Buffers: shared hit=1,755
48. 0.002 29.708 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=64) (actual time=29.707..29.708 rows=1 loops=1)

  • Buffers: shared hit=925
49. 29.706 29.706 ↑ 1.0 1 1

CTE Scan on saldo_maior_data (cost=0.00..0.02 rows=1 width=64) (actual time=29.705..29.706 rows=1 loops=1)

  • Buffers: shared hit=925
50. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on parametros parametros_5 (cost=0.00..0.02 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)

51. 1.992 1.992 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_mes_anterior ultimo_saldo_anterior (cost=0.00..0.02 rows=1 width=36) (actual time=1.991..1.992 rows=1 loops=1)

  • Buffers: shared hit=830
52.          

CTE transitorias_juros_acumulado

53. 0.018 134.991 ↑ 1.0 1 1

Aggregate (cost=77.41..77.42 rows=1 width=32) (actual time=134.991..134.991 rows=1 loops=1)

  • Buffers: shared hit=4,787
54. 133.336 134.973 ↓ 6.0 6 1

Nested Loop (cost=2.27..77.40 rows=1 width=10) (actual time=20.298..134.973 rows=6 loops=1)

  • Join Filter: (((quantidade_dias_uteis_cooperativa(parametros_6.primeiro_dia_mes, parametros_6.data_final, (parametros_6.cod_coop)::integer) <= parametros_6.dias_uteis_consolidacao_saldo) AND (trn.trn_dt_movimento <= parametros_6.ultimo_dia_mes_anterior)) OR ((quantidade_dias_uteis_cooperativa(parametros_6.primeiro_dia_mes, parametros_6.data_final, (parametros_6.cod_coop)::integer) > parametros_6.dias_uteis_consolidacao_saldo) AND (trn.trn_dt_movimento <= parametros_6.data_gea)))
  • Rows Removed by Join Filter: 1
  • Buffers: shared hit=4,787
55. 0.010 0.786 ↓ 37.0 37 1

Nested Loop (cost=1.70..74.14 rows=1 width=64) (actual time=0.460..0.786 rows=37 loops=1)

  • Buffers: shared hit=318
56. 0.024 0.154 ↓ 2.0 2 1

Nested Loop (cost=1.00..13.53 rows=1 width=85) (actual time=0.071..0.154 rows=2 loops=1)

  • Buffers: shared hit=74
57. 0.003 0.042 ↓ 2.0 2 1

Nested Loop (cost=0.43..2.69 rows=1 width=68) (actual time=0.014..0.042 rows=2 loops=1)

  • Buffers: shared hit=33
58. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on parametros parametros_6 (cost=0.00..0.02 rows=1 width=88) (actual time=0.000..0.000 rows=1 loops=1)

59. 0.039 0.039 ↓ 2.0 2 1

Index Scan using ix_emprestimo_01 on tb_gfe_emprestimo epr_1 (cost=0.43..2.66 rows=1 width=22) (actual time=0.012..0.039 rows=2 loops=1)

  • Index Cond: ((epr_cod_cooperativa = parametros_6.cod_coop) AND (epr_nro_conta = parametros_6.nro_conta))
  • Filter: (epr_cod_operacao = 2,005)
  • Rows Removed by Filter: 28
  • Buffers: shared hit=33
60. 0.088 0.088 ↑ 10.0 1 2

Index Only Scan using ix_gfe_parcelas_emprestimo_02 on tb_gfe_parcelas_emprestimo pae (cost=0.56..10.75 rows=10 width=17) (actual time=0.026..0.044 rows=1 loops=2)

  • Index Cond: ((pae_nro_contrato = epr_1.epr_nro_contrato) AND (pae_situacao = ANY ('{6255,7207,7208,7374}'::integer[])))
  • Heap Fetches: 0
  • Buffers: shared hit=38
61. 0.622 0.622 ↓ 2.0 18 2

Index Only Scan using ix_gfe_transitoria_emprestimo_01 on tb_gfe_transitoria_emprestimo tem (cost=0.70..60.52 rows=9 width=24) (actual time=0.258..0.311 rows=18 loops=2)

  • Index Cond: ((tem_nro_contrato = pae.pae_nro_contrato) AND (tem_nro_parcela < 99950))
  • Filter: (pae.pae_nro_parcela = (tem_nro_parcela)::numeric)
  • Rows Removed by Filter: 196
  • Heap Fetches: 2
  • Buffers: shared hit=244
62. 0.851 0.851 ↓ 0.0 0 37

Index Scan using pk_gco_transitoria on tb_gco_transitoria trn (cost=0.58..2.74 rows=1 width=22) (actual time=0.023..0.023 rows=0 loops=37)

  • Index Cond: (trn_cod_transitoria = tem.tem_cod_transitoria)
  • Filter: ((trn_situacao <> 2068) AND (trn_cod_oper_central = ANY ('{1504,1507,1508}'::integer[])))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=185
63.          

CTE transitorias_juros_adiantamento

64. 0.078 702.240 ↑ 1.0 1 1

Aggregate (cost=77.41..77.42 rows=1 width=32) (actual time=702.240..702.240 rows=1 loops=1)

  • Buffers: shared hit=23,142
65. 700.532 702.162 ↓ 36.0 36 1

Nested Loop (cost=2.27..77.40 rows=1 width=10) (actual time=19.742..702.162 rows=36 loops=1)

  • Join Filter: (((quantidade_dias_uteis_cooperativa(parametros_7.primeiro_dia_mes, parametros_7.data_final, (parametros_7.cod_coop)::integer) <= parametros_7.dias_uteis_consolidacao_saldo) AND (trn_1.trn_dt_movimento <= parametros_7.ultimo_dia_mes_anterior)) OR ((quantidade_dias_uteis_cooperativa(parametros_7.primeiro_dia_mes, parametros_7.data_final, (parametros_7.cod_coop)::integer) > parametros_7.dias_uteis_consolidacao_saldo) AND (trn_1.trn_dt_movimento <= parametros_7.data_gea)))
  • Rows Removed by Join Filter: 1
  • Buffers: shared hit=23,142
66. 0.029 0.298 ↓ 74.0 74 1

Nested Loop (cost=1.70..74.14 rows=1 width=64) (actual time=0.073..0.298 rows=74 loops=1)

  • Buffers: shared hit=127
67. 0.005 0.073 ↓ 2.0 2 1

Nested Loop (cost=1.00..13.53 rows=1 width=85) (actual time=0.055..0.073 rows=2 loops=1)

  • Buffers: shared hit=51
68. 0.003 0.037 ↑ 1.0 1 1

Nested Loop (cost=0.43..2.69 rows=1 width=68) (actual time=0.036..0.037 rows=1 loops=1)

  • Buffers: shared hit=33
69. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros parametros_7 (cost=0.00..0.02 rows=1 width=88) (actual time=0.001..0.001 rows=1 loops=1)

70. 0.033 0.033 ↑ 1.0 1 1

Index Scan using ix_emprestimo_01 on tb_gfe_emprestimo epr_2 (cost=0.43..2.66 rows=1 width=22) (actual time=0.032..0.033 rows=1 loops=1)

  • Index Cond: ((epr_cod_cooperativa = parametros_7.cod_coop) AND (epr_nro_conta = parametros_7.nro_conta))
  • Filter: (epr_cod_operacao = 1,580)
  • Rows Removed by Filter: 29
  • Buffers: shared hit=33
71. 0.031 0.031 ↑ 5.0 2 1

Index Only Scan using ix_gfe_parcelas_emprestimo_02 on tb_gfe_parcelas_emprestimo pae_1 (cost=0.56..10.75 rows=10 width=17) (actual time=0.015..0.031 rows=2 loops=1)

  • Index Cond: ((pae_nro_contrato = epr_2.epr_nro_contrato) AND (pae_situacao = ANY ('{6255,7207,7208,7374}'::integer[])))
  • Heap Fetches: 0
  • Buffers: shared hit=18
72. 0.196 0.196 ↓ 4.1 37 2

Index Only Scan using ix_gfe_transitoria_emprestimo_01 on tb_gfe_transitoria_emprestimo tem_1 (cost=0.70..60.52 rows=9 width=24) (actual time=0.032..0.098 rows=37 loops=2)

  • Index Cond: ((tem_nro_contrato = pae_1.pae_nro_contrato) AND (tem_nro_parcela < 99950))
  • Filter: (pae_1.pae_nro_parcela = (tem_nro_parcela)::numeric)
  • Rows Removed by Filter: 37
  • Heap Fetches: 4
  • Buffers: shared hit=76
73. 1.332 1.332 ↓ 0.0 0 74

Index Scan using pk_gco_transitoria on tb_gco_transitoria trn_1 (cost=0.58..2.73 rows=1 width=22) (actual time=0.018..0.018 rows=0 loops=74)

  • Index Cond: (trn_cod_transitoria = tem_1.tem_cod_transitoria)
  • Filter: (trn_cod_oper_central = ANY ('{1504,1507,1508}'::integer[]))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=371
74.          

CTE transitorias_iof

75. 0.046 328.437 ↑ 1.0 1 1

Aggregate (cost=9.95..9.96 rows=1 width=32) (actual time=328.436..328.437 rows=1 loops=1)

  • Buffers: shared hit=10,831
76. 327.248 328.391 ↓ 16.0 16 1

Nested Loop (cost=2.28..9.94 rows=1 width=10) (actual time=29.873..328.391 rows=16 loops=1)

  • Join Filter: (((quantidade_dias_uteis_cooperativa(param.primeiro_dia_mes, param.data_final, (param.cod_coop)::integer) <= param.dias_uteis_consolidacao_saldo) AND (trn_2.trn_dt_movimento <= param.ultimo_dia_mes_anterior)) OR ((quantidade_dias_uteis_cooperativa(param.primeiro_dia_mes, param.data_final, (param.cod_coop)::integer) > param.dias_uteis_consolidacao_saldo) AND (trn_2.trn_dt_movimento <= param.data_gea)))
  • Buffers: shared hit=10,831
77. 0.053 0.647 ↓ 16.0 16 1

Nested Loop (cost=1.70..6.67 rows=1 width=64) (actual time=0.375..0.647 rows=16 loops=1)

  • Join Filter: (epr_3.epr_nro_contrato = pae_2.pae_nro_contrato)
  • Buffers: shared hit=114
78. 0.013 0.418 ↓ 16.0 16 1

Nested Loop (cost=1.13..4.83 rows=1 width=92) (actual time=0.319..0.418 rows=16 loops=1)

  • Buffers: shared hit=49
79. 0.004 0.251 ↑ 1.0 1 1

Nested Loop (cost=0.43..2.69 rows=1 width=68) (actual time=0.250..0.251 rows=1 loops=1)

  • Buffers: shared hit=33
80. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on parametros param (cost=0.00..0.02 rows=1 width=88) (actual time=0.000..0.000 rows=1 loops=1)

81. 0.247 0.247 ↑ 1.0 1 1

Index Scan using ix_emprestimo_01 on tb_gfe_emprestimo epr_3 (cost=0.43..2.66 rows=1 width=22) (actual time=0.246..0.247 rows=1 loops=1)

  • Index Cond: ((epr_cod_cooperativa = param.cod_coop) AND (epr_nro_conta = param.nro_conta))
  • Filter: (epr_cod_operacao = 1,580)
  • Rows Removed by Filter: 29
  • Buffers: shared hit=33
82. 0.154 0.154 ↓ 1.3 16 1

Index Only Scan using ix_gfe_transitoria_emprestimo_01 on tb_gfe_transitoria_emprestimo tem_2 (cost=0.70..2.02 rows=12 width=24) (actual time=0.063..0.154 rows=16 loops=1)

  • Index Cond: ((tem_nro_contrato = epr_3.epr_nro_contrato) AND (tem_nro_parcela = 99,997))
  • Heap Fetches: 0
  • Buffers: shared hit=16
83. 0.176 0.176 ↑ 1.0 1 16

Index Only Scan using ix_gfe_parcelas_emprestimo_02 on tb_gfe_parcelas_emprestimo pae_2 (cost=0.57..1.83 rows=1 width=17) (actual time=0.011..0.011 rows=1 loops=16)

  • Index Cond: ((pae_nro_contrato = tem_2.tem_nro_contrato) AND (pae_nro_parcela = (tem_2.tem_nro_parcela)::numeric))
  • Filter: (pae_situacao = ANY ('{6255,7207,7208,7374}'::integer[]))
  • Heap Fetches: 0
  • Buffers: shared hit=65
84. 0.496 0.496 ↑ 1.0 1 16

Index Scan using pk_gco_transitoria on tb_gco_transitoria trn_2 (cost=0.58..2.74 rows=1 width=22) (actual time=0.030..0.031 rows=1 loops=16)

  • Index Cond: (trn_cod_transitoria = tem_2.tem_cod_transitoria)
  • Filter: ((trn_situacao = 2,068) AND (trn_cod_oper_central = ANY ('{1504,1507,1508}'::integer[])))
  • Buffers: shared hit=80
85.          

CTE calculo_juros_saldo

86. 0.001 888.533 ↑ 1.0 2 1

Append (cost=0.00..0.71 rows=2 width=68) (actual time=176.486..888.533 rows=2 loops=1)

  • Buffers: shared hit=30,296
87. 9.789 176.489 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.35 rows=1 width=68) (actual time=176.486..176.489 rows=1 loops=1)

  • Buffers: shared hit=6,848
88. 0.004 31.708 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=104) (actual time=31.705..31.708 rows=1 loops=1)

  • Buffers: shared hit=1,755
89. 31.704 31.704 ↑ 1.0 1 1

CTE Scan on juros_meses (cost=0.00..0.02 rows=1 width=64) (actual time=31.702..31.704 rows=1 loops=1)

  • Buffers: shared hit=1,755
90. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on parametros parametros_8 (cost=0.00..0.02 rows=1 width=40) (actual time=0.000..0.000 rows=1 loops=1)

91. 134.992 134.992 ↑ 1.0 1 1

CTE Scan on transitorias_juros_acumulado (cost=0.00..0.02 rows=1 width=32) (actual time=134.992..134.992 rows=1 loops=1)

  • Buffers: shared hit=4,787
92. 9.798 712.043 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.34 rows=1 width=68) (actual time=712.042..712.043 rows=1 loops=1)

  • Buffers: shared hit=23,448
93. 0.001 0.003 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=104) (actual time=0.002..0.003 rows=1 loops=1)

94. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on juros_meses juros_meses_1 (cost=0.00..0.02 rows=1 width=64) (actual time=0.000..0.000 rows=1 loops=1)

95. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on parametros parametros_9 (cost=0.00..0.02 rows=1 width=40) (actual time=0.001..0.002 rows=1 loops=1)

96. 702.242 702.242 ↑ 1.0 1 1

CTE Scan on transitorias_juros_adiantamento (cost=0.00..0.02 rows=1 width=32) (actual time=702.242..702.242 rows=1 loops=1)

  • Buffers: shared hit=23,142
97.          

CTE totalizador_juros

98. 0.004 0.004 ↑ 1.0 1 1

Aggregate (cost=0.05..0.06 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=1)

99. 0.000 0.000 ↑ 1.0 2 1

CTE Scan on calculo_juros_saldo (cost=0.00..0.04 rows=2 width=32) (actual time=0.000..0.000 rows=2 loops=1)

100.          

CTE debitos_pendentes

101. 0.002 1.975 ↑ 1.0 1 1

Result (cost=6.68..6.69 rows=1 width=68) (actual time=1.975..1.975 rows=1 loops=1)

  • Buffers: shared hit=391
102.          

Initplan (for Result)

103. 0.000 1.973 ↓ 0.0 0 1

GroupAggregate (cost=6.65..6.68 rows=1 width=46) (actual time=1.973..1.973 rows=0 loops=1)

  • Group Key: tb_gfe_convenio_debito_auto.cda_nro_conta, tb_gfe_convenio_debito_auto.cda_cod_cooperativa, tb_gcc_conta_corrente.cct_bloqueio_debito
  • Buffers: shared hit=391
104. 0.029 1.973 ↓ 0.0 0 1

Sort (cost=6.65..6.65 rows=1 width=18) (actual time=1.973..1.973 rows=0 loops=1)

  • Sort Key: tb_gfe_convenio_debito_auto.cda_nro_conta, tb_gfe_convenio_debito_auto.cda_cod_cooperativa, tb_gcc_conta_corrente.cct_bloqueio_debito
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=391
105. 0.041 1.944 ↓ 0.0 0 1

Nested Loop (cost=1.55..6.64 rows=1 width=18) (actual time=1.944..1.944 rows=0 loops=1)

  • Join Filter: (tb_gfe_registro_debito_auto.rda_dt_vencimento <= parametros_10.data_gea)
  • Rows Removed by Join Filter: 92
  • Buffers: shared hit=388
106. 0.025 0.337 ↓ 27.0 54 1

Nested Loop (cost=0.99..4.12 rows=2 width=22) (actual time=0.067..0.337 rows=54 loops=1)

  • Buffers: shared hit=42
107. 0.003 0.017 ↑ 1.0 1 1

Nested Loop (cost=0.43..2.68 rows=1 width=82) (actual time=0.015..0.017 rows=1 loops=1)

  • Buffers: shared hit=4
108. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros parametros_10 (cost=0.00..0.02 rows=1 width=68) (actual time=0.000..0.001 rows=1 loops=1)

109. 0.013 0.013 ↑ 1.0 1 1

Index Scan using pk_gcc_conta_corrente on tb_gcc_conta_corrente (cost=0.43..2.65 rows=1 width=14) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: ((cct_cod_cooperativa = parametros_10.cod_coop) AND (cct_nro_conta = parametros_10.nro_conta))
  • Filter: (cct_bloqueio_debito <> 4517)
  • Buffers: shared hit=4
110. 0.295 0.295 ↓ 10.8 54 1

Index Scan using ix_gfe_convenio_debito_auto_01 on tb_gfe_convenio_debito_auto (cost=0.56..1.39 rows=5 width=14) (actual time=0.047..0.295 rows=54 loops=1)

  • Index Cond: ((cda_cod_cooperativa = tb_gcc_conta_corrente.cct_cod_cooperativa) AND (cda_nro_conta = tb_gcc_conta_corrente.cct_nro_conta))
  • Buffers: shared hit=38
111. 1.566 1.566 ↑ 3.5 2 54

Index Scan using ix_gfe_registro_debito_auto_01 on tb_gfe_registro_debito_auto (cost=0.56..1.17 rows=7 width=12) (actual time=0.021..0.029 rows=2 loops=54)

  • Index Cond: (rda_cod_convenio = tb_gfe_convenio_debito_auto.cda_cod_convenio)
  • Filter: (rda_situacao = 6,685)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=346
112.          

CTE saldo_iof

113. 0.005 328.444 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=68) (actual time=328.443..328.444 rows=1 loops=1)

  • Buffers: shared hit=10,831
114. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_1 (cost=0.00..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=1 loops=1)

115. 328.438 328.438 ↑ 1.0 1 1

CTE Scan on transitorias_iof (cost=0.00..0.02 rows=1 width=32) (actual time=328.437..328.438 rows=1 loops=1)

  • Buffers: shared hit=10,831
116.          

CTE saldo_para_saque

117. 0.008 0.021 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.15 rows=1 width=68) (actual time=0.019..0.021 rows=1 loops=1)

118. 0.002 0.013 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.11 rows=1 width=114) (actual time=0.012..0.013 rows=1 loops=1)

119. 0.002 0.011 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.08 rows=1 width=82) (actual time=0.010..0.011 rows=1 loops=1)

120. 0.002 0.004 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=50) (actual time=0.003..0.004 rows=1 loops=1)

121. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_2 (cost=0.00..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=1 loops=1)

122. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual (cost=0.00..0.02 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=1)

123. 0.005 0.005 ↑ 1.0 1 1

CTE Scan on totalizador_juros (cost=0.00..0.02 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

124. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on saldo_iof (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

125. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on debitos_pendentes (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

126.          

CTE saldos_bloqueados

127. 0.001 0.050 ↑ 1.0 2 1

Unique (cost=0.07..0.09 rows=2 width=54) (actual time=0.049..0.050 rows=2 loops=1)

  • Buffers: shared hit=3
128. 0.046 0.049 ↑ 1.0 2 1

Sort (cost=0.07..0.08 rows=2 width=54) (actual time=0.048..0.049 rows=2 loops=1)

  • Sort Key: ('(+) Saldo Bloqueado 24 hrs'::character varying), ultimo_saldo_cc_3.scc_vl_saldo_bloqueado, (8)
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=3
129. 0.000 0.003 ↑ 1.0 2 1

Append (cost=0.00..0.06 rows=2 width=54) (actual time=0.002..0.003 rows=2 loops=1)

130. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_3 (cost=0.00..0.02 rows=1 width=54) (actual time=0.002..0.002 rows=1 loops=1)

131. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_4 (cost=0.00..0.02 rows=1 width=54) (actual time=0.001..0.001 rows=1 loops=1)

132.          

CTE saldo_bloqueado_judicial

133. 0.004 0.004 ↑ 1.0 1 1

CTE Scan on saldo_maior_data saldo_maior_data_1 (cost=0.00..0.02 rows=1 width=104) (actual time=0.003..0.004 rows=1 loops=1)

134.          

CTE dados_cheque_especial

135. 0.006 0.017 ↑ 3.0 2 1

HashAggregate (cost=0.29..0.35 rows=6 width=104) (actual time=0.016..0.017 rows=2 loops=1)

  • Group Key: ('Cheque Especial Taxa Mensal'::character varying), (round(COALESCE(limite_devedor_atual_1.epr_tx_juros_am, 0.00), 2)), ('%'::character varying), (4), (5)
136. 0.001 0.011 ↑ 3.0 2 1

Append (cost=0.00..0.21 rows=6 width=104) (actual time=0.004..0.011 rows=2 loops=1)

137. 0.003 0.003 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_1 (cost=0.00..0.02 rows=1 width=104) (actual time=0.003..0.003 rows=1 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NULL) OR (epr_tx_juros_am = epr_tx_juros_padrao_am))
138. 0.003 0.003 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_2 (cost=0.00..0.02 rows=1 width=104) (actual time=0.003..0.003 rows=1 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NULL) OR (epr_tx_juros_am = epr_tx_juros_padrao_am))
139. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on limite_devedor_atual limite_devedor_atual_3 (cost=0.00..0.02 rows=1 width=104) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NOT NULL) AND (epr_tx_juros_am <> epr_tx_juros_padrao_am))
  • Rows Removed by Filter: 1
140. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on limite_devedor_atual limite_devedor_atual_4 (cost=0.00..0.02 rows=1 width=104) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NOT NULL) AND (epr_tx_juros_am <> epr_tx_juros_padrao_am))
  • Rows Removed by Filter: 1
141. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on limite_devedor_atual limite_devedor_atual_5 (cost=0.00..0.02 rows=1 width=104) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NOT NULL) AND (epr_tx_juros_am <> epr_tx_juros_padrao_am))
  • Rows Removed by Filter: 1
142. 0.001 0.001 ↓ 0.0 0 1

CTE Scan on limite_devedor_atual limite_devedor_atual_6 (cost=0.00..0.02 rows=1 width=104) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((cct_desconto_tx_juros_limite_credito IS NOT NULL) AND (epr_tx_juros_am <> epr_tx_juros_padrao_am))
  • Rows Removed by Filter: 1
143.          

CTE dados_extrato_cet

144. 0.003 0.015 ↑ 1.0 2 1

Unique (cost=0.08..0.11 rows=2 width=104) (actual time=0.014..0.015 rows=2 loops=1)

145. 0.006 0.012 ↑ 1.0 2 1

Sort (cost=0.08..0.08 rows=2 width=104) (actual time=0.012..0.012 rows=2 loops=1)

  • Sort Key: ('CET-Custo Efetivo Total Mensal'::text), (round(limite_devedor_atual_7.lid_vl_tx_cet_am, 2)), ('%'::character varying), (4), (3)
  • Sort Method: quicksort Memory: 25kB
146. 0.001 0.006 ↑ 1.0 2 1

Append (cost=0.00..0.07 rows=2 width=104) (actual time=0.003..0.006 rows=2 loops=1)

147. 0.003 0.003 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_7 (cost=0.00..0.02 rows=1 width=104) (actual time=0.003..0.003 rows=1 loops=1)

  • Filter: (lid_vl_tx_cet_am IS NOT NULL)
148. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_8 (cost=0.00..0.02 rows=1 width=104) (actual time=0.002..0.002 rows=1 loops=1)

  • Filter: (lid_vl_tx_cet_aa IS NOT NULL)
149.          

CTE saldo_total

150. 0.012 0.019 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.16 rows=1 width=104) (actual time=0.017..0.019 rows=1 loops=1)

151. 0.002 0.007 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.11 rows=1 width=114) (actual time=0.006..0.007 rows=1 loops=1)

152. 0.001 0.005 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.08 rows=1 width=82) (actual time=0.004..0.005 rows=1 loops=1)

153. 0.003 0.004 ↑ 1.0 1 1

Nested Loop (cost=0.00..0.05 rows=1 width=50) (actual time=0.003..0.004 rows=1 loops=1)

154. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_5 (cost=0.00..0.02 rows=1 width=18) (actual time=0.001..0.001 rows=1 loops=1)

155. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_9 (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

156. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on totalizador_juros totalizador_juros_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

157. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on saldo_iof saldo_iof_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

158. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on debitos_pendentes debitos_pendentes_1 (cost=0.00..0.02 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1)

159.          

CTE consultas_debitos_automaticos

160. 0.007 0.850 ↓ 4.0 4 1

Sort (cost=17.02..17.02 rows=1 width=80) (actual time=0.848..0.850 rows=4 loops=1)

  • Sort Key: ((row_number() OVER (?))::integer)
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=428
161. 0.121 0.843 ↓ 4.0 4 1

WindowAgg (cost=16.97..17.01 rows=1 width=80) (actual time=0.829..0.843 rows=4 loops=1)

  • Buffers: shared hit=428
162. 0.010 0.722 ↓ 4.0 4 1

Sort (cost=16.97..16.98 rows=1 width=46) (actual time=0.719..0.722 rows=4 loops=1)

  • Sort Key: tb_gfe_registro_debito_auto_1.rda_dt_vencimento
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=428
163. 0.003 0.712 ↓ 4.0 4 1

Nested Loop (cost=2.24..16.96 rows=1 width=46) (actual time=0.129..0.712 rows=4 loops=1)

  • Buffers: shared hit=428
164. 0.006 0.633 ↓ 4.0 4 1

Nested Loop (cost=1.82..16.49 rows=1 width=30) (actual time=0.101..0.633 rows=4 loops=1)

  • Buffers: shared hit=412
165. 0.008 0.555 ↓ 4.0 4 1

Nested Loop (cost=1.40..14.01 rows=1 width=17) (actual time=0.074..0.555 rows=4 loops=1)

  • Buffers: shared hit=396
166. 0.040 0.507 ↓ 4.0 4 1

Nested Loop (cost=1.13..13.71 rows=1 width=17) (actual time=0.045..0.507 rows=4 loops=1)

  • Join Filter: ((tb_gfe_registro_debito_auto_1.rda_dt_vencimento > parametros_11.data_final) AND (tb_gfe_registro_debito_auto_1.rda_dt_vencimento < parametros_11.data_final_mais_60_dias))
  • Rows Removed by Join Filter: 88
  • Buffers: shared hit=384
167. 0.014 0.089 ↓ 10.8 54 1

Nested Loop (cost=0.56..7.33 rows=5 width=21) (actual time=0.030..0.089 rows=54 loops=1)

  • Buffers: shared hit=38
168. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on parametros parametros_11 (cost=0.00..0.02 rows=1 width=72) (actual time=0.001..0.001 rows=1 loops=1)

169. 0.074 0.074 ↓ 10.8 54 1

Index Scan using ix_gfe_convenio_debito_auto_01 on tb_gfe_convenio_debito_auto tb_gfe_convenio_debito_auto_1 (cost=0.56..7.26 rows=5 width=23) (actual time=0.026..0.074 rows=54 loops=1)

  • Index Cond: ((cda_cod_cooperativa = parametros_11.cod_coop) AND (cda_nro_conta = parametros_11.nro_conta))
  • Buffers: shared hit=38
170. 0.378 0.378 ↑ 3.5 2 54

Index Scan using ix_gfe_registro_debito_auto_01 on tb_gfe_registro_debito_auto tb_gfe_registro_debito_auto_1 (cost=0.56..1.17 rows=7 width=12) (actual time=0.005..0.007 rows=2 loops=54)

  • Index Cond: (rda_cod_convenio = tb_gfe_convenio_debito_auto_1.cda_cod_convenio)
  • Filter: (rda_situacao = ANY ('{6685,6688}'::integer[]))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=346
171. 0.040 0.040 ↑ 1.0 1 4

Index Scan using pk_gfe_mod_debito_auto on tb_gfe_mod_debito_auto (cost=0.27..0.29 rows=1 width=18) (actual time=0.010..0.010 rows=1 loops=4)

  • Index Cond: ((mdb_cod_oper_parametro = tb_gfe_convenio_debito_auto_1.cda_cod_oper_moddebauto) AND (mdb_cod_coop_parametro = tb_gfe_convenio_debito_auto_1.cda_cod_coop_moddebauto))
  • Buffers: shared hit=12
172. 0.072 0.072 ↑ 1.0 1 4

Index Scan using pk_gfe_mod_conta_corrente on tb_gfe_mod_conta_corrente (cost=0.42..2.47 rows=1 width=13) (actual time=0.018..0.018 rows=1 loops=4)

  • Index Cond: ((mcc_cod_cooperativa = tb_gfe_mod_debito_auto.mdb_cod_coop_lancdebito) AND (mcc_cod_operacao = tb_gfe_mod_debito_auto.mdb_cod_oper_lancdebito))
  • Buffers: shared hit=16
173. 0.076 0.076 ↑ 1.0 1 4

Index Scan using pk_gfe_parametro on tb_gfe_parametro (cost=0.42..0.47 rows=1 width=43) (actual time=0.019..0.019 rows=1 loops=4)

  • Index Cond: ((par_cod_cooperativa = tb_gfe_mod_conta_corrente.mcc_cod_cooperativa) AND (par_cod_operacao = tb_gfe_mod_conta_corrente.mcc_cod_operacao))
  • Buffers: shared hit=16
174.          

CTE consulta_totalizadores

175. 0.051 1,228.830 ↑ 1.1 19 1

Sort (cost=1.70..1.75 rows=20 width=144) (actual time=1,228.829..1,228.830 rows=19 loops=1)

  • Sort Key: (3), ultimo_saldo_cc_6.ordem
  • Sort Method: quicksort Memory: 27kB
  • Buffers: shared hit=43,736
176. 0.041 1,228.779 ↑ 1.1 19 1

HashAggregate (cost=1.07..1.27 rows=20 width=144) (actual time=1,228.776..1,228.779 rows=19 loops=1)

  • Group Key: ('(=) Saldo'::character varying), ultimo_saldo_cc_6.scc_vl_saldo_disponivel, (CASE WHEN (ultimo_saldo_cc_6.scc_vl_saldo_disponivel >= '0'::numeric) THEN 'C'::text ELSE 'D'::text END), (3), ultimo_saldo_cc_6.ordem, ($76), ('SALDO'::text)
  • Buffers: shared hit=43,733
177. 0.005 1,228.738 ↑ 1.1 19 1

Append (cost=0.02..0.72 rows=20 width=144) (actual time=8.290..1,228.738 rows=19 loops=1)

  • Buffers: shared hit=43,733
178. 6.542 8.290 ↑ 1.0 1 1

CTE Scan on ultimo_saldo_cc ultimo_saldo_cc_6 (cost=0.02..0.04 rows=1 width=130) (actual time=8.290..8.290 rows=1 loops=1)

  • Buffers: shared hit=1,669
179.          

Initplan (for CTE Scan)

180. 1.748 1.748 ↑ 1.0 1 1

CTE Scan on verificar_ultimo_saldo_colmeia_e_atual verificar_ultimo_saldo_colmeia_e_atual_2 (cost=0.00..0.02 rows=1 width=8) (actual time=1.748..1.748 rows=1 loops=1)

  • Buffers: shared hit=833
181. 0.003 0.451 ↑ 1.0 1 1

Subquery Scan on *SELECT* 2 (cost=0.00..0.04 rows=1 width=144) (actual time=0.451..0.451 rows=1 loops=1)

  • Buffers: shared hit=115
182. 0.448 0.448 ↑ 1.0 1 1

CTE Scan on limite_devedor_atual limite_devedor_atual_10 (cost=0.00..0.02 rows=1 width=140) (actual time=0.448..0.448 rows=1 loops=1)

  • Buffers: shared hit=115
183. 0.010 1.987 ↑ 1.0 1 1

Subquery Scan on *SELECT* 3 (cost=0.00..0.03 rows=1 width=144) (actual time=1.986..1.987 rows=1 loops=1)

  • Buffers: shared hit=391
184. 1.977 1.977 ↑ 1.0 1 1

CTE Scan on debitos_pendentes debitos_pendentes_2 (cost=0.00..0.02 rows=1 width=140) (actual time=1.977..1.977 rows=1 loops=1)

  • Buffers: shared hit=391
185. 0.001 328.446 ↑ 1.0 1 1

Subquery Scan on *SELECT* 4 (cost=0.00..0.03 rows=1 width=144) (actual time=328.445..328.446 rows=1 loops=1)

  • Buffers: shared hit=10,831
186. 328.445 328.445 ↑ 1.0 1 1

CTE Scan on saldo_iof saldo_iof_2 (cost=0.00..0.02 rows=1 width=140) (actual time=328.444..328.445 rows=1 loops=1)

  • Buffers: shared hit=10,831
187. 0.004 888.544 ↑ 1.0 2 1

Subquery Scan on *SELECT* 5 (cost=0.00..0.07 rows=2 width=144) (actual time=176.493..888.544 rows=2 loops=1)

  • Buffers: shared hit=30,296
188. 888.540 888.540 ↑ 1.0 2 1

CTE Scan on calculo_juros_saldo calculo_juros_saldo_1 (cost=0.00..0.04 rows=2 width=140) (actual time=176.490..888.540 rows=2 loops=1)

  • Buffers: shared hit=30,296
189. 0.027 0.028 ↑ 1.0 1 1

CTE Scan on saldo_para_saque (cost=0.02..0.04 rows=1 width=144) (actual time=0.026..0.028 rows=1 loops=1)

190.          

Initplan (for CTE Scan)

191. 0.001 0.001 ↑ 1.0 1 1

CTE Scan on verificar_ultimo_saldo_colmeia_e_atual verificar_ultimo_saldo_colmeia_e_atual_1 (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=1)

192. 0.004 0.059 ↑ 1.0 2 1

Subquery Scan on *SELECT* 7 (cost=0.00..0.07 rows=2 width=130) (actual time=0.056..0.059 rows=2 loops=1)

  • Buffers: shared hit=3
193. 0.055 0.055 ↑ 1.0 2 1

CTE Scan on saldos_bloqueados (cost=0.00..0.04 rows=2 width=126) (actual time=0.053..0.055 rows=2 loops=1)

  • Buffers: shared hit=3
194. 0.023 0.023 ↑ 1.0 1 1

CTE Scan on saldo_total (cost=0.02..0.04 rows=1 width=144) (actual time=0.021..0.023 rows=1 loops=1)

195.          

Initplan (for CTE Scan)

196. 0.000 0.000 ↑ 1.0 1 1

CTE Scan on verificar_ultimo_saldo_colmeia_e_atual (cost=0.00..0.02 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=1)

197. 0.002 0.008 ↑ 1.0 1 1

Subquery Scan on *SELECT* 9 (cost=0.00..0.03 rows=1 width=144) (actual time=0.007..0.008 rows=1 loops=1)

198. 0.006 0.006 ↑ 1.0 1 1

CTE Scan on saldo_bloqueado_judicial (cost=0.00..0.02 rows=1 width=140) (actual time=0.005..0.006 rows=1 loops=1)

199. 0.002 0.022 ↑ 3.0 2 1

Subquery Scan on *SELECT* 10 (cost=0.00..0.20 rows=6 width=144) (actual time=0.020..0.022 rows=2 loops=1)

200. 0.020 0.020 ↑ 3.0 2 1

CTE Scan on dados_cheque_especial (cost=0.00..0.12 rows=6 width=140) (actual time=0.018..0.020 rows=2 loops=1)

201. 0.002 0.019 ↑ 1.0 2 1

Subquery Scan on *SELECT* 11 (cost=0.00..0.07 rows=2 width=144) (actual time=0.016..0.019 rows=2 loops=1)

202. 0.017 0.017 ↑ 1.0 2 1

CTE Scan on dados_extrato_cet (cost=0.00..0.04 rows=2 width=140) (actual time=0.015..0.017 rows=2 loops=1)

203. 0.003 0.856 ↓ 4.0 4 1

Subquery Scan on *SELECT* 12 (cost=0.00..0.03 rows=1 width=130) (actual time=0.852..0.856 rows=4 loops=1)

  • Buffers: shared hit=428
204. 0.853 0.853 ↓ 4.0 4 1

CTE Scan on consultas_debitos_automaticos (cost=0.00..0.02 rows=1 width=126) (actual time=0.850..0.853 rows=4 loops=1)

  • Buffers: shared hit=428
Planning time : 82.524 ms
Execution time : 1,230.807 ms