explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0vbi

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 3.417 ↑ 128.0 1 1

Sort (cost=1,475.80..1,476.12 rows=128 width=109) (actual time=3.417..3.417 rows=1 loops=1)

  • Sort Key: tb_cntrt.nu_contrato
  • Sort Method: quicksort Memory: 25kB
2. 0.030 3.402 ↑ 128.0 1 1

Hash Left Join (cost=1,456.74..1,471.32 rows=128 width=109) (actual time=3.397..3.402 rows=1 loops=1)

  • Hash Cond: (tb_cntrt.id_contrato = cntrt.id_contrato)
3. 0.018 3.280 ↑ 128.0 1 1

Hash Left Join (cost=1,444.14..1,453.76 rows=128 width=101) (actual time=3.276..3.280 rows=1 loops=1)

  • Hash Cond: (tb_cntrt.id_contrato = vw_sld_em_faturamento.contrato)
4. 0.036 1.745 ↑ 8.0 1 1

Hash Left Join (cost=708.15..716.46 rows=8 width=93) (actual time=1.741..1.745 rows=1 loops=1)

  • Hash Cond: (tb_cntrt.id_contrato = vw_sld_pago.contrato)
5. 0.002 1.213 ↑ 4.0 1 1

Nested Loop Left Join (cost=515.94..524.15 rows=4 width=85) (actual time=1.210..1.213 rows=1 loops=1)

  • Join Filter: (tb_cntrt.id_contrato = vw_sld_liquidado.contrato)
6. 0.002 1.015 ↑ 2.0 1 1

Nested Loop Left Join (cost=352.30..360.43 rows=2 width=77) (actual time=1.013..1.015 rows=1 loops=1)

  • Join Filter: (tb_cntrt.id_contrato = tb_cntrt_3.id_contrato)
7. 0.002 0.777 ↑ 1.0 1 1

Nested Loop Left Join (cost=172.75..180.83 rows=1 width=69) (actual time=0.775..0.777 rows=1 loops=1)

  • Join Filter: (tb_cntrt.id_contrato = tb_cntrt_2.id_contrato)
8. 0.002 0.232 ↑ 1.0 1 1

Nested Loop Left Join (cost=91.38..99.43 rows=1 width=37) (actual time=0.231..0.232 rows=1 loops=1)

  • Join Filter: (tb_cntrt.id_contrato = tb_cntrt_1.id_contrato)
9. 0.015 0.015 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt (cost=0.27..8.29 rows=1 width=29) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
10. 0.025 0.215 ↑ 1.0 1 1

Sort (cost=91.11..91.12 rows=1 width=31) (actual time=0.215..0.215 rows=1 loops=1)

  • Sort Key: tb_cntrt_1.nu_contrato
  • Sort Method: quicksort Memory: 25kB
11. 0.014 0.190 ↑ 1.0 1 1

Nested Loop Left Join (cost=18.81..91.10 rows=1 width=31) (actual time=0.187..0.190 rows=1 loops=1)

  • Join Filter: (tb_cntrt_1.id_contrato = cntrt_3.id_contrato)
12. 0.001 0.077 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.67..52.54 rows=1 width=59) (actual time=0.075..0.077 rows=1 loops=1)

  • Join Filter: (tb_cntrt_1.id_contrato = cntrt_2.id_contrato)
13. 0.003 0.054 ↑ 1.0 1 1

Nested Loop Left Join (cost=5.11..34.57 rows=1 width=55) (actual time=0.053..0.054 rows=1 loops=1)

  • Join Filter: (tb_cntrt_1.id_contrato = cntrt_1.id_contrato)
14. 0.007 0.007 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_1 (cost=0.27..8.29 rows=1 width=23) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
15. 0.001 0.044 ↓ 0.0 0 1

GroupAggregate (cost=4.84..26.26 rows=1 width=55) (actual time=0.044..0.044 rows=0 loops=1)

  • Group Key: cntrt_1.id_contrato
16. 0.000 0.043 ↓ 0.0 0 1

Nested Loop (cost=4.84..26.24 rows=1 width=31) (actual time=0.043..0.043 rows=0 loops=1)

17. 0.002 0.043 ↓ 0.0 0 1

Nested Loop (cost=4.56..17.94 rows=1 width=31) (actual time=0.043..0.043 rows=0 loops=1)

18. 0.008 0.008 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_1 (cost=0.27..8.29 rows=1 width=23) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
19. 0.011 0.033 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc (cost=4.29..9.64 rows=1 width=16) (actual time=0.033..0.033 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = 2)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
20. 0.022 0.022 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.022..0.022 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc (cost=0.28..8.29 rows=1 width=16) (never executed)

  • Index Cond: (id_autorizacao_faturamento = trzc.id_autorizacao_faturamento)
22. 0.001 0.022 ↓ 0.0 0 1

GroupAggregate (cost=4.56..17.95 rows=1 width=27) (actual time=0.022..0.022 rows=0 loops=1)

  • Group Key: cntrt_2.id_contrato
23. 0.001 0.021 ↓ 0.0 0 1

Nested Loop (cost=4.56..17.94 rows=1 width=27) (actual time=0.021..0.021 rows=0 loops=1)

24. 0.016 0.016 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_2 (cost=0.27..8.29 rows=1 width=23) (actual time=0.015..0.016 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
25. 0.002 0.004 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_1 (cost=4.29..9.64 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{1,2}'::integer[]))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
26. 0.002 0.002 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
27. 0.000 0.099 ↓ 0.0 0 1

GroupAggregate (cost=9.14..38.52 rows=1 width=55) (actual time=0.099..0.099 rows=0 loops=1)

  • Group Key: cntrt_3.id_contrato
28. 0.000 0.099 ↓ 0.0 0 1

Nested Loop (cost=9.14..38.51 rows=1 width=39) (actual time=0.099..0.099 rows=0 loops=1)

29. 0.001 0.099 ↓ 0.0 0 1

Nested Loop (cost=8.86..30.20 rows=1 width=39) (actual time=0.099..0.099 rows=0 loops=1)

30. 0.002 0.098 ↓ 0.0 0 1

Nested Loop (cost=8.59..21.90 rows=1 width=24) (actual time=0.098..0.098 rows=0 loops=1)

  • Join Filter: (ftrmnt.id_autorizacao_faturamento = trzc_2.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 17
31. 0.030 0.062 ↓ 5.7 17 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt (cost=4.30..12.17 rows=3 width=8) (actual time=0.037..0.062 rows=17 loops=1)

  • Recheck Cond: (in_situacao_faturamento = 1)
  • Heap Blocks: exact=8
32. 0.032 0.032 ↓ 5.7 17 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.032..0.032 rows=17 loops=1)

  • Index Cond: (in_situacao_faturamento = 1)
33. 0.024 0.034 ↑ 2.0 1 17

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.001..0.002 rows=1 loops=17)

34. 0.004 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_2 (cost=4.29..9.64 rows=2 width=16) (actual time=0.010..0.010 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
35. 0.006 0.006 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_3 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
37. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_1 (cost=0.28..8.29 rows=1 width=24) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt.id_autorizacao_faturamento)
38. 0.013 0.543 ↑ 1.0 1 1

Sort (cost=81.37..81.38 rows=1 width=55) (actual time=0.543..0.543 rows=1 loops=1)

  • Sort Key: tb_cntrt_2.nu_contrato
  • Sort Method: quicksort Memory: 25kB
39. 0.009 0.530 ↑ 1.0 1 1

Nested Loop Left Join (cost=20.43..81.36 rows=1 width=55) (actual time=0.528..0.530 rows=1 loops=1)

  • Join Filter: (tb_cntrt_2.id_contrato = cntrt_5.id_contrato)
40. 0.001 0.320 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.35..44.84 rows=1 width=55) (actual time=0.319..0.320 rows=1 loops=1)

  • Join Filter: (tb_cntrt_2.id_contrato = cntrt_4.id_contrato)
41. 0.010 0.010 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_2 (cost=0.27..8.29 rows=1 width=23) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
42. 0.031 0.309 ↑ 1.0 1 1

GroupAggregate (cost=10.08..36.53 rows=1 width=55) (actual time=0.309..0.309 rows=1 loops=1)

  • Group Key: cntrt_4.id_contrato
43. 0.003 0.278 ↓ 6.5 13 1

Nested Loop (cost=10.08..36.51 rows=2 width=30) (actual time=0.129..0.278 rows=13 loops=1)

44. 0.007 0.007 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_4 (cost=0.27..8.29 rows=1 width=23) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
45. 0.021 0.268 ↓ 6.5 13 1

Nested Loop (cost=9.81..28.20 rows=2 width=15) (actual time=0.122..0.268 rows=13 loops=1)

46. 0.049 0.177 ↓ 1.8 14 1

Hash Join (cost=9.54..23.86 rows=8 width=33) (actual time=0.099..0.177 rows=14 loops=1)

  • Hash Cond: (rdmtm.id_ordem_servico = rdm.id_ordem_servico)
47. 0.103 0.103 ↓ 1.0 261 1

Seq Scan on tb_rdm_srvc_tm_cntrt rdmtm (cost=0.00..13.66 rows=250 width=17) (actual time=0.008..0.103 rows=261 loops=1)

  • Filter: (id_autorizacao_faturamento IS NULL)
  • Rows Removed by Filter: 305
48. 0.005 0.025 ↑ 1.4 8 1

Hash (cost=9.40..9.40 rows=11 width=16) (actual time=0.025..0.025 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
49. 0.010 0.020 ↑ 1.4 8 1

Bitmap Heap Scan on tb_rdm_srvc rdm (cost=4.23..9.40 rows=11 width=16) (actual time=0.016..0.020 rows=8 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao_os = ANY ('{2,3}'::bpchar[]))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=2
50. 0.010 0.010 ↑ 1.2 9 1

Bitmap Index Scan on tb_rdm_srvc_tb_cntrt_ix (cost=0.00..4.23 rows=11 width=0) (actual time=0.010..0.010 rows=9 loops=1)

  • Index Cond: (id_contrato = 340352)
51. 0.070 0.070 ↑ 1.0 1 14

Index Scan using tb_fs_rdm_srvc_pkey on tb_fs_rdm_srvc fas (cost=0.27..0.54 rows=1 width=10) (actual time=0.005..0.005 rows=1 loops=14)

  • Index Cond: ((id_ordem_servico = rdmtm.id_ordem_servico) AND (nu_fase = rdmtm.nu_fase))
  • Filter: (in_situacao_os = ANY ('{2,3,6,7,8,D,A}'::bpchar[]))
  • Rows Removed by Filter: 0
52. 0.000 0.201 ↓ 0.0 0 1

GroupAggregate (cost=10.08..36.49 rows=1 width=55) (actual time=0.201..0.201 rows=0 loops=1)

  • Group Key: cntrt_5.id_contrato
53. 0.000 0.201 ↓ 0.0 0 1

Nested Loop (cost=10.08..36.48 rows=1 width=30) (actual time=0.201..0.201 rows=0 loops=1)

54. 0.004 0.201 ↓ 0.0 0 1

Nested Loop (cost=9.81..28.18 rows=1 width=15) (actual time=0.201..0.201 rows=0 loops=1)

55. 0.042 0.155 ↓ 1.8 14 1

Hash Join (cost=9.54..23.86 rows=8 width=33) (actual time=0.100..0.155 rows=14 loops=1)

  • Hash Cond: (rdmtm_1.id_ordem_servico = rdm_1.id_ordem_servico)
56. 0.083 0.083 ↓ 1.0 261 1

Seq Scan on tb_rdm_srvc_tm_cntrt rdmtm_1 (cost=0.00..13.66 rows=250 width=17) (actual time=0.005..0.083 rows=261 loops=1)

  • Filter: (id_autorizacao_faturamento IS NULL)
  • Rows Removed by Filter: 305
57. 0.010 0.030 ↑ 1.4 8 1

Hash (cost=9.40..9.40 rows=11 width=16) (actual time=0.030..0.030 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
58. 0.011 0.020 ↑ 1.4 8 1

Bitmap Heap Scan on tb_rdm_srvc rdm_1 (cost=4.23..9.40 rows=11 width=16) (actual time=0.014..0.020 rows=8 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao_os = ANY ('{2,3}'::bpchar[]))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=2
59. 0.009 0.009 ↑ 1.2 9 1

Bitmap Index Scan on tb_rdm_srvc_tb_cntrt_ix (cost=0.00..4.23 rows=11 width=0) (actual time=0.009..0.009 rows=9 loops=1)

  • Index Cond: (id_contrato = 340352)
60. 0.042 0.042 ↓ 0.0 0 14

Index Scan using tb_fs_rdm_srvc_pkey on tb_fs_rdm_srvc fas_1 (cost=0.27..0.54 rows=1 width=10) (actual time=0.003..0.003 rows=0 loops=14)

  • Index Cond: ((id_ordem_servico = rdmtm_1.id_ordem_servico) AND (nu_fase = rdmtm_1.nu_fase))
  • Filter: (in_situacao_os = '4'::bpchar)
  • Rows Removed by Filter: 1
61. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_5 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
62. 0.018 0.236 ↑ 2.0 1 1

Sort (cost=179.55..179.55 rows=2 width=31) (actual time=0.236..0.236 rows=1 loops=1)

  • Sort Key: tb_cntrt_3.nu_contrato
  • Sort Method: quicksort Memory: 25kB
63. 0.006 0.218 ↑ 2.0 1 1

Nested Loop Left Join (cost=89.37..179.54 rows=2 width=31) (actual time=0.216..0.218 rows=1 loops=1)

  • Join Filter: (tb_cntrt_3.id_contrato = a.contrato)
64. 0.003 0.131 ↑ 1.0 1 1

Nested Loop Left Join (cost=31.56..121.63 rows=1 width=67) (actual time=0.130..0.131 rows=1 loops=1)

  • Join Filter: (tb_cntrt_3.id_contrato = cntrt_8.id_contrato)
65. 0.007 0.111 ↑ 1.0 1 1

Nested Loop Left Join (cost=26.87..92.95 rows=1 width=59) (actual time=0.109..0.111 rows=1 loops=1)

  • Join Filter: (tb_cntrt_3.id_contrato = cntrt_7.id_contrato)
66. 0.005 0.025 ↑ 1.0 1 1

Nested Loop Left Join (cost=13.43..47.25 rows=1 width=27) (actual time=0.024..0.025 rows=1 loops=1)

  • Join Filter: (tb_cntrt_3.id_contrato = cntrt_6.id_contrato)
67. 0.012 0.012 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_3 (cost=0.27..8.29 rows=1 width=23) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
68. 0.000 0.008 ↓ 0.0 0 1

GroupAggregate (cost=13.16..38.94 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

  • Group Key: cntrt_6.id_contrato
69. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=13.16..38.93 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

70. 0.001 0.008 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.63 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=1)

  • Join Filter: (ftrmnt_1.id_autorizacao_faturamento = trzc_3.id_autorizacao_faturamento)
71. 0.003 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_3 (cost=4.29..9.64 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
72. 0.004 0.004 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
73. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_1 (cost=8.60..20.90 rows=7 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
74. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
75. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_6 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
76. 0.001 0.079 ↓ 0.0 0 1

GroupAggregate (cost=13.43..45.68 rows=1 width=55) (actual time=0.079..0.079 rows=0 loops=1)

  • Group Key: cntrt_7.id_contrato
77. 0.000 0.078 ↓ 0.0 0 1

Nested Loop (cost=13.43..45.64 rows=1 width=45) (actual time=0.078..0.078 rows=0 loops=1)

78. 0.000 0.078 ↓ 0.0 0 1

Nested Loop (cost=13.16..39.06 rows=1 width=39) (actual time=0.078..0.078 rows=0 loops=1)

79. 0.000 0.078 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.76 rows=1 width=24) (actual time=0.078..0.078 rows=0 loops=1)

  • Join Filter: (ftrmnt_2.id_autorizacao_faturamento = trzc_4.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 35
80. 0.015 0.045 ↓ 5.0 35 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_2 (cost=8.60..20.90 rows=7 width=8) (actual time=0.034..0.045 rows=35 loops=1)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
  • Heap Blocks: exact=8
81. 0.030 0.030 ↓ 5.0 35 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (actual time=0.030..0.030 rows=35 loops=1)

  • Index Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
82. 0.023 0.035 ↑ 2.0 1 35

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.001..0.001 rows=1 loops=35)

83. 0.007 0.012 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_4 (cost=4.29..9.64 rows=2 width=16) (actual time=0.012..0.012 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
84. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
85. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_7 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
86. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_2 (cost=0.28..6.58 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_2.id_autorizacao_faturamento)
87. 0.001 0.017 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.017..0.017 rows=0 loops=1)

  • Group Key: cntrt_8.id_contrato
88. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.016..0.016 rows=0 loops=1)

  • Join Filter: (ftrmnt_3.id_faturamento = splh.id_faturamento)
89. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.016..0.016 rows=0 loops=1)

90. 0.000 0.016 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_3 (cost=4.30..12.18 rows=1 width=16) (actual time=0.016..0.016 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])) AND (nu_processo_compra = 340352))
91. 0.016 0.016 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
92. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_8 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
93. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh (cost=0.12..8.14 rows=1 width=16) (never executed)

94. 0.000 0.081 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.081..0.081 rows=0 loops=1)

  • Group Key: a.contrato, a.numero_contrato
95. 0.010 0.081 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.081..0.081 rows=0 loops=1)

  • Sort Key: a.numero_contrato
  • Sort Method: quicksort Memory: 25kB
96. 0.000 0.071 ↓ 0.0 0 1

Subquery Scan on a (cost=57.75..57.80 rows=2 width=194) (actual time=0.071..0.071 rows=0 loops=1)

97. 0.001 0.071 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.071..0.071 rows=0 loops=1)

98. 0.016 0.070 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.070..0.070 rows=0 loops=1)

  • Sort Key: "*SELECT* 1".id_faturamento, "*SELECT* 1".contrato, "*SELECT* 1".numero_contrato, (("*SELECT* 1".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
99. 0.001 0.054 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.054..0.054 rows=0 loops=1)

100. 0.000 0.043 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=29.02..29.08 rows=1 width=39) (actual time=0.043..0.043 rows=0 loops=1)

101. 0.001 0.043 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.043..0.043 rows=0 loops=1)

  • Group Key: ftrmnt_4.id_faturamento, cntrt_9.id_contrato
102. 0.007 0.042 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.042..0.042 rows=0 loops=1)

  • Sort Key: ftrmnt_4.id_faturamento
  • Sort Method: quicksort Memory: 25kB
103. 0.001 0.035 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.035..0.035 rows=0 loops=1)

104. 0.000 0.034 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.034..0.034 rows=0 loops=1)

105. 0.000 0.034 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.034..0.034 rows=0 loops=1)

106. 0.013 0.034 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_4 (cost=4.30..12.19 rows=1 width=16) (actual time=0.034..0.034 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
107. 0.021 0.021 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.021..0.021 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
108. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_9 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
109. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_4.id_faturamento)
110. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl.id_faturamento)
111. 0.001 0.010 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.010..0.010 rows=0 loops=1)

  • Group Key: ftrmnt_5.id_faturamento, cntrt_10.id_contrato
112. 0.000 0.009 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.009..0.009 rows=0 loops=1)

  • Join Filter: (ftrmnt_5.id_faturamento = splh_1.id_faturamento)
113. 0.009 0.009 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_1 (cost=0.12..8.14 rows=1 width=16) (actual time=0.009..0.009 rows=0 loops=1)

114. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_5 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])))
116. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
117. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_10 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
118. 0.005 0.196 ↑ 2.0 1 1

Materialize (cost=163.63..163.67 rows=2 width=16) (actual time=0.195..0.196 rows=1 loops=1)

119. 0.001 0.191 ↑ 2.0 1 1

Subquery Scan on vw_sld_liquidado (cost=163.63..163.66 rows=2 width=16) (actual time=0.190..0.191 rows=1 loops=1)

120. 0.015 0.190 ↑ 2.0 1 1

Sort (cost=163.63..163.64 rows=2 width=31) (actual time=0.189..0.190 rows=1 loops=1)

  • Sort Key: tb_cntrt_4.nu_contrato
  • Sort Method: quicksort Memory: 25kB
121. 0.006 0.175 ↑ 2.0 1 1

Nested Loop Left Join (cost=80.77..163.62 rows=2 width=31) (actual time=0.173..0.175 rows=1 loops=1)

  • Join Filter: (tb_cntrt_4.id_contrato = a_1.contrato)
122. 0.004 0.113 ↑ 1.0 1 1

Nested Loop Left Join (cost=22.97..105.71 rows=1 width=67) (actual time=0.111..0.113 rows=1 loops=1)

  • Join Filter: (tb_cntrt_4.id_contrato = cntrt_13.id_contrato)
123. 0.004 0.105 ↑ 1.0 1 1

Nested Loop Left Join (cost=18.27..77.04 rows=1 width=59) (actual time=0.103..0.105 rows=1 loops=1)

  • Join Filter: (tb_cntrt_4.id_contrato = cntrt_12.id_contrato)
124. 0.006 0.090 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.41..46.85 rows=1 width=55) (actual time=0.088..0.090 rows=1 loops=1)

  • Join Filter: (tb_cntrt_4.id_contrato = cntrt_11.id_contrato)
125. 0.023 0.023 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_4 (cost=0.27..8.29 rows=1 width=23) (actual time=0.022..0.023 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
126. 0.001 0.061 ↓ 0.0 0 1

GroupAggregate (cost=9.14..38.54 rows=1 width=55) (actual time=0.061..0.061 rows=0 loops=1)

  • Group Key: cntrt_11.id_contrato
127. 0.000 0.060 ↓ 0.0 0 1

Nested Loop (cost=9.14..38.51 rows=1 width=45) (actual time=0.060..0.060 rows=0 loops=1)

128. 0.000 0.060 ↓ 0.0 0 1

Nested Loop (cost=8.86..30.20 rows=1 width=39) (actual time=0.060..0.060 rows=0 loops=1)

129. 0.008 0.060 ↓ 0.0 0 1

Nested Loop (cost=8.59..21.90 rows=1 width=24) (actual time=0.060..0.060 rows=0 loops=1)

  • Join Filter: (ftrmnt_6.id_autorizacao_faturamento = trzc_5.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 20
130. 0.017 0.032 ↓ 6.7 20 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_6 (cost=4.30..12.17 rows=3 width=8) (actual time=0.020..0.032 rows=20 loops=1)

  • Recheck Cond: (in_situacao_faturamento = 22)
  • Heap Blocks: exact=8
131. 0.015 0.015 ↓ 6.7 20 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.015..0.015 rows=20 loops=1)

  • Index Cond: (in_situacao_faturamento = 22)
132. 0.012 0.020 ↑ 2.0 1 20

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.001..0.001 rows=1 loops=20)

133. 0.004 0.008 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_5 (cost=4.29..9.64 rows=2 width=16) (actual time=0.008..0.008 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
134. 0.004 0.004 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
135. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_11 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
136. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_3 (cost=0.28..8.29 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_6.id_autorizacao_faturamento)
137. 0.000 0.011 ↓ 0.0 0 1

GroupAggregate (cost=8.86..30.16 rows=1 width=27) (actual time=0.011..0.011 rows=0 loops=1)

  • Group Key: cntrt_12.id_contrato
138. 0.000 0.011 ↓ 0.0 0 1

Nested Loop (cost=8.86..30.15 rows=1 width=27) (actual time=0.011..0.011 rows=0 loops=1)

139. 0.000 0.011 ↓ 0.0 0 1

Nested Loop (cost=8.59..21.85 rows=1 width=12) (actual time=0.011..0.011 rows=0 loops=1)

  • Join Filter: (ftrmnt_7.id_autorizacao_faturamento = trzc_6.id_autorizacao_faturamento)
140. 0.003 0.011 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_6 (cost=4.29..9.64 rows=1 width=20) (actual time=0.011..0.011 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
141. 0.008 0.008 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
142. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_7 (cost=4.30..12.17 rows=3 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = 22)
143. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = 22)
144. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_12 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
145. 0.000 0.004 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.004..0.004 rows=0 loops=1)

  • Group Key: cntrt_13.id_contrato
146. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: (ftrmnt_8.id_faturamento = splh_2.id_faturamento)
147. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.004..0.004 rows=0 loops=1)

148. 0.001 0.004 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_8 (cost=4.30..12.18 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (nu_processo_compra = 340352) AND (in_situacao_faturamento = 22))
149. 0.003 0.003 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
150. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_13 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
151. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh_2 (cost=0.12..8.14 rows=1 width=16) (never executed)

152. 0.000 0.056 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.056..0.056 rows=0 loops=1)

  • Group Key: a_1.contrato, a_1.numero_contrato
153. 0.011 0.056 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.056..0.056 rows=0 loops=1)

  • Sort Key: a_1.numero_contrato
  • Sort Method: quicksort Memory: 25kB
154. 0.001 0.045 ↓ 0.0 0 1

Subquery Scan on a_1 (cost=57.75..57.80 rows=2 width=194) (actual time=0.045..0.045 rows=0 loops=1)

155. 0.000 0.044 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.044..0.044 rows=0 loops=1)

156. 0.013 0.044 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.044..0.044 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_1".id_faturamento, "*SELECT* 1_1".contrato, "*SELECT* 1_1".numero_contrato, (("*SELECT* 1_1".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
157. 0.000 0.031 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.031..0.031 rows=0 loops=1)

158. 0.000 0.018 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_1 (cost=29.02..29.08 rows=1 width=39) (actual time=0.018..0.018 rows=0 loops=1)

159. 0.001 0.018 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.018..0.018 rows=0 loops=1)

  • Group Key: ftrmnt_9.id_faturamento, cntrt_14.id_contrato
160. 0.007 0.017 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.017..0.017 rows=0 loops=1)

  • Sort Key: ftrmnt_9.id_faturamento
  • Sort Method: quicksort Memory: 25kB
161. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.010..0.010 rows=0 loops=1)

162. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.010..0.010 rows=0 loops=1)

163. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.010..0.010 rows=0 loops=1)

164. 0.006 0.010 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_9 (cost=4.30..12.19 rows=1 width=16) (actual time=0.010..0.010 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = 22) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
165. 0.004 0.004 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
166. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_14 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
167. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_1 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_9.id_faturamento)
168. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_1 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_1.id_faturamento)
169. 0.001 0.013 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.013..0.013 rows=0 loops=1)

  • Group Key: ftrmnt_10.id_faturamento, cntrt_15.id_contrato
170. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.012..0.012 rows=0 loops=1)

  • Join Filter: (ftrmnt_10.id_faturamento = splh_3.id_faturamento)
171. 0.012 0.012 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_3 (cost=0.12..8.14 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

172. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

173. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_10 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = 22))
174. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
175. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_15 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
176. 0.014 0.496 ↑ 2.0 1 1

Hash (cost=192.19..192.19 rows=2 width=16) (actual time=0.496..0.496 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
177. 0.002 0.482 ↑ 2.0 1 1

Subquery Scan on vw_sld_pago (cost=192.16..192.19 rows=2 width=16) (actual time=0.481..0.482 rows=1 loops=1)

178. 0.021 0.480 ↑ 2.0 1 1

Sort (cost=192.16..192.17 rows=2 width=31) (actual time=0.480..0.480 rows=1 loops=1)

  • Sort Key: tb_cntrt_5.nu_contrato
  • Sort Method: quicksort Memory: 25kB
179. 0.006 0.459 ↑ 2.0 1 1

Nested Loop Left Join (cost=89.91..192.15 rows=2 width=31) (actual time=0.455..0.459 rows=1 loops=1)

  • Join Filter: (tb_cntrt_5.id_contrato = a_2.contrato)
180. 0.005 0.419 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.11..134.23 rows=1 width=70) (actual time=0.416..0.419 rows=1 loops=1)

  • Join Filter: (tb_cntrt_5.id_contrato = cntrt_19.id_contrato)
181. 0.005 0.407 ↑ 1.0 1 1

Nested Loop Left Join (cost=27.41..105.56 rows=1 width=62) (actual time=0.403..0.407 rows=1 loops=1)

  • Join Filter: (tb_cntrt_5.id_contrato = cntrt_18.id_contrato)
182. 0.003 0.073 ↑ 1.0 1 1

Nested Loop Left Join (cost=13.98..59.86 rows=1 width=30) (actual time=0.070..0.073 rows=1 loops=1)

  • Join Filter: (tb_cntrt_5.id_contrato = cntrt_17.id_contrato)
183. 0.002 0.062 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.82..20.89 rows=1 width=26) (actual time=0.059..0.062 rows=1 loops=1)

  • Join Filter: (tb_cntrt_5.id_contrato = cntrt_16.id_contrato)
184. 0.010 0.010 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_5 (cost=0.27..8.29 rows=1 width=23) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
185. 0.002 0.050 ↑ 1.0 1 1

Nested Loop (cost=0.55..12.59 rows=1 width=11) (actual time=0.048..0.050 rows=1 loops=1)

186. 0.025 0.025 ↑ 1.0 1 1

Index Only Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_16 (cost=0.27..4.29 rows=1 width=8) (actual time=0.024..0.025 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
  • Heap Fetches: 1
187. 0.023 0.023 ↑ 1.0 1 1

Index Scan using tb_vl_tlzd_pr_vtr_id_contrato_idx on tb_vl_tlzd_pr_vtr pre_1 (cost=0.27..8.29 rows=1 width=11) (actual time=0.023..0.023 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
188. 0.000 0.008 ↓ 0.0 0 1

GroupAggregate (cost=13.16..38.94 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

  • Group Key: cntrt_17.id_contrato
189. 0.001 0.008 ↓ 0.0 0 1

Nested Loop (cost=13.16..38.93 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

190. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.63 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (ftrmnt_11.id_autorizacao_faturamento = trzc_7.id_autorizacao_faturamento)
191. 0.002 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_7 (cost=4.29..9.64 rows=1 width=20) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
192. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
193. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_11 (cost=8.60..20.90 rows=7 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
194. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
195. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_17 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
196. 0.000 0.329 ↓ 0.0 0 1

GroupAggregate (cost=13.43..45.68 rows=1 width=55) (actual time=0.329..0.329 rows=0 loops=1)

  • Group Key: cntrt_18.id_contrato
197. 0.000 0.329 ↓ 0.0 0 1

Nested Loop (cost=13.43..45.64 rows=1 width=45) (actual time=0.329..0.329 rows=0 loops=1)

198. 0.001 0.329 ↓ 0.0 0 1

Nested Loop (cost=13.16..39.06 rows=1 width=39) (actual time=0.329..0.329 rows=0 loops=1)

199. 0.207 0.328 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.76 rows=1 width=24) (actual time=0.328..0.328 rows=0 loops=1)

  • Join Filter: (ftrmnt_12.id_autorizacao_faturamento = trzc_8.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 406
200. 0.089 0.121 ↓ 58.0 406 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_12 (cost=8.60..20.90 rows=7 width=8) (actual time=0.039..0.121 rows=406 loops=1)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
  • Heap Blocks: exact=14
201. 0.032 0.032 ↓ 58.0 406 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (actual time=0.031..0.032 rows=406 loops=1)

  • Index Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
202. 0.000 0.000 ↑ 2.0 1 406

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.000..0.000 rows=1 loops=406)

203. 0.004 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_8 (cost=4.29..9.64 rows=2 width=16) (actual time=0.009..0.010 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
204. 0.006 0.006 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
205. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_18 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
206. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_4 (cost=0.28..6.58 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_12.id_autorizacao_faturamento)
207. 0.000 0.007 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

  • Group Key: cntrt_19.id_contrato
208. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (ftrmnt_13.id_faturamento = splh_4.id_faturamento)
209. 0.001 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

210. 0.000 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_13 (cost=4.30..12.18 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])) AND (nu_processo_compra = 340352))
211. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
212. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_19 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
213. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh_4 (cost=0.12..8.14 rows=1 width=16) (never executed)

214. 0.001 0.034 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.034..0.034 rows=0 loops=1)

  • Group Key: a_2.contrato, a_2.numero_contrato
215. 0.008 0.033 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.033..0.033 rows=0 loops=1)

  • Sort Key: a_2.numero_contrato
  • Sort Method: quicksort Memory: 25kB
216. 0.000 0.025 ↓ 0.0 0 1

Subquery Scan on a_2 (cost=57.75..57.80 rows=2 width=194) (actual time=0.025..0.025 rows=0 loops=1)

217. 0.000 0.025 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.025..0.025 rows=0 loops=1)

218. 0.006 0.025 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.025..0.025 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_2".id_faturamento, "*SELECT* 1_2".contrato, "*SELECT* 1_2".numero_contrato, (("*SELECT* 1_2".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
219. 0.001 0.019 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.019..0.019 rows=0 loops=1)

220. 0.000 0.012 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_2 (cost=29.02..29.08 rows=1 width=39) (actual time=0.012..0.012 rows=0 loops=1)

221. 0.000 0.012 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.012..0.012 rows=0 loops=1)

  • Group Key: ftrmnt_14.id_faturamento, cntrt_20.id_contrato
222. 0.005 0.012 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.012..0.012 rows=0 loops=1)

  • Sort Key: ftrmnt_14.id_faturamento
  • Sort Method: quicksort Memory: 25kB
223. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.007..0.007 rows=0 loops=1)

224. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.007..0.007 rows=0 loops=1)

225. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

226. 0.002 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_14 (cost=4.30..12.19 rows=1 width=16) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
227. 0.005 0.005 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
228. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_20 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
229. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_2 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_14.id_faturamento)
230. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_2 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_2.id_faturamento)
231. 0.000 0.006 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.006..0.006 rows=0 loops=1)

  • Group Key: ftrmnt_15.id_faturamento, cntrt_21.id_contrato
232. 0.001 0.006 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.006..0.006 rows=0 loops=1)

  • Join Filter: (ftrmnt_15.id_faturamento = splh_5.id_faturamento)
233. 0.005 0.005 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_5 (cost=0.12..8.14 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=1)

234. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

235. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_15 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])))
236. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
237. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_21 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
238. 0.002 1.517 ↑ 16.0 1 1

Hash (cost=735.79..735.79 rows=16 width=16) (actual time=1.517..1.517 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
239. 0.001 1.515 ↑ 16.0 1 1

Subquery Scan on vw_sld_em_faturamento (cost=735.59..735.79 rows=16 width=16) (actual time=1.515..1.515 rows=1 loops=1)

240. 0.011 1.514 ↑ 16.0 1 1

Sort (cost=735.59..735.63 rows=16 width=31) (actual time=1.514..1.514 rows=1 loops=1)

  • Sort Key: tb_cntrt_6.nu_contrato
  • Sort Method: quicksort Memory: 25kB
241. 0.044 1.503 ↑ 16.0 1 1

Hash Left Join (cost=615.58..735.27 rows=16 width=31) (actual time=1.499..1.503 rows=1 loops=1)

  • Hash Cond: (tb_cntrt_6.id_contrato = vw_sld_pago_1.contrato)
242. 0.001 1.005 ↑ 8.0 1 1

Nested Loop Left Join (cost=423.37..542.43 rows=8 width=122) (actual time=1.001..1.005 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = cntrt_22.id_contrato)
243. 0.021 0.978 ↑ 8.0 1 1

Hash Left Join (cost=422.83..529.72 rows=8 width=119) (actual time=0.976..0.978 rows=1 loops=1)

  • Hash Cond: (tb_cntrt_6.id_contrato = vw_sld_liquidado_1.contrato)
244. 0.001 0.821 ↑ 4.0 1 1

Nested Loop Left Join (cost=259.14..365.94 rows=4 width=111) (actual time=0.819..0.821 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = vw_sld_faturado.contrato)
245. 0.001 0.597 ↑ 2.0 1 1

Nested Loop Left Join (cost=79.59..186.30 rows=2 width=103) (actual time=0.596..0.597 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = a_3.contrato)
246. 0.002 0.532 ↑ 1.0 1 1

Nested Loop Left Join (cost=21.78..128.40 rows=1 width=95) (actual time=0.531..0.532 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = cntrt_26.id_contrato)
247. 0.002 0.498 ↑ 1.0 1 1

Nested Loop Left Join (cost=21.23..114.70 rows=1 width=91) (actual time=0.497..0.498 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = cntrt_25.id_contrato)
248. 0.002 0.422 ↑ 1.0 1 1

Nested Loop Left Join (cost=20.41..92.70 rows=1 width=59) (actual time=0.421..0.422 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = cntrt_24.id_contrato)
249. 0.002 0.392 ↑ 1.0 1 1

Nested Loop Left Join (cost=10.48..52.17 rows=1 width=55) (actual time=0.391..0.392 rows=1 loops=1)

  • Join Filter: (tb_cntrt_6.id_contrato = cntrt_23.id_contrato)
250. 0.017 0.017 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_6 (cost=0.27..8.29 rows=1 width=23) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
251. 0.034 0.373 ↑ 1.0 1 1

GroupAggregate (cost=10.21..43.86 rows=1 width=55) (actual time=0.373..0.373 rows=1 loops=1)

  • Group Key: cntrt_23.id_contrato
252. 0.003 0.339 ↑ 2.0 1 1

Nested Loop (cost=10.21..43.81 rows=2 width=45) (actual time=0.290..0.339 rows=1 loops=1)

253. 0.001 0.318 ↑ 2.0 1 1

Nested Loop (cost=9.94..43.03 rows=2 width=39) (actual time=0.271..0.318 rows=1 loops=1)

254. 0.009 0.009 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_23 (cost=0.27..8.29 rows=1 width=23) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
255. 0.103 0.308 ↑ 2.0 1 1

Hash Join (cost=9.66..34.72 rows=2 width=24) (actual time=0.262..0.308 rows=1 loops=1)

  • Hash Cond: (ftrmnt_16.id_autorizacao_faturamento = trzc_9.id_autorizacao_faturamento)
256. 0.197 0.197 ↑ 1.1 629 1

Seq Scan on tb_ftrmnt ftrmnt_16 (cost=0.00..23.30 rows=666 width=8) (actual time=0.005..0.197 rows=629 loops=1)

  • Filter: (in_situacao_faturamento <> ALL ('{1,4,8}'::bigint[]))
  • Rows Removed by Filter: 47
257. 0.003 0.008 ↑ 2.0 1 1

Hash (cost=9.64..9.64 rows=2 width=16) (actual time=0.008..0.008 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
258. 0.002 0.005 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_9 (cost=4.29..9.64 rows=2 width=16) (actual time=0.005..0.005 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
259. 0.003 0.003 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
260. 0.018 0.018 ↑ 1.0 1 1

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_5 (cost=0.28..0.38 rows=1 width=30) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_16.id_autorizacao_faturamento)
261. 0.000 0.028 ↓ 0.0 0 1

GroupAggregate (cost=9.92..40.51 rows=1 width=27) (actual time=0.028..0.028 rows=0 loops=1)

  • Group Key: cntrt_24.id_contrato
262. 0.000 0.028 ↓ 0.0 0 1

Nested Loop (cost=9.92..40.50 rows=1 width=27) (actual time=0.028..0.028 rows=0 loops=1)

263. 0.015 0.028 ↓ 0.0 0 1

Hash Join (cost=9.65..32.20 rows=1 width=12) (actual time=0.028..0.028 rows=0 loops=1)

  • Hash Cond: (ftrmnt_17.id_autorizacao_faturamento = trzc_10.id_autorizacao_faturamento)
264. 0.005 0.005 ↑ 676.0 1 1

Seq Scan on tb_ftrmnt ftrmnt_17 (cost=0.00..20.76 rows=676 width=8) (actual time=0.005..0.005 rows=1 loops=1)

265. 0.000 0.008 ↓ 0.0 0 1

Hash (cost=9.64..9.64 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=1)

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

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_10 (cost=4.29..9.64 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
267. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
268. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_24 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
269. 0.000 0.074 ↓ 0.0 0 1

GroupAggregate (cost=0.82..21.98 rows=1 width=55) (actual time=0.074..0.074 rows=0 loops=1)

  • Group Key: cntrt_25.id_contrato
270. 0.001 0.074 ↓ 0.0 0 1

Nested Loop (cost=0.82..21.96 rows=1 width=31) (actual time=0.074..0.074 rows=0 loops=1)

271. 0.001 0.073 ↓ 0.0 0 1

Nested Loop (cost=0.55..13.66 rows=1 width=31) (actual time=0.073..0.073 rows=0 loops=1)

272. 0.037 0.037 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_25 (cost=0.27..8.29 rows=1 width=23) (actual time=0.037..0.037 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
273. 0.035 0.035 ↓ 0.0 0 1

Index Scan using tb_trzc_ftrmnt_in_situacao_idx on tb_trzc_ftrmnt trzc_11 (cost=0.28..5.36 rows=1 width=16) (actual time=0.035..0.035 rows=0 loops=1)

  • Index Cond: (in_situacao = 4)
  • Filter: (id_contrato = 340352)
274. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_6 (cost=0.28..8.29 rows=1 width=16) (never executed)

  • Index Cond: (id_autorizacao_faturamento = trzc_11.id_autorizacao_faturamento)
275. 0.001 0.032 ↓ 0.0 0 1

GroupAggregate (cost=0.55..13.67 rows=1 width=27) (actual time=0.032..0.032 rows=0 loops=1)

  • Group Key: cntrt_26.id_contrato
276. 0.000 0.031 ↓ 0.0 0 1

Nested Loop (cost=0.55..13.66 rows=1 width=27) (actual time=0.031..0.031 rows=0 loops=1)

277. 0.013 0.013 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_26 (cost=0.27..8.29 rows=1 width=23) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
278. 0.018 0.018 ↓ 0.0 0 1

Index Scan using tb_trzc_ftrmnt_in_situacao_idx on tb_trzc_ftrmnt trzc_12 (cost=0.28..5.36 rows=1 width=12) (actual time=0.018..0.018 rows=0 loops=1)

  • Index Cond: (in_situacao = 4)
  • Filter: (id_contrato = 340352)
279. 0.000 0.064 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.064..0.064 rows=0 loops=1)

  • Group Key: a_3.contrato, a_3.numero_contrato
280. 0.017 0.064 ↓ 0.0 0 1

Sort (cost=57.81..57.82 rows=2 width=194) (actual time=0.064..0.064 rows=0 loops=1)

  • Sort Key: a_3.numero_contrato
  • Sort Method: quicksort Memory: 25kB
281. 0.000 0.047 ↓ 0.0 0 1

Subquery Scan on a_3 (cost=57.76..57.80 rows=2 width=194) (actual time=0.047..0.047 rows=0 loops=1)

282. 0.001 0.047 ↓ 0.0 0 1

Unique (cost=57.76..57.78 rows=2 width=202) (actual time=0.047..0.047 rows=0 loops=1)

283. 0.015 0.046 ↓ 0.0 0 1

Sort (cost=57.76..57.76 rows=2 width=202) (actual time=0.046..0.046 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_3".id_faturamento, "*SELECT* 1_3".contrato, "*SELECT* 1_3".numero_contrato, (("*SELECT* 1_3".total_faturado_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
284. 0.000 0.031 ↓ 0.0 0 1

Append (cost=29.02..57.75 rows=2 width=202) (actual time=0.031..0.031 rows=0 loops=1)

285. 0.001 0.025 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_3 (cost=29.02..29.08 rows=1 width=39) (actual time=0.025..0.025 rows=0 loops=1)

286. 0.000 0.024 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.024..0.024 rows=0 loops=1)

  • Group Key: ftrmnt_18.id_faturamento, cntrt_27.id_contrato
287. 0.011 0.024 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.024..0.024 rows=0 loops=1)

  • Sort Key: ftrmnt_18.id_faturamento
  • Sort Method: quicksort Memory: 25kB
288. 0.001 0.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.013..0.013 rows=0 loops=1)

289. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.012..0.012 rows=0 loops=1)

290. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.50 rows=1 width=31) (actual time=0.012..0.012 rows=0 loops=1)

291. 0.007 0.012 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_18 (cost=4.30..12.20 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento <> ALL ('{1,4,8}'::bigint[])) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
292. 0.005 0.005 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
293. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_27 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
294. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_3 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_18.id_faturamento)
295. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_3 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_3.id_faturamento)
296. 0.001 0.006 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.66 rows=1 width=39) (actual time=0.006..0.006 rows=0 loops=1)

  • Group Key: ftrmnt_19.id_faturamento, cntrt_28.id_contrato
297. 0.000 0.005 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.005..0.005 rows=0 loops=1)

  • Join Filter: (ftrmnt_19.id_faturamento = splh_6.id_faturamento)
298. 0.005 0.005 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_6 (cost=0.12..8.14 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=1)

299. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.49 rows=1 width=31) (never executed)

300. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_19 (cost=4.30..12.19 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento <> ALL ('{1,4,8}'::bigint[])))
301. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
302. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_28 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
303. 0.004 0.223 ↑ 2.0 1 1

Materialize (cost=179.55..179.58 rows=2 width=16) (actual time=0.222..0.223 rows=1 loops=1)

304. 0.001 0.219 ↑ 2.0 1 1

Subquery Scan on vw_sld_faturado (cost=179.55..179.57 rows=2 width=16) (actual time=0.218..0.219 rows=1 loops=1)

305. 0.015 0.218 ↑ 2.0 1 1

Sort (cost=179.55..179.55 rows=2 width=31) (actual time=0.217..0.218 rows=1 loops=1)

  • Sort Key: tb_cntrt_7.nu_contrato
  • Sort Method: quicksort Memory: 25kB
306. 0.008 0.203 ↑ 2.0 1 1

Nested Loop Left Join (cost=89.37..179.54 rows=2 width=31) (actual time=0.200..0.203 rows=1 loops=1)

  • Join Filter: (tb_cntrt_7.id_contrato = a_4.contrato)
307. 0.003 0.115 ↑ 1.0 1 1

Nested Loop Left Join (cost=31.56..121.63 rows=1 width=67) (actual time=0.112..0.115 rows=1 loops=1)

  • Join Filter: (tb_cntrt_7.id_contrato = cntrt_31.id_contrato)
308. 0.007 0.109 ↑ 1.0 1 1

Nested Loop Left Join (cost=26.87..92.95 rows=1 width=59) (actual time=0.106..0.109 rows=1 loops=1)

  • Join Filter: (tb_cntrt_7.id_contrato = cntrt_30.id_contrato)
309. 0.005 0.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=13.43..47.25 rows=1 width=27) (actual time=0.035..0.037 rows=1 loops=1)

  • Join Filter: (tb_cntrt_7.id_contrato = cntrt_29.id_contrato)
310. 0.023 0.023 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_7 (cost=0.27..8.29 rows=1 width=23) (actual time=0.021..0.023 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
311. 0.001 0.009 ↓ 0.0 0 1

GroupAggregate (cost=13.16..38.94 rows=1 width=27) (actual time=0.008..0.009 rows=0 loops=1)

  • Group Key: cntrt_29.id_contrato
312. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=13.16..38.93 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

313. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.63 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=1)

  • Join Filter: (ftrmnt_20.id_autorizacao_faturamento = trzc_13.id_autorizacao_faturamento)
314. 0.003 0.008 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_13 (cost=4.29..9.64 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
315. 0.005 0.005 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
316. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_20 (cost=8.60..20.90 rows=7 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
317. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
318. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_29 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
319. 0.000 0.065 ↓ 0.0 0 1

GroupAggregate (cost=13.43..45.68 rows=1 width=55) (actual time=0.065..0.065 rows=0 loops=1)

  • Group Key: cntrt_30.id_contrato
320. 0.001 0.065 ↓ 0.0 0 1

Nested Loop (cost=13.43..45.64 rows=1 width=45) (actual time=0.065..0.065 rows=0 loops=1)

321. 0.000 0.064 ↓ 0.0 0 1

Nested Loop (cost=13.16..39.06 rows=1 width=39) (actual time=0.064..0.064 rows=0 loops=1)

322. 0.000 0.064 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.76 rows=1 width=24) (actual time=0.064..0.064 rows=0 loops=1)

  • Join Filter: (ftrmnt_21.id_autorizacao_faturamento = trzc_14.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 35
323. 0.012 0.035 ↓ 5.0 35 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_21 (cost=8.60..20.90 rows=7 width=8) (actual time=0.026..0.035 rows=35 loops=1)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
  • Heap Blocks: exact=8
324. 0.023 0.023 ↓ 5.0 35 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (actual time=0.023..0.023 rows=35 loops=1)

  • Index Cond: (in_situacao_faturamento = ANY ('{9,21}'::bigint[]))
325. 0.022 0.035 ↑ 2.0 1 35

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.001..0.001 rows=1 loops=35)

326. 0.010 0.013 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_14 (cost=4.29..9.64 rows=2 width=16) (actual time=0.013..0.013 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
327. 0.003 0.003 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
328. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_30 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
329. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_7 (cost=0.28..6.58 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_21.id_autorizacao_faturamento)
330. 0.000 0.003 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.003..0.003 rows=0 loops=1)

  • Group Key: cntrt_31.id_contrato
331. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.003..0.003 rows=0 loops=1)

  • Join Filter: (ftrmnt_22.id_faturamento = splh_7.id_faturamento)
332. 0.001 0.003 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.002..0.003 rows=0 loops=1)

333. 0.000 0.002 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_22 (cost=4.30..12.18 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])) AND (nu_processo_compra = 340352))
334. 0.002 0.002 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
335. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_31 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
336. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh_7 (cost=0.12..8.14 rows=1 width=16) (never executed)

337. 0.000 0.080 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.080..0.080 rows=0 loops=1)

  • Group Key: a_4.contrato, a_4.numero_contrato
338. 0.020 0.080 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.080..0.080 rows=0 loops=1)

  • Sort Key: a_4.numero_contrato
  • Sort Method: quicksort Memory: 25kB
339. 0.001 0.060 ↓ 0.0 0 1

Subquery Scan on a_4 (cost=57.75..57.80 rows=2 width=194) (actual time=0.060..0.060 rows=0 loops=1)

340. 0.000 0.059 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.059..0.059 rows=0 loops=1)

341. 0.011 0.059 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.059..0.059 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_4".id_faturamento, "*SELECT* 1_4".contrato, "*SELECT* 1_4".numero_contrato, (("*SELECT* 1_4".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
342. 0.001 0.048 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.048..0.048 rows=0 loops=1)

343. 0.001 0.034 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_4 (cost=29.02..29.08 rows=1 width=39) (actual time=0.034..0.034 rows=0 loops=1)

344. 0.000 0.033 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.033..0.033 rows=0 loops=1)

  • Group Key: ftrmnt_23.id_faturamento, cntrt_32.id_contrato
345. 0.020 0.033 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.033..0.033 rows=0 loops=1)

  • Sort Key: ftrmnt_23.id_faturamento
  • Sort Method: quicksort Memory: 25kB
346. 0.000 0.013 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.013..0.013 rows=0 loops=1)

347. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.013..0.013 rows=0 loops=1)

348. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.012..0.012 rows=0 loops=1)

349. 0.006 0.012 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_23 (cost=4.30..12.19 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
350. 0.006 0.006 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
351. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_32 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
352. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_4 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_23.id_faturamento)
353. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_4 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_4.id_faturamento)
354. 0.000 0.013 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.013..0.013 rows=0 loops=1)

  • Group Key: ftrmnt_24.id_faturamento, cntrt_33.id_contrato
355. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.013..0.013 rows=0 loops=1)

  • Join Filter: (ftrmnt_24.id_faturamento = splh_8.id_faturamento)
356. 0.012 0.012 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_8 (cost=0.12..8.14 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

357. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

358. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_24 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = ANY ('{9,21}'::bigint[])))
359. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
360. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_33 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
361. 0.003 0.136 ↑ 2.0 1 1

Hash (cost=163.66..163.66 rows=2 width=16) (actual time=0.136..0.136 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
362. 0.001 0.133 ↑ 2.0 1 1

Subquery Scan on vw_sld_liquidado_1 (cost=163.63..163.66 rows=2 width=16) (actual time=0.133..0.133 rows=1 loops=1)

363. 0.010 0.132 ↑ 2.0 1 1

Sort (cost=163.63..163.64 rows=2 width=31) (actual time=0.132..0.132 rows=1 loops=1)

  • Sort Key: tb_cntrt_8.nu_contrato
  • Sort Method: quicksort Memory: 25kB
364. 0.004 0.122 ↑ 2.0 1 1

Nested Loop Left Join (cost=80.77..163.62 rows=2 width=31) (actual time=0.121..0.122 rows=1 loops=1)

  • Join Filter: (tb_cntrt_8.id_contrato = a_5.contrato)
365. 0.003 0.074 ↑ 1.0 1 1

Nested Loop Left Join (cost=22.97..105.71 rows=1 width=67) (actual time=0.073..0.074 rows=1 loops=1)

  • Join Filter: (tb_cntrt_8.id_contrato = cntrt_36.id_contrato)
366. 0.003 0.069 ↑ 1.0 1 1

Nested Loop Left Join (cost=18.27..77.04 rows=1 width=59) (actual time=0.069..0.069 rows=1 loops=1)

  • Join Filter: (tb_cntrt_8.id_contrato = cntrt_35.id_contrato)
367. 0.003 0.058 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.41..46.85 rows=1 width=55) (actual time=0.057..0.058 rows=1 loops=1)

  • Join Filter: (tb_cntrt_8.id_contrato = cntrt_34.id_contrato)
368. 0.010 0.010 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_8 (cost=0.27..8.29 rows=1 width=23) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
369. 0.001 0.045 ↓ 0.0 0 1

GroupAggregate (cost=9.14..38.54 rows=1 width=55) (actual time=0.045..0.045 rows=0 loops=1)

  • Group Key: cntrt_34.id_contrato
370. 0.000 0.044 ↓ 0.0 0 1

Nested Loop (cost=9.14..38.51 rows=1 width=45) (actual time=0.044..0.044 rows=0 loops=1)

371. 0.000 0.044 ↓ 0.0 0 1

Nested Loop (cost=8.86..30.20 rows=1 width=39) (actual time=0.044..0.044 rows=0 loops=1)

372. 0.018 0.044 ↓ 0.0 0 1

Nested Loop (cost=8.59..21.90 rows=1 width=24) (actual time=0.044..0.044 rows=0 loops=1)

  • Join Filter: (ftrmnt_25.id_autorizacao_faturamento = trzc_15.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 20
373. 0.016 0.026 ↓ 6.7 20 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_25 (cost=4.30..12.17 rows=3 width=8) (actual time=0.015..0.026 rows=20 loops=1)

  • Recheck Cond: (in_situacao_faturamento = 22)
  • Heap Blocks: exact=8
374. 0.010 0.010 ↓ 6.7 20 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.010..0.010 rows=20 loops=1)

  • Index Cond: (in_situacao_faturamento = 22)
375. 0.000 0.000 ↑ 2.0 1 20

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.000..0.000 rows=1 loops=20)

376. 0.002 0.004 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_15 (cost=4.29..9.64 rows=2 width=16) (actual time=0.004..0.004 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
377. 0.002 0.002 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
378. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_34 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
379. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_8 (cost=0.28..8.29 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_25.id_autorizacao_faturamento)
380. 0.000 0.008 ↓ 0.0 0 1

GroupAggregate (cost=8.86..30.16 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

  • Group Key: cntrt_35.id_contrato
381. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=8.86..30.15 rows=1 width=27) (actual time=0.008..0.008 rows=0 loops=1)

382. 0.000 0.008 ↓ 0.0 0 1

Nested Loop (cost=8.59..21.85 rows=1 width=12) (actual time=0.008..0.008 rows=0 loops=1)

  • Join Filter: (ftrmnt_26.id_autorizacao_faturamento = trzc_16.id_autorizacao_faturamento)
383. 0.002 0.008 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_16 (cost=4.29..9.64 rows=1 width=20) (actual time=0.008..0.008 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
384. 0.006 0.006 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
385. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_26 (cost=4.30..12.17 rows=3 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = 22)
386. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = 22)
387. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_35 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
388. 0.000 0.002 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.002..0.002 rows=0 loops=1)

  • Group Key: cntrt_36.id_contrato
389. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.002..0.002 rows=0 loops=1)

  • Join Filter: (ftrmnt_27.id_faturamento = splh_9.id_faturamento)
390. 0.000 0.002 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.002..0.002 rows=0 loops=1)

391. 0.000 0.002 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_27 (cost=4.30..12.18 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (nu_processo_compra = 340352) AND (in_situacao_faturamento = 22))
392. 0.002 0.002 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
393. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_36 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
394. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh_9 (cost=0.12..8.14 rows=1 width=16) (never executed)

395. 0.000 0.044 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.044..0.044 rows=0 loops=1)

  • Group Key: a_5.contrato, a_5.numero_contrato
396. 0.007 0.044 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.043..0.044 rows=0 loops=1)

  • Sort Key: a_5.numero_contrato
  • Sort Method: quicksort Memory: 25kB
397. 0.000 0.037 ↓ 0.0 0 1

Subquery Scan on a_5 (cost=57.75..57.80 rows=2 width=194) (actual time=0.037..0.037 rows=0 loops=1)

398. 0.000 0.037 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.037..0.037 rows=0 loops=1)

399. 0.009 0.037 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.037..0.037 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_5".id_faturamento, "*SELECT* 1_5".contrato, "*SELECT* 1_5".numero_contrato, (("*SELECT* 1_5".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
400. 0.000 0.028 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.028..0.028 rows=0 loops=1)

401. 0.001 0.016 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_5 (cost=29.02..29.08 rows=1 width=39) (actual time=0.016..0.016 rows=0 loops=1)

402. 0.000 0.015 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.015..0.015 rows=0 loops=1)

  • Group Key: ftrmnt_28.id_faturamento, cntrt_37.id_contrato
403. 0.008 0.015 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.015..0.015 rows=0 loops=1)

  • Sort Key: ftrmnt_28.id_faturamento
  • Sort Method: quicksort Memory: 25kB
404. 0.001 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.006..0.007 rows=0 loops=1)

405. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.006..0.006 rows=0 loops=1)

406. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.006..0.006 rows=0 loops=1)

407. 0.003 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_28 (cost=4.30..12.19 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = 22) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
408. 0.003 0.003 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
409. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_37 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
410. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_5 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_28.id_faturamento)
411. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_5 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_5.id_faturamento)
412. 0.000 0.012 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.012..0.012 rows=0 loops=1)

  • Group Key: ftrmnt_29.id_faturamento, cntrt_38.id_contrato
413. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.012..0.012 rows=0 loops=1)

  • Join Filter: (ftrmnt_29.id_faturamento = splh_10.id_faturamento)
414. 0.012 0.012 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_10 (cost=0.12..8.14 rows=1 width=16) (actual time=0.012..0.012 rows=0 loops=1)

415. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

416. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_29 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = 22))
417. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
418. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_38 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
419. 0.003 0.026 ↑ 1.0 1 1

Materialize (cost=0.55..12.60 rows=1 width=11) (actual time=0.025..0.026 rows=1 loops=1)

420. 0.002 0.023 ↑ 1.0 1 1

Nested Loop (cost=0.55..12.59 rows=1 width=11) (actual time=0.022..0.023 rows=1 loops=1)

421. 0.010 0.010 ↑ 1.0 1 1

Index Only Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_22 (cost=0.27..4.29 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
  • Heap Fetches: 1
422. 0.011 0.011 ↑ 1.0 1 1

Index Scan using tb_vl_tlzd_pr_vtr_id_contrato_idx on tb_vl_tlzd_pr_vtr pre_2 (cost=0.27..8.29 rows=1 width=11) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
423. 0.011 0.454 ↑ 2.0 1 1

Hash (cost=192.19..192.19 rows=2 width=16) (actual time=0.454..0.454 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
424. 0.001 0.443 ↑ 2.0 1 1

Subquery Scan on vw_sld_pago_1 (cost=192.16..192.19 rows=2 width=16) (actual time=0.443..0.443 rows=1 loops=1)

425. 0.013 0.442 ↑ 2.0 1 1

Sort (cost=192.16..192.17 rows=2 width=31) (actual time=0.442..0.442 rows=1 loops=1)

  • Sort Key: tb_cntrt_9.nu_contrato
  • Sort Method: quicksort Memory: 25kB
426. 0.006 0.429 ↑ 2.0 1 1

Nested Loop Left Join (cost=89.91..192.15 rows=2 width=31) (actual time=0.426..0.429 rows=1 loops=1)

  • Join Filter: (tb_cntrt_9.id_contrato = a_6.contrato)
427. 0.006 0.338 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.11..134.23 rows=1 width=70) (actual time=0.335..0.338 rows=1 loops=1)

  • Join Filter: (tb_cntrt_9.id_contrato = cntrt_42.id_contrato)
428. 0.004 0.325 ↑ 1.0 1 1

Nested Loop Left Join (cost=27.41..105.56 rows=1 width=62) (actual time=0.322..0.325 rows=1 loops=1)

  • Join Filter: (tb_cntrt_9.id_contrato = cntrt_41.id_contrato)
429. 0.003 0.037 ↑ 1.0 1 1

Nested Loop Left Join (cost=13.98..59.86 rows=1 width=30) (actual time=0.034..0.037 rows=1 loops=1)

  • Join Filter: (tb_cntrt_9.id_contrato = cntrt_40.id_contrato)
430. 0.002 0.029 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.82..20.89 rows=1 width=26) (actual time=0.026..0.029 rows=1 loops=1)

  • Join Filter: (tb_cntrt_9.id_contrato = cntrt_39.id_contrato)
431. 0.010 0.010 ↑ 1.0 1 1

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt tb_cntrt_9 (cost=0.27..8.29 rows=1 width=23) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
432. 0.001 0.017 ↑ 1.0 1 1

Nested Loop (cost=0.55..12.59 rows=1 width=11) (actual time=0.016..0.017 rows=1 loops=1)

433. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_39 (cost=0.27..4.29 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
  • Heap Fetches: 1
434. 0.007 0.007 ↑ 1.0 1 1

Index Scan using tb_vl_tlzd_pr_vtr_id_contrato_idx on tb_vl_tlzd_pr_vtr pre_3 (cost=0.27..8.29 rows=1 width=11) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
435. 0.001 0.005 ↓ 0.0 0 1

GroupAggregate (cost=13.16..38.94 rows=1 width=27) (actual time=0.004..0.005 rows=0 loops=1)

  • Group Key: cntrt_40.id_contrato
436. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=13.16..38.93 rows=1 width=27) (actual time=0.004..0.004 rows=0 loops=1)

437. 0.000 0.004 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.63 rows=1 width=12) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: (ftrmnt_30.id_autorizacao_faturamento = trzc_17.id_autorizacao_faturamento)
438. 0.002 0.004 ↓ 0.0 0 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_17 (cost=4.29..9.64 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: ((vl_autorizado_reajuste IS NOT NULL) AND (in_situacao = ANY ('{3,4,5}'::integer[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
439. 0.002 0.002 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
440. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_30 (cost=8.60..20.90 rows=7 width=8) (never executed)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
441. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (never executed)

  • Index Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
442. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_40 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
443. 0.000 0.284 ↓ 0.0 0 1

GroupAggregate (cost=13.43..45.68 rows=1 width=55) (actual time=0.284..0.284 rows=0 loops=1)

  • Group Key: cntrt_41.id_contrato
444. 0.000 0.284 ↓ 0.0 0 1

Nested Loop (cost=13.43..45.64 rows=1 width=45) (actual time=0.284..0.284 rows=0 loops=1)

445. 0.001 0.284 ↓ 0.0 0 1

Nested Loop (cost=13.16..39.06 rows=1 width=39) (actual time=0.283..0.284 rows=0 loops=1)

446. 0.181 0.283 ↓ 0.0 0 1

Nested Loop (cost=12.89..30.76 rows=1 width=24) (actual time=0.283..0.283 rows=0 loops=1)

  • Join Filter: (ftrmnt_31.id_autorizacao_faturamento = trzc_18.id_autorizacao_faturamento)
  • Rows Removed by Join Filter: 406
447. 0.067 0.102 ↓ 58.0 406 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_31 (cost=8.60..20.90 rows=7 width=8) (actual time=0.039..0.102 rows=406 loops=1)

  • Recheck Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
  • Heap Blocks: exact=14
448. 0.035 0.035 ↓ 58.0 406 1

Bitmap Index Scan on tb_ftrmnt_in_situacao_faturamento_idx (cost=0.00..8.60 rows=7 width=0) (actual time=0.035..0.035 rows=406 loops=1)

  • Index Cond: (in_situacao_faturamento = ANY ('{12,13}'::bigint[]))
449. 0.000 0.000 ↑ 2.0 1 406

Materialize (cost=4.29..9.65 rows=2 width=16) (actual time=0.000..0.000 rows=1 loops=406)

450. 0.007 0.010 ↑ 2.0 1 1

Bitmap Heap Scan on tb_trzc_ftrmnt trzc_18 (cost=4.29..9.64 rows=2 width=16) (actual time=0.009..0.010 rows=1 loops=1)

  • Recheck Cond: (id_contrato = 340352)
  • Filter: (in_situacao = ANY ('{3,4,5}'::integer[]))
  • Heap Blocks: exact=1
451. 0.003 0.003 ↑ 2.0 1 1

Bitmap Index Scan on tb_trzc_ftrmnt_id_contrato_idx (cost=0.00..4.29 rows=2 width=0) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
452. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_41 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
453. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_trzc_pkey on tb_tm_trzc tmtrzc_9 (cost=0.28..6.58 rows=1 width=30) (never executed)

  • Index Cond: (id_autorizacao_faturamento = ftrmnt_31.id_autorizacao_faturamento)
454. 0.000 0.007 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

  • Group Key: cntrt_42.id_contrato
455. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (ftrmnt_32.id_faturamento = splh_11.id_faturamento)
456. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.48 rows=1 width=31) (actual time=0.007..0.007 rows=0 loops=1)

457. 0.001 0.007 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_32 (cost=4.30..12.18 rows=1 width=16) (actual time=0.007..0.007 rows=0 loops=1)

  • Recheck Cond: (cd_tipo_faturamento = 3)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])) AND (nu_processo_compra = 340352))
458. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on tb_ftrmnt_cd_tipo_faturamento_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (cd_tipo_faturamento = 3)
459. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_42 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
460. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_splh_nf_fsc_pkey on tb_splh_nf_fsc splh_11 (cost=0.12..8.14 rows=1 width=16) (never executed)

461. 0.000 0.085 ↓ 0.0 0 1

GroupAggregate (cost=57.81..57.85 rows=2 width=194) (actual time=0.085..0.085 rows=0 loops=1)

  • Group Key: a_6.contrato, a_6.numero_contrato
462. 0.025 0.085 ↓ 0.0 0 1

Sort (cost=57.81..57.81 rows=2 width=194) (actual time=0.085..0.085 rows=0 loops=1)

  • Sort Key: a_6.numero_contrato
  • Sort Method: quicksort Memory: 25kB
463. 0.000 0.060 ↓ 0.0 0 1

Subquery Scan on a_6 (cost=57.75..57.80 rows=2 width=194) (actual time=0.060..0.060 rows=0 loops=1)

464. 0.000 0.060 ↓ 0.0 0 1

Unique (cost=57.75..57.78 rows=2 width=202) (actual time=0.060..0.060 rows=0 loops=1)

465. 0.021 0.060 ↓ 0.0 0 1

Sort (cost=57.75..57.76 rows=2 width=202) (actual time=0.060..0.060 rows=0 loops=1)

  • Sort Key: "*SELECT* 1_6".id_faturamento, "*SELECT* 1_6".contrato, "*SELECT* 1_6".numero_contrato, (("*SELECT* 1_6".total_recebido_nf)::double precision)
  • Sort Method: quicksort Memory: 25kB
466. 0.001 0.039 ↓ 0.0 0 1

Append (cost=29.02..57.74 rows=2 width=202) (actual time=0.039..0.039 rows=0 loops=1)

467. 0.000 0.031 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_6 (cost=29.02..29.08 rows=1 width=39) (actual time=0.031..0.031 rows=0 loops=1)

468. 0.010 0.031 ↓ 0.0 0 1

GroupAggregate (cost=29.02..29.07 rows=1 width=63) (actual time=0.031..0.031 rows=0 loops=1)

  • Group Key: ftrmnt_33.id_faturamento, cntrt_43.id_contrato
469. 0.007 0.021 ↓ 0.0 0 1

Sort (cost=29.02..29.03 rows=1 width=53) (actual time=0.021..0.021 rows=0 loops=1)

  • Sort Key: ftrmnt_33.id_faturamento
  • Sort Method: quicksort Memory: 25kB
470. 0.001 0.014 ↓ 0.0 0 1

Nested Loop Left Join (cost=4.99..29.01 rows=1 width=53) (actual time=0.014..0.014 rows=0 loops=1)

471. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=4.85..28.81 rows=1 width=46) (actual time=0.013..0.013 rows=0 loops=1)

472. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=4.57..20.49 rows=1 width=31) (actual time=0.013..0.013 rows=0 loops=1)

473. 0.007 0.013 ↓ 0.0 0 1

Bitmap Heap Scan on tb_ftrmnt ftrmnt_33 (cost=4.30..12.19 rows=1 width=16) (actual time=0.013..0.013 rows=0 loops=1)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])) AND (cd_tipo_faturamento = ANY ('{1,2,3,4}'::bigint[])))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
474. 0.006 0.006 ↑ 3.0 1 1

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (nu_processo_compra = 340352)
475. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_43 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
476. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_dcmnt_fscl_pkey on tb_dcmnt_fscl dcmntfscl_6 (cost=0.28..8.29 rows=1 width=15) (never executed)

  • Index Cond: (id_faturamento = ftrmnt_33.id_faturamento)
477. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_tm_dcmnt_fscl_pkey on tb_tm_dcmnt_fscl ttdf_6 (cost=0.14..0.19 rows=1 width=23) (never executed)

  • Index Cond: (id_faturamento = dcmntfscl_6.id_faturamento)
478. 0.000 0.007 ↓ 0.0 0 1

GroupAggregate (cost=4.70..28.65 rows=1 width=39) (actual time=0.007..0.007 rows=0 loops=1)

  • Group Key: ftrmnt_34.id_faturamento, cntrt_44.id_contrato
479. 0.001 0.007 ↓ 0.0 0 1

Nested Loop (cost=4.70..28.64 rows=1 width=39) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (ftrmnt_34.id_faturamento = splh_12.id_faturamento)
480. 0.006 0.006 ↓ 0.0 0 1

Index Scan using tb_splh_nf_ltrnc_v2_0_pkey on tb_splh_nf_ltrnc_v2_0 splh_12 (cost=0.12..8.14 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=1)

481. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.57..20.48 rows=1 width=31) (never executed)

482. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on tb_ftrmnt ftrmnt_34 (cost=4.30..12.18 rows=1 width=16) (never executed)

  • Recheck Cond: (nu_processo_compra = 340352)
  • Filter: ((id_autorizacao_faturamento IS NULL) AND (cd_tipo_faturamento = ANY ('{2,1}'::bigint[])) AND (in_situacao_faturamento = ANY ('{12,13}'::bigint[])))
483. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on tb_ftrmnt_nu_processo_compra_idx (cost=0.00..4.30 rows=3 width=0) (never executed)

  • Index Cond: (nu_processo_compra = 340352)
484. 0.000 0.000 ↓ 0.0 0

Index Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt_44 (cost=0.27..8.29 rows=1 width=23) (never executed)

  • Index Cond: (id_contrato = 340352)
485. 0.007 0.092 ↑ 1.0 1 1

Hash (cost=12.59..12.59 rows=1 width=8) (actual time=0.092..0.092 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
486. 0.002 0.085 ↑ 1.0 1 1

Nested Loop (cost=0.55..12.59 rows=1 width=8) (actual time=0.083..0.085 rows=1 loops=1)

487. 0.049 0.049 ↑ 1.0 1 1

Index Only Scan using tb_cntrt_id_contrato_idx on tb_cntrt cntrt (cost=0.27..4.29 rows=1 width=8) (actual time=0.049..0.049 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
  • Heap Fetches: 1
488. 0.034 0.034 ↑ 1.0 1 1

Index Only Scan using tb_vl_tlzd_pr_vtr_id_contrato_idx on tb_vl_tlzd_pr_vtr pre (cost=0.27..8.29 rows=1 width=8) (actual time=0.033..0.034 rows=1 loops=1)

  • Index Cond: (id_contrato = 340352)
  • Heap Fetches: 1
Planning time : 25.888 ms
Execution time : 7.868 ms