explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bcBK

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=38,557,480.96..38,557,481.00 rows=15 width=817) (actual rows= loops=)

2.          

CTE valores_contrato

3. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=3,533.05..44,140.48 rows=16,042 width=72) (actual rows= loops=)

  • Hash Cond: ((tblicitacao_1.clicodigo = tbminuta_1.clicodigo) AND (tblicitacao_1.minano = tbminuta_1.minano) AND (tblicitacao_1.minnro = tbminuta_1.minnro))
4. 0.000 0.000 ↓ 0.0

Seq Scan on tblicitacao tblicitacao_1 (cost=0.00..390.97 rows=11,997 width=16) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash (cost=3,252.31..3,252.31 rows=16,042 width=84) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,468.97..3,252.31 rows=16,042 width=84) (actual rows= loops=)

  • Hash Cond: ((tbcontrato_1.clicodigomin = tbminuta_1.clicodigo) AND (tbcontrato_1.minano = tbminuta_1.minano) AND (tbcontrato_1.minnro = tbminuta_1.minnro))
7. 0.000 0.000 ↓ 0.0

Seq Scan on tbcontrato tbcontrato_1 (cost=0.00..1,120.42 rows=16,042 width=62) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=879.08..879.08 rows=33,708 width=22) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on tbminuta tbminuta_1 (cost=0.00..879.08 rows=33,708 width=22) (actual rows= loops=)

10.          

SubPlan (forHash Right Join)

11. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.45..2.46 rows=1 width=6) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbitemadjud on tbitemadjud (cost=0.42..2.44 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato_1.clicodigomin) AND (minano = tbcontrato_1.minano) AND (minnro = tbcontrato_1.minnro) AND (adjsequencia = tbcontrato_1.adjsequencia))
  • Filter: (unicodigo = tbcontrato_1.unicodigo)
13. 0.000 0.000 ↓ 0.0

Sort (cost=38,513,340.48..38,513,375.09 rows=13,845 width=817) (actual rows= loops=)

  • Sort Key: tbcontrato.ctrdataassinatura
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,610.04..38,513,000.80 rows=13,845 width=817) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=18,609.75..18,846.80 rows=13,845 width=809) (actual rows= loops=)

  • Hash Cond: (tbcontrato.loccodigo = tblocalentrega.loccodigo)
16. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=18,607.11..18,792.23 rows=13,845 width=783) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.organo = tbunidade.organo) AND (tbcontrato.orgcodigo = tbunidade.orgcodigo))
  • Join Filter: (tbcontrato.undcodigo = tbunidade.undcodigo)
17. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=18,565.78..18,670.18 rows=13,845 width=756) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.organo = tborgao.organo) AND (tbcontrato.orgcodigo = tborgao.orgcodigo))
18. 0.000 0.000 ↓ 0.0

Sort (cost=18,539.32..18,573.93 rows=13,845 width=717) (actual rows= loops=)

  • Sort Key: tbcontrato.organo, tbcontrato.orgcodigo
19. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=15,288.30..17,586.99 rows=13,845 width=717) (actual rows= loops=)

  • Hash Cond: (tbcontrato.fincodigo = tbtipofin.fincodigo)
20. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=15,286.55..17,526.44 rows=13,845 width=680) (actual rows= loops=)

  • Hash Cond: (tbusuario.unicodigo = unico_usuario.unicodigo)
21. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=13,858.31..15,907.83 rows=13,845 width=657) (actual rows= loops=)

  • Hash Cond: (tbcontrato.usucodigo = tbusuario.usucodigo)
22. 0.000 0.000 ↓ 0.0

Hash Join (cost=13,692.51..15,666.20 rows=13,845 width=649) (actual rows= loops=)

  • Hash Cond: (tbcliente.unicodigo = pessoa_cliente.unicodigo)
23. 0.000 0.000 ↓ 0.0

Hash Join (cost=12,264.27..14,047.59 rows=13,845 width=626) (actual rows= loops=)

  • Hash Cond: (tbcontrato.clicodigo = tbcliente.clicodigo)
24. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=12,263.11..13,856.07 rows=13,845 width=618) (actual rows= loops=)

  • Hash Cond: (tbcontrato.unicodigo = tbunico.unicodigo)
25. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=10,834.87..12,237.46 rows=13,845 width=570) (actual rows= loops=)

  • Hash Cond: ((tbprocesso.clicodigo = tbminuta.clicodigo) AND (tbprocesso.pcsano = tbminuta.pcsano) AND (tbprocesso.pcsnro = tbminuta.pcsnro))
26. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbprocesso on tbprocesso (cost=0.29..638.57 rows=33,752 width=14) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash (cost=10,592.29..10,592.29 rows=13,845 width=574) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=7,899.00..10,592.29 rows=13,845 width=574) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.clicodigomin = tbminuta.clicodigo) AND (tbcontrato.minano = tbminuta.minano) AND (tbcontrato.minnro = tbminuta.minnro))
29. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=7,898.71..9,054.70 rows=13,845 width=552) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.clicodigomin = tbadjudicacao.clicodigo) AND (tbcontrato.minano = tbadjudicacao.minano) AND (tbcontrato.minnro = tbadjudicacao.minnro))
  • Join Filter: (tbadjudicacao.adjsequencia = tbcontrato.adjsequencia)
30. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=7,898.42..8,158.55 rows=13,845 width=497) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.clicodigomin = tblicitacao.clicodigo) AND (tbcontrato.minano = tblicitacao.minano) AND (tbcontrato.minnro = tblicitacao.minnro))
31. 0.000 0.000 ↓ 0.0

Sort (cost=6,694.63..6,729.25 rows=13,845 width=485) (actual rows= loops=)

  • Sort Key: tbcontrato.clicodigomin, tbcontrato.minano, tbcontrato.minnro
32. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=0.57..5,742.30 rows=13,845 width=485) (actual rows= loops=)

  • Merge Cond: ((tbcontrato.clicodigosup = tbcontratosup.clicodigo) AND (tbcontrato.ctranosup = tbcontratosup.ctrano) AND (tbcontrato.ctridentsup = tbcontratosup.ctridentificador))
  • Filter: ((tbcontrato.clicodigo = 2595) OR (alternatives: SubPlan 31 or hashed SubPlan 32))
33. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato (cost=0.29..1,286.92 rows=16,042 width=459) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbcontrato on tbcontrato tbcontratosup (cost=0.29..1,264.92 rows=16,042 width=26) (actual rows= loops=)

35.          

SubPlan (forMerge Left Join)

36. 0.000 0.000 ↓ 0.0

Result (cost=1.12..7.22 rows=1 width=0) (actual rows= loops=)

  • One-Time Filter: (tbcontrato.clicodigomin = tbcontrato.clicodigo)
37. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.12..7.22 rows=1 width=0) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.83..4.89 rows=1 width=6) (actual rows= loops=)

  • Join Filter: (tbitemadjud_2.cmdsequencia = tbdotmin.cmdsequencia)
39. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbdotmin_dotacao on tbdotmin (cost=0.41..2.44 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (minano = tbcontrato.minano) AND (minnro = tbcontrato.minnro))
40. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbitemadjud on tbitemadjud tbitemadjud_2 (cost=0.42..2.44 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (minano = tbcontrato.minano) AND (minnro = tbcontrato.minnro) AND (adjsequencia = COALESCE(tbcontrato.adjsequencia, tbcontratosup.adjsequencia)))
  • Filter: (tbcontrato.unicodigo = unicodigo)
41. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbdotacao on tbdotacao (cost=0.29..2.31 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((loaano = tbdotmin.loaano) AND (dotcodigo = tbdotmin.dotcodigo))
  • Filter: (clicodigo = 2595)
42. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,011.16..8,382.85 rows=3,244 width=28) (actual rows= loops=)

  • Hash Cond: ((tbdotmin_1.loaano = tbdotacao_1.loaano) AND (tbdotmin_1.dotcodigo = tbdotacao_1.dotcodigo))
43. 0.000 0.000 ↓ 0.0

Merge Join (cost=0.83..7,094.36 rows=5,173 width=34) (actual rows= loops=)

  • Merge Cond: ((tbitemadjud_3.clicodigo = tbdotmin_1.clicodigo) AND (tbitemadjud_3.minano = tbdotmin_1.minano) AND (tbitemadjud_3.minnro = tbdotmin_1.minnro))
  • Join Filter: (tbitemadjud_3.cmdsequencia = tbdotmin_1.cmdsequencia)
44. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbitemadjud on tbitemadjud tbitemadjud_3 (cost=0.42..3,756.56 rows=110,076 width=26) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbdotmin on tbdotmin tbdotmin_1 (cost=0.41..1,813.32 rows=54,927 width=22) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash (cost=684.79..684.79 rows=21,703 width=6) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on tbdotacao tbdotacao_1 (cost=0.00..684.79 rows=21,703 width=6) (actual rows= loops=)

  • Filter: (clicodigo = 2595)
48. 0.000 0.000 ↓ 0.0

Sort (cost=1,203.79..1,233.78 rows=11,997 width=26) (actual rows= loops=)

  • Sort Key: tblicitacao.clicodigo, tblicitacao.minano, tblicitacao.minnro
49. 0.000 0.000 ↓ 0.0

Seq Scan on tblicitacao (cost=0.00..390.97 rows=11,997 width=26) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbadjudicacao on tbadjudicacao (cost=0.29..634.76 rows=18,765 width=71) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbminuta on tbminuta (cost=0.29..1,179.91 rows=33,708 width=32) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Hash (cost=1,086.44..1,086.44 rows=27,344 width=56) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Seq Scan on tbunico (cost=0.00..1,086.44 rows=27,344 width=56) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Hash (cost=1.07..1.07 rows=7 width=12) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Seq Scan on tbcliente (cost=0.00..1.07 rows=7 width=12) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

Hash (cost=1,086.44..1,086.44 rows=27,344 width=39) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Seq Scan on tbunico pessoa_cliente (cost=0.00..1,086.44 rows=27,344 width=39) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Hash (cost=116.47..116.47 rows=3,947 width=12) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Seq Scan on tbusuario (cost=0.00..116.47 rows=3,947 width=12) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Hash (cost=1,086.44..1,086.44 rows=27,344 width=39) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on tbunico unico_usuario (cost=0.00..1,086.44 rows=27,344 width=39) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Hash (cost=1.33..1.33 rows=33 width=41) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Seq Scan on tbtipofin (cost=0.00..1.33 rows=33 width=41) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Sort (cost=24.14..25.10 rows=381 width=41) (actual rows= loops=)

  • Sort Key: tborgao.organo, tborgao.orgcodigo
65. 0.000 0.000 ↓ 0.0

Seq Scan on tborgao (cost=0.00..7.81 rows=381 width=41) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbunidade on tbunidade (cost=0.28..44.83 rows=1,570 width=37) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Hash (cost=1.73..1.73 rows=73 width=30) (actual rows= loops=)

68. 0.000 0.000 ↓ 0.0

Seq Scan on tblocalentrega (cost=0.00..1.73 rows=73 width=30) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato ultimo_aditivo_altera_vig (cost=0.29..5.04 rows=1 width=32) (actual rows= loops=)

  • Index Cond: ((clicodigosup = COALESCE(tbcontrato.clicodigosup, tbcontrato.clicodigo)) AND (ctranosup = COALESCE(tbcontrato.ctranosup, tbcontrato.ctrano)) AND (ctridentsup = COALESCE(tbcontrato.ctridentsup, tbcontrato.ctridentificador)))
  • Filter: ((((tbcontrato.ctrano = ctrano) AND (tbcontrato.ctridentificador < ctridentificador)) OR (tbcontrato.ctrano < ctrano)) AND (ctrano = (SubPlan 29)) AND (ctridentificador = (SubPlan 30)))
70.          

SubPlan (forIndex Scan)

71. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.32..2.33 rows=1 width=2) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato ano_ultimo_aditivo (cost=0.29..2.31 rows=1 width=2) (actual rows= loops=)

  • Index Cond: ((clicodigosup = ultimo_aditivo_altera_vig.clicodigosup) AND (ctranosup = ultimo_aditivo_altera_vig.ctranosup) AND (ctridentsup = ultimo_aditivo_altera_vig.ctridentsup))
  • Filter: (ctrtipoaditivo = ANY ('{1,3,5,7,8,14}'::integer[]))
73. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.32..2.33 rows=1 width=8) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato id_ultimo_aditivo (cost=0.29..2.32 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigosup = ultimo_aditivo_altera_vig.clicodigosup) AND (ctranosup = ultimo_aditivo_altera_vig.ctranosup) AND (ctridentsup = ultimo_aditivo_altera_vig.ctridentsup))
  • Filter: ((ctrano = ultimo_aditivo_altera_vig.ctrano) AND (ctrtipoaditivo = ANY ('{1,3,5,7,8,14}'::integer[])))
75.          

SubPlan (forNested Loop Left Join)

76. 0.000 0.000 ↓ 0.0

Result (cost=2,245.71..2,245.72 rows=1 width=0) (actual rows= loops=)

77.          

Initplan (forResult)

78. 0.000 0.000 ↓ 0.0

CTE Scan on valores_contrato (cost=0.00..441.16 rows=1 width=32) (actual rows= loops=)

  • Filter: ((clicodigo = COALESCE(tbcontrato.clicodigosup, tbcontrato.clicodigo)) AND (ctrano = COALESCE(tbcontrato.ctranosup, tbcontrato.ctrano)) AND (ctridentificador = COALESCE(tbcontrato.ctridentsup, tbcontrato.ctridentificador)))
79. 0.000 0.000 ↓ 0.0

Aggregate (cost=561.48..561.49 rows=1 width=32) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

CTE Scan on valores_contrato valores_contrato_1 (cost=0.00..561.47 rows=1 width=32) (actual rows= loops=)

  • Filter: ((clicodigosup = COALESCE(tbcontrato.clicodigosup, tbcontrato.clicodigo)) AND (ctranosup = COALESCE(tbcontrato.ctranosup, tbcontrato.ctrano)) AND (ctridentsup = COALESCE(tbcontrato.ctridentsup, tbcontrato.ctridentificador)) AND (ctrtipoaditivo = ANY ('{1,2,5,6,7,8}'::integer[])))
81. 0.000 0.000 ↓ 0.0

Aggregate (cost=481.27..481.28 rows=1 width=32) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

CTE Scan on valores_contrato valores_contrato_2 (cost=0.00..481.26 rows=1 width=32) (actual rows= loops=)

  • Filter: ((clicodigosup = COALESCE(tbcontrato.clicodigosup, tbcontrato.clicodigo)) AND (ctranosup = COALESCE(tbcontrato.ctranosup, tbcontrato.ctrano)) AND (ctridentsup = COALESCE(tbcontrato.ctridentsup, tbcontrato.ctridentificador)) AND (ctrtipoaditivo = 13))
83. 0.000 0.000 ↓ 0.0

Aggregate (cost=761.78..761.79 rows=1 width=43) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..483.71 rows=1 width=43) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

CTE Scan on valores_contrato valores_contrato_3 (cost=0.00..481.26 rows=1 width=52) (actual rows= loops=)

  • Filter: ((clicodigosup = COALESCE(tbcontrato.clicodigosup, tbcontrato.clicodigo)) AND (ctranosup = COALESCE(tbcontrato.ctranosup, tbcontrato.ctrano)) AND (ctridentsup = COALESCE(tbcontrato.ctridentsup, tbcontrato.ctridentificador)) AND (ctrtipoaditivo = 12))
86. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbitemadjud on tbitemadjud item_equilibrado (cost=0.42..2.44 rows=1 width=39) (actual rows= loops=)

  • Index Cond: ((clicodigo = valores_contrato_3.clicodigomin) AND (minano = valores_contrato_3.minano) AND (minnro = valores_contrato_3.minnro) AND (adjsequencia = valores_contrato_3.adjsequencia))
  • Filter: (valores_contrato_3.unicodigo = unicodigo)
87.          

SubPlan (forAggregate)

88. 0.000 0.000 ↓ 0.0

Aggregate (cost=278.05..278.06 rows=1 width=6) (actual rows= loops=)

89.          

Initplan (forAggregate)

90. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.32..2.33 rows=1 width=2) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato ctridentmax_1 (cost=0.29..2.31 rows=1 width=2) (actual rows= loops=)

  • Index Cond: ((clicodigosup = valores_contrato_3.clicodigosup) AND (ctranosup = valores_contrato_3.ctranosup) AND (ctridentsup = valores_contrato_3.ctridentsup))
  • Filter: (((ctrano = valores_contrato_3.ctrano) AND (ctridentificador < valores_contrato_3.ctridentificador)) OR (ctrano < valores_contrato_3.ctrano))
92. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.70..275.71 rows=1 width=6) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbcontrato on tbcontrato aditivoant (cost=0.29..273.25 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((clicodigo = valores_contrato_3.clicodigo) AND (ctrano = COALESCE($24, valores_contrato_3.ctranosup)))
  • Filter: (ctridentificador = COALESCE((SubPlan 6), valores_contrato_3.ctridentsup))
94.          

SubPlan (forIndex Scan)

95. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.32..2.33 rows=1 width=8) (actual rows= loops=)

96. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato ctridentmax (cost=0.29..2.32 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigosup = valores_contrato_3.clicodigosup) AND (ctranosup = valores_contrato_3.ctranosup) AND (ctridentsup = valores_contrato_3.ctridentsup))
  • Filter: ((ctrano = aditivoant.ctrano) AND (((ctrano = valores_contrato_3.ctrano) AND (ctridentificador < valores_contrato_3.ctridentificador)) OR (ctrano < valores_contrato_3.ctrano)))
97. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbitemadjud on tbitemadjud tbitemadjud_1 (cost=0.42..2.45 rows=1 width=30) (actual rows= loops=)

  • Index Cond: ((clicodigo = aditivoant.clicodigomin) AND (minano = aditivoant.minano) AND (minnro = aditivoant.minnro) AND (adjsequencia = aditivoant.adjsequencia))
  • Filter: ((cmiid = item_equilibrado.cmiid) AND (aditivoant.unicodigo = unicodigo))
98. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbcontratonumeracaotc on tbcontratonumeracaotc (cost=0.28..2.31 rows=1 width=11) (actual rows= loops=)

  • Index Cond: ((clicodigo = 2595) AND (clicodigoctr = tbcontrato.clicodigo) AND (ctrano = tbcontrato.ctrano) AND (ctridentificador = tbcontrato.ctridentificador))
99. 0.000 0.000 ↓ 0.0

CTE Scan on valores_contrato valores_contrato_4 (cost=0.00..441.16 rows=1 width=32) (actual rows= loops=)

  • Filter: ((clicodigo = tbcontrato.clicodigo) AND (ctrano = tbcontrato.ctrano) AND (ctridentificador = tbcontrato.ctridentificador))
100. 0.000 0.000 ↓ 0.0

Aggregate (cost=59.59..59.60 rows=1 width=8) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato contrato_excluir (cost=0.29..59.59 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigosup = tbcontrato.clicodigosup) AND (ctridentsup = tbcontrato.ctridentsup))
  • Filter: (ctrano = (SubPlan 13))
102.          

SubPlan (forIndex Scan)

103. 0.000 0.000 ↓ 0.0

Aggregate (cost=29.79..29.80 rows=1 width=2) (actual rows= loops=)

104. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato contra_max_ano (cost=0.29..29.79 rows=1 width=2) (actual rows= loops=)

  • Index Cond: ((contrato_excluir.clicodigosup = clicodigosup) AND (contrato_excluir.ctridentsup = ctridentsup))
105. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.31..2.32 rows=1 width=8) (actual rows= loops=)

106. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato contrato_excluir_1 (cost=0.29..2.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigosup = tbcontrato.clicodigo) AND (ctranosup = tbcontrato.ctrano) AND (ctridentsup = tbcontrato.ctridentificador))
107. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.30..1.31 rows=1 width=0) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbfiscalcontra on tbfiscalcontra (cost=0.28..1.30 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctrano = tbcontrato.ctrano) AND (ctridentificador = tbcontrato.ctridentificador))
109. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato (cost=2.34..4.38 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo = $57))
110.          

Initplan (forIndex Scan)

111. 0.000 0.000 ↓ 0.0

Result (cost=2.18..2.19 rows=1 width=0) (actual rows= loops=)

112.          

Initplan (forResult)

113. 0.000 0.000 ↓ 0.0

Limit (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato maxfluxoprocesso (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo IS NOT NULL))
115. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.31..2.33 rows=1 width=4) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Index Scan using idx_tbcontrato_numero_adi on tbcontrato contrato_rescisao (cost=0.29..2.31 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((clicodigosup = COALESCE(tbcontratosup.clicodigo, tbcontrato.clicodigo)) AND (ctranosup = COALESCE(tbcontratosup.ctrano, tbcontrato.ctrano)) AND (ctridentsup = COALESCE(tbcontratosup.ctridentificador, tbcontrato.ctridentificador)))
  • Filter: (ctrtipoaditivo = 10)
117. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato tbfluxoprocessocontrato_1 (cost=2.34..4.38 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo = $68))
118.          

Initplan (forIndex Scan)

119. 0.000 0.000 ↓ 0.0

Result (cost=2.18..2.19 rows=1 width=0) (actual rows= loops=)

120.          

Initplan (forResult)

121. 0.000 0.000 ↓ 0.0

Limit (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato maxfluxoprocesso_1 (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo IS NOT NULL))
123. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato tbfluxoprocessocontrato_2 (cost=2.34..4.38 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo = $73))
124.          

Initplan (forIndex Scan)

125. 0.000 0.000 ↓ 0.0

Result (cost=2.18..2.19 rows=1 width=0) (actual rows= loops=)

126.          

Initplan (forResult)

127. 0.000 0.000 ↓ 0.0

Limit (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

128. 0.000 0.000 ↓ 0.0

Index Only Scan Backward using pk_tbfluxoprocessocontrato on tbfluxoprocessocontrato maxfluxoprocesso_2 (cost=0.15..2.18 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbcontrato.clicodigo) AND (ctridentificador = tbcontrato.ctridentificador) AND (ctrano = tbcontrato.ctrano) AND (procodigo IS NOT NULL))
129. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbrelctrsoladitivo on tbrelctrsoladitivo (cost=0.15..7.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (clicodigoctr = tbcontrato.clicodigo)
  • Filter: ((ctrano = ctrano) AND (ctridentificador = ctridentificador))
130. 0.000 0.000 ↓ 0.0

Seq Scan on tbrelctrsoladitivo tbrelctrsoladitivo_1 (cost=0.00..31.75 rows=1 width=4) (actual rows= loops=)

  • Filter: ((ctrano = ctrano) AND (ctridentificador = ctridentificador))