explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F33i

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

Aggregate (cost=3,738,318.63..3,738,318.64 rows=1 width=0) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

CTE Scan on sql_consulta_itens_pagar (cost=3,738,318.57..3,738,318.61 rows=2 width=0) (actual rows= loops=)

3.          

CTE sql_consulta_itens_pagar

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,289.56..3,738,318.57 rows=2 width=776) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,289.41..3,738,303.98 rows=2 width=750) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,289.13..3,738,303.37 rows=2 width=737) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,288.85..3,738,302.34 rows=2 width=733) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,288.43..3,738,299.20 rows=2 width=694) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,288.15..3,738,298.20 rows=2 width=693) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,287.87..3,738,293.58 rows=2 width=691) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,738,287.59..3,738,291.26 rows=1 width=644) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=3,738,287.17..3,738,288.81 rows=1 width=598) (actual rows= loops=)

  • Merge Cond: (tbunicocontabanco_2.bcocodigo = tbbanco.bcocodigo)
13. 0.000 0.000 ↓ 0.0

Sort (cost=3,738,266.47..3,738,266.48 rows=1 width=572) (actual rows= loops=)

  • Sort Key: tbunicocontabanco_2.bcocodigo
14. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,734,214.78..3,738,266.46 rows=1 width=572) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,734,214.50..3,738,263.84 rows=1 width=564) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,734,214.08..3,738,261.39 rows=1 width=514) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Merge Join (cost=3,734,213.66..3,738,219.11 rows=13 width=361) (actual rows= loops=)

  • Merge Cond: ((origem.clicodigo = tbliqext.clicodigo) AND (origem.lixsequencia = tbliqext.lixsequencia))
18. 0.000 0.000 ↓ 0.0

Sort (cost=3,734,213.24..3,734,220.32 rows=2,830 width=254) (actual rows= loops=)

  • Sort Key: origem.clicodigo, origem.lixsequencia
19. 0.000 0.000 ↓ 0.0

Subquery Scan on origem (cost=3,733,548.66..3,734,050.99 rows=2,830 width=254) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,733,548.66..3,734,022.69 rows=2,830 width=24) (actual rows= loops=)

  • Group Key: tbliqext_1.clicodigo, tbliqext_1.loaano, tbliqext_1.lixsequencia
  • Filter: (((((((sum(tbliqext_1.lixvalor) - sum((SubPlan 18))) - sum((SubPlan 19))) - sum((SubPlan 20))) + sum((SubPlan 21))) > '0'::numeric) OR (((sum(CASE WHEN (alternatives: SubPlan 22 or hashed SubPlan 23) THEN '0'::numeric ELSE (SubPlan 24) END) - (sum(0))::numeric) + (sum(0))::numeric) <> sum(((SubPlan 25) - (SubPlan 26))))) AND (((((((sum(tbliqext_1.lixvalor) - sum((SubPlan 27))) - ((sum(CASE WHEN (alternatives: SubPlan 28 or hashed SubPlan 29) THEN '0'::numeric ELSE (SubPlan 30) END) - (sum(0))::numeric) + (sum(0))::numeric)) - sum((SubPlan 31))) - sum((SubPlan 32))) + sum((SubPlan 33))) > '0'::numeric) OR (((sum(CASE WHEN (alternatives: SubPlan 34 or hashed SubPlan 35) THEN '0'::numeric ELSE (SubPlan 36) END) - (sum(0))::numeric) + (sum(0))::numeric) <> sum(((SubPlan 37) - (SubPlan 38))))) AND ((((((sum(tbliqext_1.lixvalor) - sum((SubPlan 39))) - ((sum(CASE WHEN (alternatives: SubPlan 40 or hashed SubPlan 41) THEN '0'::numeric ELSE (SubPlan 42) END) - (sum(0))::numeric) + (sum(0))::numeric)) - sum((SubPlan 43))) - sum((SubPlan 44))) + sum((SubPlan 45))) <> '0'::numeric))
21. 0.000 0.000 ↓ 0.0

Hash Join (cost=15,784.50..20,865.46 rows=32,494 width=24) (actual rows= loops=)

  • Hash Cond: (tbextra_6.vincodigo = tbvinculo_filtro.vincodigo)
22. 0.000 0.000 ↓ 0.0

Hash Join (cost=15,717.10..20,088.11 rows=16,211 width=34) (actual rows= loops=)

  • Hash Cond: (tbextra_6.unicodigo = tbunico_1.unicodigo)
23. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,925.03..7,073.14 rows=16,211 width=42) (actual rows= loops=)

  • Hash Cond: (tbextra_6.extnumero = tbliqext_1.extnumero)
24. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbextra on tbextra tbextra_6 (cost=0.42..3,266.42 rows=18,000 width=26) (actual rows= loops=)

  • Index Cond: ((clicodigo = 2865) AND (loaano = '2019'::smallint))
25. 0.000 0.000 ↓ 0.0

Hash (cost=2,700.12..2,700.12 rows=17,960 width=24) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqext on tbliqext tbliqext_1 (cost=0.42..2,700.12 rows=17,960 width=24) (actual rows= loops=)

  • Index Cond: ((clicodigo = 2865) AND (loaano = '2019'::smallint))
27. 0.000 0.000 ↓ 0.0

Hash (cost=9,609.25..9,609.25 rows=254,625 width=8) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on tbunico tbunico_1 (cost=0.00..9,609.25 rows=254,625 width=8) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash (cost=61.14..61.14 rows=501 width=10) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbvinculo on tbvinculo tbvinculo_filtro (cost=0.28..61.14 rows=501 width=10) (actual rows= loops=)

  • Index Cond: (loaano = '2019'::smallint)
31.          

SubPlan (for HashAggregate)

32. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.86..2.87 rows=1 width=6) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqextest on tbliqextest (cost=0.27..2.86 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
34. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbliqextest on tbliqextest tbliqextest_1 (cost=0.27..2.86 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
35. 0.000 0.000 ↓ 0.0

Seq Scan on tbliqextest tbliqextest_2 (cost=0.00..7.74 rows=274 width=14) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Aggregate (cost=3.59..3.60 rows=1 width=7) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3.58 rows=2 width=7) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbextra on tbextra (cost=0.42..2.44 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
39. 0.000 0.000 ↓ 0.0

Seq Scan on tbretext (cost=0.00..1.12 rows=2 width=17) (actual rows= loops=)

  • Filter: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
40. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.91..4.92 rows=1 width=6) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.84..4.91 rows=1 width=6) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Index Scan using idx_item_programacao_extra on tbitemprogramacao (cost=0.42..2.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (ipgsituacao <> 2)
43. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_pagamento_itemprogramacao on tbpagamento (cost=0.42..2.45 rows=1 width=14) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbitemprogramacao.clicodigo) AND (clicodigo = tbliqext_1.clicodigo) AND (loaano = tbitemprogramacao.loaano) AND (pgmnumero = tbitemprogramacao.pgmnumero) AND (ipgsequencia = tbitemprogramacao.ipgsequencia))
44. 0.000 0.000 ↓ 0.0

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

45. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_1 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (((pagtiporetencao IS NULL) OR (pagtiporetencao = 0)) AND (pagtipoemp = ANY ('{3,6}'::integer[])))
46. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

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

48. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_2 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: ((pagtiporetencao IS NULL) OR (pagtiporetencao = 0))
49. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_2.loaano) AND (pagtipoemp = tbpagamento_2.pagtipoemp) AND (pagnumero = tbpagamento_2.pagnumero))
50. 0.000 0.000 ↓ 0.0

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

51. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_3 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
52. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

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

54. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_4 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
55. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_1 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_4.loaano) AND (pagtipoemp = tbpagamento_4.pagtipoemp) AND (pagnumero = tbpagamento_4.pagnumero))
56. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.86..2.87 rows=1 width=6) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqextest on tbliqextest tbliqextest_3 (cost=0.27..2.86 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
58. 0.000 0.000 ↓ 0.0

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

59. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_5 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (((pagtiporetencao IS NULL) OR (pagtiporetencao = 0)) AND (pagtipoemp = ANY ('{3,6}'::integer[])))
60. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.91..4.92 rows=1 width=6) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.84..4.91 rows=1 width=6) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Index Scan using idx_item_programacao_extra on tbitemprogramacao tbitemprogramacao_1 (cost=0.42..2.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (ipgsituacao <> 2)
63. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_pagamento_itemprogramacao on tbpagamento tbpagamento_6 (cost=0.42..2.45 rows=1 width=14) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbitemprogramacao_1.clicodigo) AND (clicodigo = tbliqext_1.clicodigo) AND (loaano = tbitemprogramacao_1.loaano) AND (pgmnumero = tbitemprogramacao_1.pgmnumero) AND (ipgsequencia = tbitemprogramacao_1.ipgsequencia))
64. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

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

66. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_7 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: ((pagtiporetencao IS NULL) OR (pagtiporetencao = 0))
67. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_2 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_7.loaano) AND (pagtipoemp = tbpagamento_7.pagtipoemp) AND (pagnumero = tbpagamento_7.pagnumero))
68. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbliqextest on tbliqextest tbliqextest_4 (cost=0.27..2.86 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
69. 0.000 0.000 ↓ 0.0

Seq Scan on tbliqextest tbliqextest_5 (cost=0.00..7.74 rows=274 width=14) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Aggregate (cost=3.59..3.60 rows=1 width=7) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3.58 rows=2 width=7) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbextra on tbextra tbextra_1 (cost=0.42..2.44 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
73. 0.000 0.000 ↓ 0.0

Seq Scan on tbretext tbretext_1 (cost=0.00..1.12 rows=2 width=17) (actual rows= loops=)

  • Filter: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
74. 0.000 0.000 ↓ 0.0

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

75. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_8 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
76. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

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

78. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_9 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
79. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_3 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_9.loaano) AND (pagtipoemp = tbpagamento_9.pagtipoemp) AND (pagnumero = tbpagamento_9.pagnumero))
80. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.86..2.87 rows=1 width=6) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqextest on tbliqextest tbliqextest_6 (cost=0.27..2.86 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
82. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbliqextest on tbliqextest tbliqextest_7 (cost=0.27..2.86 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
83. 0.000 0.000 ↓ 0.0

Seq Scan on tbliqextest tbliqextest_8 (cost=0.00..7.74 rows=274 width=14) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Aggregate (cost=3.59..3.60 rows=1 width=7) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3.58 rows=2 width=7) (actual rows= loops=)

86. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbextra on tbextra tbextra_2 (cost=0.42..2.44 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
87. 0.000 0.000 ↓ 0.0

Seq Scan on tbretext tbretext_2 (cost=0.00..1.12 rows=2 width=17) (actual rows= loops=)

  • Filter: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
88. 0.000 0.000 ↓ 0.0

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

89. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_10 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (((pagtiporetencao IS NULL) OR (pagtiporetencao = 0)) AND (pagtipoemp = ANY ('{3,6}'::integer[])))
90. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.91..4.92 rows=1 width=6) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.84..4.91 rows=1 width=6) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Index Scan using idx_item_programacao_extra on tbitemprogramacao tbitemprogramacao_2 (cost=0.42..2.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (ipgsituacao <> 2)
93. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_pagamento_itemprogramacao on tbpagamento tbpagamento_11 (cost=0.42..2.45 rows=1 width=14) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbitemprogramacao_2.clicodigo) AND (clicodigo = tbliqext_1.clicodigo) AND (loaano = tbitemprogramacao_2.loaano) AND (pgmnumero = tbitemprogramacao_2.pgmnumero) AND (ipgsequencia = tbitemprogramacao_2.ipgsequencia))
94. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

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

96. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_12 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: ((pagtiporetencao IS NULL) OR (pagtiporetencao = 0))
97. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_4 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_12.loaano) AND (pagtipoemp = tbpagamento_12.pagtipoemp) AND (pagnumero = tbpagamento_12.pagnumero))
98. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbliqextest on tbliqextest tbliqextest_9 (cost=0.27..2.86 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
99. 0.000 0.000 ↓ 0.0

Seq Scan on tbliqextest tbliqextest_10 (cost=0.00..7.74 rows=274 width=14) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Aggregate (cost=3.59..3.60 rows=1 width=7) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3.58 rows=2 width=7) (actual rows= loops=)

102. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbextra on tbextra tbextra_3 (cost=0.42..2.44 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
103. 0.000 0.000 ↓ 0.0

Seq Scan on tbretext tbretext_3 (cost=0.00..1.12 rows=2 width=17) (actual rows= loops=)

  • Filter: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
104. 0.000 0.000 ↓ 0.0

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

105. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_13 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
106. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

107. 0.000 0.000 ↓ 0.0

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

108. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_14 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (pagtiporetencao = 1)
109. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_5 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_14.loaano) AND (pagtipoemp = tbpagamento_14.pagtipoemp) AND (pagnumero = tbpagamento_14.pagnumero))
110. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.86..2.87 rows=1 width=6) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqextest on tbliqextest tbliqextest_11 (cost=0.27..2.86 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
112. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbliqextest on tbliqextest tbliqextest_12 (cost=0.27..2.86 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
113. 0.000 0.000 ↓ 0.0

Seq Scan on tbliqextest tbliqextest_13 (cost=0.00..7.74 rows=274 width=14) (actual rows= loops=)

114. 0.000 0.000 ↓ 0.0

Aggregate (cost=3.59..3.60 rows=1 width=7) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..3.58 rows=2 width=7) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbextra on tbextra tbextra_4 (cost=0.42..2.44 rows=1 width=10) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
117. 0.000 0.000 ↓ 0.0

Seq Scan on tbretext tbretext_4 (cost=0.00..1.12 rows=2 width=17) (actual rows= loops=)

  • Filter: ((clicodigo = tbliqext_1.clicodigo) AND (loaano = tbliqext_1.loaano) AND (extnumero = tbliqext_1.extnumero))
118. 0.000 0.000 ↓ 0.0

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

119. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_15 (cost=0.42..2.45 rows=1 width=6) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (((pagtiporetencao IS NULL) OR (pagtiporetencao = 0)) AND (pagtipoemp = ANY ('{3,6}'::integer[])))
120. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.91..4.92 rows=1 width=6) (actual rows= loops=)

121. 0.000 0.000 ↓ 0.0

Nested Loop Anti Join (cost=0.84..4.91 rows=1 width=6) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Index Scan using idx_item_programacao_extra on tbitemprogramacao tbitemprogramacao_3 (cost=0.42..2.45 rows=1 width=20) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: (ipgsituacao <> 2)
123. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_pagamento_itemprogramacao on tbpagamento tbpagamento_16 (cost=0.42..2.45 rows=1 width=14) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbitemprogramacao_3.clicodigo) AND (clicodigo = tbliqext_1.clicodigo) AND (loaano = tbitemprogramacao_3.loaano) AND (pgmnumero = tbitemprogramacao_3.pgmnumero) AND (ipgsequencia = tbitemprogramacao_3.ipgsequencia))
124. 0.000 0.000 ↓ 0.0

Aggregate (cost=4.77..4.78 rows=1 width=6) (actual rows= loops=)

125. 0.000 0.000 ↓ 0.0

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

126. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagamento_extra on tbpagamento tbpagamento_17 (cost=0.42..2.45 rows=1 width=12) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanolix = tbliqext_1.loaano) AND (lixsequencia = tbliqext_1.lixsequencia))
  • Filter: ((pagtiporetencao IS NULL) OR (pagtiporetencao = 0))
127. 0.000 0.000 ↓ 0.0

Index Scan using idx_pagest_pagamento on tbpagamentoest tbpagamentoest_6 (cost=0.28..2.30 rows=1 width=18) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext_1.clicodigo) AND (loaanopag = tbpagamento_17.loaano) AND (pagtipoemp = tbpagamento_17.pagtipoemp) AND (pagnumero = tbpagamento_17.pagnumero))
128. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbliqext on tbliqext (cost=0.42..3,894.71 rows=17,960 width=117) (actual rows= loops=)

  • Index Cond: (loaano = 2019)
129. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbextra on tbextra tbextra_5 (cost=0.42..3.24 rows=1 width=161) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbliqext.clicodigo) AND (loaano = 2019) AND (extnumero = tbliqext.extnumero))
  • Filter: (((extflagestorno IS NULL) OR (extflagestorno = 0)) AND (to_ascii(upper(((plncodigo)::character varying)::text), 'WIN1250'::name) ~~ '218810119%'::text) AND ((SubPlan 8) = 0))
130.          

SubPlan (for Index Scan)

131. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.44..2.45 rows=1 width=0) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_extra_extraanterior on tbextra extracontador (cost=0.42..2.44 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((clicodigo = tbextra_5.clicodigo) AND (loaanoant = tbextra_5.loaano) AND (extnumeroant = tbextra_5.extnumero))
133. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbunico on tbunico (cost=0.42..2.44 rows=1 width=50) (actual rows= loops=)

  • Index Cond: (unicodigo = tbextra_5.unicodigo)
134. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbunicocontabanco on tbunicocontabanco tbunicocontabanco_2 (cost=0.29..2.61 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (unicodigo = tbunico.unicodigo)
  • Filter: (ifcsequencia = (SubPlan 7))
135.          

SubPlan (for Index Scan)

136. 0.000 0.000 ↓ 0.0

Limit (cost=0.29..2.30 rows=1 width=2) (actual rows= loops=)

137. 0.000 0.000 ↓ 0.0

Index Scan using idx_conta_principal_unica on tbunicocontabanco tbunicocontabanco_sub (cost=0.29..2.30 rows=1 width=2) (actual rows= loops=)

  • Index Cond: ((unicodigo = tbunicocontabanco_2.unicodigo) AND (ifccontaprincipal = 1))
138. 0.000 0.000 ↓ 0.0

Sort (cost=20.70..21.55 rows=340 width=28) (actual rows= loops=)

  • Sort Key: tbbanco.bcocodigo
139. 0.000 0.000 ↓ 0.0

Seq Scan on tbbanco (cost=0.00..6.40 rows=340 width=28) (actual rows= loops=)

140. 0.000 0.000 ↓ 0.0

Index Scan using tmp_plano on tbplano (cost=0.42..2.44 rows=1 width=64) (actual rows= loops=)

  • Index Cond: ((loaano = tbextra_5.loaano) AND (loaano = 2019) AND (plntipoplano = tbextra_5.plntipoplano) AND (plncodigo = tbextra_5.plncodigo))
  • Filter: (clicodigopln = tbextra_5.clicodigopln)
141. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbvinculo on tbvinculo (cost=0.28..2.30 rows=1 width=55) (actual rows= loops=)

  • Index Cond: ((tbextra_5.loaano = loaano) AND (loaano = 2019) AND (tbextra_5.vincodigo = vincodigo))
142. 0.000 0.000 ↓ 0.0

Index Scan using "IDX_FK BANCOPLANO->PLANO" on tbbancoplano (cost=0.28..2.30 rows=1 width=32) (actual rows= loops=)

  • Index Cond: ((clicodigopln = tbextra_5.clicodigopln) AND (loaano = tbextra_5.loaanobanco) AND (plncodigo = tbextra_5.plncodigobanco) AND (plntipoplano = tbextra_5.plntipoplanobanco))
143. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbbancoagencia on tbbancoagencia (cost=0.28..0.49 rows=1 width=7) (actual rows= loops=)

  • Index Cond: ((bcocodigo = tbunicocontabanco_2.bcocodigo) AND (bcaagencia = tbunicocontabanco_2.bcaagencia))
144. 0.000 0.000 ↓ 0.0

Index Scan using tmp_plano on tbplano plano_contabil (cost=0.42..1.56 rows=1 width=64) (actual rows= loops=)

  • Index Cond: ((loaano = tbbancoplano.loaano) AND (plntipoplano = tbbancoplano.plntipoplano) AND (plncodigo = tbbancoplano.plncodigo))
  • Filter: (clicodigopln = tbbancoplano.clicodigopln)
145. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbunicocontabanco on tbunicocontabanco conta_pagamento (cost=0.29..0.50 rows=1 width=24) (actual rows= loops=)

  • Index Cond: ((unicodigo = tbbancoplano.unicodigo) AND (ifcsequencia = tbbancoplano.ifcsequencia))
146. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbbancoagencia on tbbancoagencia agencia_pagamento (cost=0.28..0.30 rows=1 width=17) (actual rows= loops=)

  • Index Cond: ((bcocodigo = conta_pagamento.bcocodigo) AND (bcaagencia = conta_pagamento.bcaagencia))
147. 0.000 0.000 ↓ 0.0

Index Scan using pk_tbbanco on tbbanco banco_pagamento (cost=0.15..0.17 rows=1 width=28) (actual rows= loops=)

  • Index Cond: (bcocodigo = agencia_pagamento.bcocodigo)
148.          

SubPlan (for Nested Loop Left Join)

149. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbvinculo on tbvinculo tbvinculo_exists (cost=0.28..2.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((loaano = tbvinculo.loaano) AND (vincodigo = tbvinculo.vincodigo))
  • Filter: (vincodigo = ANY ('{1010,1020,1101,1102}'::bigint[]))
150. 0.000 0.000 ↓ 0.0

Seq Scan on tbvinculo tbvinculo_exists_1 (cost=0.00..145.45 rows=41 width=10) (actual rows= loops=)

  • Filter: (vincodigo = ANY ('{1010,1020,1101,1102}'::bigint[]))
151. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbvinculo on tbvinculo tbvinculo_exists_2 (cost=0.28..2.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((loaano = tbvinculo.loaano) AND (vincodigo = tbvinculo.vincodigo))
  • Filter: (vincodigo = ANY ('{1010,1020,1101,1102}'::bigint[]))
152. 0.000 0.000 ↓ 0.0

Seq Scan on tbvinculo tbvinculo_exists_3 (cost=0.00..145.45 rows=41 width=10) (actual rows= loops=)

  • Filter: (vincodigo = ANY ('{1010,1020,1101,1102}'::bigint[]))
153. 0.000 0.000 ↓ 0.0

Index Only Scan using pk_tbunicocontabanco on tbunicocontabanco (cost=0.29..2.31 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (unicodigo = tbextra_5.unicodigo)
154. 0.000 0.000 ↓ 0.0

Seq Scan on tbunicocontabanco tbunicocontabanco_1 (cost=0.00..488.02 rows=19,902 width=8) (actual rows= loops=)