explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aDv

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

Limit (cost=541.34..541.35 rows=3 width=1,032) (actual time=0.127..0.127 rows=0 loops=1)

2. 0.015 0.127 ↓ 0.0 0 1

Sort (cost=541.34..541.35 rows=3 width=1,032) (actual time=0.127..0.127 rows=0 loops=1)

  • Sort Key: (row_number() OVER (?))
  • Sort Method: quicksort Memory: 25kB
3. 0.002 0.112 ↓ 0.0 0 1

WindowAgg (cost=541.24..541.32 rows=3 width=1,032) (actual time=0.112..0.112 rows=0 loops=1)

4. 0.007 0.110 ↓ 0.0 0 1

Sort (cost=541.24..541.25 rows=3 width=1,032) (actual time=0.110..0.110 rows=0 loops=1)

  • Sort Key: sqlunion.cd_empresa, sqlunion.cd_filial, sqlunion.dt_movimento, sqlunion.numero
  • Sort Method: quicksort Memory: 25kB
5. 0.001 0.103 ↓ 0.0 0 1

Subquery Scan on sqlunion (cost=209.75..541.22 rows=3 width=1,032) (actual time=0.103..0.103 rows=0 loops=1)

6. 0.001 0.102 ↓ 0.0 0 1

HashSetOp Except All (cost=209.75..541.19 rows=3 width=385) (actual time=0.102..0.102 rows=0 loops=1)

7. 0.000 0.101 ↓ 0.0 0 1

Append (cost=209.75..540.47 rows=6 width=385) (actual time=0.101..0.101 rows=0 loops=1)

8. 0.000 0.080 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=209.75..259.50 rows=3 width=385) (actual time=0.080..0.080 rows=0 loops=1)

9. 0.010 0.080 ↓ 0.0 0 1

Hash Join (cost=209.75..259.47 rows=3 width=385) (actual time=0.080..0.080 rows=0 loops=1)

  • Hash Cond: (findocparmov.cd_filial_mov = pesfilmov.cd_filial)
10. 0.000 0.000 ↓ 0.0 0

Nested Loop Anti Join (cost=122.11..168.21 rows=21 width=347) (never executed)

  • Join Filter: ((procan.cd_empresa = findocparmov.cd_empresa) AND (procan.cd_base = findocparmov.cd_base) AND (procan.seq_processo = findocparmov.seq_processo))
11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=121.70..161.60 rows=21 width=347) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=33.96..73.45 rows=3 width=317) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=9.88..49.27 rows=1 width=309) (never executed)

  • Join Filter: ((findocpar.cd_base = pro.cd_base) AND (findocpar.seq_processo = pro.seq_processo))
14. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=9.32..42.93 rows=1 width=341) (never executed)

  • Join Filter: (findocparmov.cd_tipo_cobranca = tcb.cd_tipo_cobranca)
15. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=9.32..41.50 rows=1 width=341) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=9.03..41.19 rows=1 width=349) (never executed)

  • Join Filter: (pesend.seq_endereco = pesendtip.seq_endereco)
17. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=8.74..40.83 rows=1 width=373) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=8.33..40.32 rows=1 width=349) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=8.05..39.87 rows=1 width=323) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=7.77..39.52 rows=1 width=315) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=7.48..31.20 rows=1 width=261) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=7.33..23.00 rows=1 width=250) (never executed)

  • Join Filter: ((findocparmov.cd_base_orig = findocpar.cd_base) AND (findocparmov.seq_processo_orig = findocpar.seq_processo) AND ((findocparmov.parcela_orig)::text = (findocpar.parcela)::text))
23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=6.78..16.66 rows=1 width=215) (never executed)

  • Join Filter: ((findoc.cd_base = findocparmov.cd_base_orig) AND (findoc.seq_processo = findocparmov.seq_processo_orig))
24. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_doc_parcela_mov_idx4 on fin_doc_parcela_mov findocparmov (cost=0.56..6.33 rows=1 width=136) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Filter: ((dt_movimento >= to_date('2018-10-01'::text, 'yyyy-MM-dd'::text)) AND (dt_movimento <= to_date('2019-01-04'::text, 'yyyy-MM-dd'::text)))
25. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=6.22..10.31 rows=1 width=79) (never executed)

  • Hash Cond: (tipdoccre.cd_tipo_doc_credito = findoc.cd_tipo_doc_credito)
26. 0.000 0.000 ↓ 0.0 0

Seq Scan on tipo_doc_credito tipdoccre (cost=0.00..3.79 rows=79 width=19) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Hash (cost=6.21..6.21 rows=1 width=68) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_documento_pk on fin_documento findoc (cost=0.43..6.21 rows=1 width=68) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Filter: ((cd_filial = 30) AND (id_cr_cp = 'R'::bpchar) AND (id_provisao = 'N'::bpchar))
29. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_doc_parcela_pk on fin_doc_parcela findocpar (cost=0.55..6.32 rows=1 width=45) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Filter: (id_situacao_eletronica = ANY ('{0,9}'::bpchar[]))
30. 0.000 0.000 ↓ 0.0 0

Index Scan using operacao_financ_pk on operacao_financ opefin (cost=0.15..8.19 rows=1 width=11) (never executed)

  • Index Cond: (cd_operacao = findocparmov.cd_operacao)
  • Filter: (((id_tipo_operacao)::text <> 'EP'::text) AND ((id_tipo_operacao)::text = ANY ('{BD,AD,FI,IN,EM,EP,BN,SB,TE,DV,SE,BT,PG,EC,TS,BA}'::text[])))
31. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_pk on pessoa pes (cost=0.29..8.31 rows=1 width=54) (never executed)

  • Index Cond: (cd_pessoa = findoc.cd_pessoa)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_associado_idx1 on pessoa_associado pesass (cost=0.29..0.33 rows=1 width=16) (never executed)

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
  • Filter: (dt_demissao IS NULL)
33. 0.000 0.000 ↓ 0.0 0

Index Scan using operacao_pk on operacao ope (cost=0.28..0.44 rows=1 width=42) (never executed)

  • Index Cond: (cd_operacao = opefin.cd_operacao)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_endereco_pk on pessoa_endereco pesend (cost=0.41..0.51 rows=1 width=24) (never executed)

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_endereco_tipo_uk1 on pessoa_endereco_tipo pesendtip (cost=0.29..0.34 rows=1 width=16) (never executed)

  • Index Cond: ((cd_pessoa = pes.cd_pessoa) AND ((id_tipo_endereco)::text = 'PRI'::text))
36. 0.000 0.000 ↓ 0.0 0

Index Only Scan using localidade_pk on localidade loc (cost=0.29..0.30 rows=1 width=8) (never executed)

  • Index Cond: (cd_localidade = pesend.cd_localidade)
  • Heap Fetches: 0
37. 0.000 0.000 ↓ 0.0 0

Seq Scan on tipo_cobranca tcb (cost=0.00..1.19 rows=19 width=16) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Index Only Scan using processo_pk on processo pro (cost=0.56..6.33 rows=1 width=24) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Heap Fetches: 0
39. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp.cd_empresa, pesemp.cd_pessoa, pesemp.cd_regime_fiscal, pesemp.dt_baixa, pesemp.dt_arq_atos_const, pesemp.dt_arq_conv_simp_empr, pesemp.coef_acresc_venda_ncoop, pesemp.id_cooperativa, pesemp.id_origem_tribut, pesemp.id_controla_fci, pesemp.nr_max_itens_nfe, pesemp.id_valida_cest_fat, pesemp.id_consiste_ncm_xml, pesemp.nr_dias_rev_cad_cli_ven
40. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_1 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
44. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_1.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
45. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
46. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_2 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
48. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_1 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
49. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
50. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_2 (cost=0.00..1.01 rows=1 width=112) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Materialize (cost=87.73..87.91 rows=7 width=54) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Subquery Scan on pesfil (cost=87.73..87.87 rows=7 width=54) (never executed)

53. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=87.73..87.80 rows=7 width=211) (never executed)

  • Group Key: pesfil_1.cd_empresa, pesfil_1.cd_filial, pesfil_1.id_atividade, pesfil_1.cd_pessoa, pesfil_1.cd_segmento_fiscal, pesfil_1.cd_lista_preco_basica, pesfil_1.cd_pessoa_clas_fiscal, pesfil_1.id_perfil_sped_fiscal, pesfil_1.id_periodo_inventario, pesfil_1.mes_inventario_anual, pesfil_1.versao_leiaute_nfe, pesfil_1.id_formato_danfe, pesfil_1.id_ambiente_nfe, pesfil_1.cd_operacao_venda, pesfil_1.id_volume_trans, pesfil_1.id_utiliza_lacre_transp, pesfil_1.cd_tipo_cobranca, pesfil_1.cd_banco_portador, pesfil_1.nr_agencia_portador, pesfil_1.nr_conta_portador, pesfil_1.id_clas_cons_en_eletr, pesfil_1.id_tipo_ligacao_default, pesfil_1.id_grupo_tensao_default, pesfil_1.id_clas_cons_gas, pesfil_1.id_tipo_assinante_comunic, pesfil_1.id_clas_cons_agua, pesfil_1.cd_lista_preco_tipo_basico, pesfil_1.cd_lista_preco_prom, pesfil_1.cd_lista_preco_tipo_prom, pesfil_1.cd_grupo_unidade_medida, pesfil_1.id_ecf, pesfil_1.id_tipo_atualizacao_est, pesfil_1.id_atualizando_est, pesfil_1.dt_ult_fec_estoque, pesfil_1.mes_invent_sped_anual, pesfil_1.id_emite_nf_conjugada, pesfil_1.id_origem_tipo_preco, pesfil_1.cd_operacao_serv, pesfil_1.id_obriga_cd_barras_nfe, pesfil_1.id_ativo, pesfil_1.abrev_filial, pesfil_1.id_geracao_nfe, pesfil_1.id_matriz, pesfil_1.cd_perfil_filial, pesfil_1.id_venda_saldo_terc
54. 0.000 0.000 ↓ 0.0 0

Append (cost=24.64..86.94 rows=7 width=211) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.64..42.77 rows=3 width=211) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..18.60 rows=1 width=211) (never executed)

57. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..12.61 rows=1 width=16) (never executed)

58. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_3 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'N'::bpchar)
59. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_filial_pk on operador_pessoa_filial opepesfil (cost=0.28..4.30 rows=1 width=23) (never executed)

  • Index Cond: ((cd_operador = (ope_3.cd_operador)::text) AND (cd_empresa = 30) AND (cd_filial = 30))
  • Heap Fetches: 0
60. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_1 (cost=0.00..5.97 rows=1 width=211) (never executed)

  • Filter: ((cd_empresa = 30) AND (cd_filial = 30))
61. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_3.cd_empresa, pesemp_3.cd_pessoa, pesemp_3.cd_regime_fiscal, pesemp_3.dt_baixa, pesemp_3.dt_arq_atos_const, pesemp_3.dt_arq_conv_simp_empr, pesemp_3.coef_acresc_venda_ncoop, pesemp_3.id_cooperativa, pesemp_3.id_origem_tribut, pesemp_3.id_controla_fci, pesemp_3.nr_max_itens_nfe, pesemp_3.id_valida_cest_fat, pesemp_3.id_consiste_ncm_xml, pesemp_3.nr_dias_rev_cad_cli_ven
62. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

63. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_4 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
66. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_1 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_4.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
67. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_3 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
68. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

69. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_5 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
70. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_4 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
71. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
72. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_5 (cost=0.00..1.01 rows=1 width=112) (never executed)

73. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.36..38.45 rows=3 width=211) (never executed)

74. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..14.28 rows=1 width=211) (never executed)

75. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_6 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
76. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_2 (cost=0.00..5.97 rows=1 width=211) (never executed)

  • Filter: ((cd_empresa = 30) AND (cd_filial = 30))
77. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_6.cd_empresa, pesemp_6.cd_pessoa, pesemp_6.cd_regime_fiscal, pesemp_6.dt_baixa, pesemp_6.dt_arq_atos_const, pesemp_6.dt_arq_conv_simp_empr, pesemp_6.coef_acresc_venda_ncoop, pesemp_6.id_cooperativa, pesemp_6.id_origem_tribut, pesemp_6.id_controla_fci, pesemp_6.nr_max_itens_nfe, pesemp_6.id_valida_cest_fat, pesemp_6.id_consiste_ncm_xml, pesemp_6.nr_dias_rev_cad_cli_ven
78. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

79. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

80. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

81. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_7 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
82. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_2 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_7.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
83. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_6 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
84. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

85. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_8 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
86. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_7 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
87. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
88. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_8 (cost=0.00..1.01 rows=1 width=112) (never executed)

89. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..5.65 rows=1 width=211) (never executed)

  • One-Time Filter: false
90. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_3 (cost=0.00..5.65 rows=1 width=211) (never executed)

91. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.42..6.19 rows=1 width=24) (never executed)

92. 0.000 0.000 ↓ 0.0 0

Index Only Scan using processo_canc_pk on processo_canc procan (cost=0.42..6.19 rows=1 width=24) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Heap Fetches: 0
93. 0.000 0.070 ↓ 0.0 0 1

Hash (cost=87.55..87.55 rows=7 width=54) (actual time=0.070..0.070 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
94. 0.001 0.070 ↓ 0.0 0 1

Subquery Scan on pesfilmov (cost=87.41..87.55 rows=7 width=54) (actual time=0.070..0.070 rows=0 loops=1)

95. 0.001 0.069 ↓ 0.0 0 1

HashAggregate (cost=87.41..87.48 rows=7 width=211) (actual time=0.069..0.069 rows=0 loops=1)

  • Group Key: pesfil_4.cd_empresa, pesfil_4.cd_filial, pesfil_4.id_atividade, pesfil_4.cd_pessoa, pesfil_4.cd_segmento_fiscal, pesfil_4.cd_lista_preco_basica, pesfil_4.cd_pessoa_clas_fiscal, pesfil_4.id_perfil_sped_fiscal, pesfil_4.id_periodo_inventario, pesfil_4.mes_inventario_anual, pesfil_4.versao_leiaute_nfe, pesfil_4.id_formato_danfe, pesfil_4.id_ambiente_nfe, pesfil_4.cd_operacao_venda, pesfil_4.id_volume_trans, pesfil_4.id_utiliza_lacre_transp, pesfil_4.cd_tipo_cobranca, pesfil_4.cd_banco_portador, pesfil_4.nr_agencia_portador, pesfil_4.nr_conta_portador, pesfil_4.id_clas_cons_en_eletr, pesfil_4.id_tipo_ligacao_default, pesfil_4.id_grupo_tensao_default, pesfil_4.id_clas_cons_gas, pesfil_4.id_tipo_assinante_comunic, pesfil_4.id_clas_cons_agua, pesfil_4.cd_lista_preco_tipo_basico, pesfil_4.cd_lista_preco_prom, pesfil_4.cd_lista_preco_tipo_prom, pesfil_4.cd_grupo_unidade_medida, pesfil_4.id_ecf, pesfil_4.id_tipo_atualizacao_est, pesfil_4.id_atualizando_est, pesfil_4.dt_ult_fec_estoque, pesfil_4.mes_invent_sped_anual, pesfil_4.id_emite_nf_conjugada, pesfil_4.id_origem_tipo_preco, pesfil_4.cd_operacao_serv, pesfil_4.id_obriga_cd_barras_nfe, pesfil_4.id_ativo, pesfil_4.abrev_filial, pesfil_4.id_geracao_nfe, pesfil_4.id_matriz, pesfil_4.cd_perfil_filial, pesfil_4.id_venda_saldo_terc
96. 0.000 0.068 ↓ 0.0 0 1

Append (cost=24.64..86.62 rows=7 width=211) (actual time=0.068..0.068 rows=0 loops=1)

97. 0.000 0.025 ↓ 0.0 0 1

Nested Loop (cost=24.64..42.61 rows=3 width=211) (actual time=0.025..0.025 rows=0 loops=1)

98. 0.001 0.025 ↓ 0.0 0 1

Nested Loop (cost=0.56..18.43 rows=1 width=211) (actual time=0.025..0.025 rows=0 loops=1)

  • Join Filter: (opepesfil_1.cd_filial = pesfil_4.cd_filial)
99. 0.001 0.024 ↓ 0.0 0 1

Nested Loop (cost=0.56..12.61 rows=1 width=16) (actual time=0.024..0.024 rows=0 loops=1)

100. 0.023 0.023 ↓ 0.0 0 1

Index Scan using operador_uk1 on operador ope_9 (cost=0.28..8.29 rows=1 width=9) (actual time=0.023..0.023 rows=0 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'N'::bpchar)
  • Rows Removed by Filter: 1
101. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_filial_pk on operador_pessoa_filial opepesfil_1 (cost=0.28..4.30 rows=1 width=23) (never executed)

  • Index Cond: ((cd_operador = (ope_9.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
102. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_4 (cost=0.00..5.81 rows=1 width=211) (never executed)

  • Filter: (cd_empresa = 30)
103. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_9.cd_empresa, pesemp_9.cd_pessoa, pesemp_9.cd_regime_fiscal, pesemp_9.dt_baixa, pesemp_9.dt_arq_atos_const, pesemp_9.dt_arq_conv_simp_empr, pesemp_9.coef_acresc_venda_ncoop, pesemp_9.id_cooperativa, pesemp_9.id_origem_tribut, pesemp_9.id_controla_fci, pesemp_9.nr_max_itens_nfe, pesemp_9.id_valida_cest_fat, pesemp_9.id_consiste_ncm_xml, pesemp_9.nr_dias_rev_cad_cli_ven
104. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

105. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

106. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

107. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_10 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
108. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_3 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_10.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
109. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_9 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
110. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

111. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_11 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
112. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_10 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
113. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
114. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_11 (cost=0.00..1.01 rows=1 width=112) (never executed)

115. 0.000 0.043 ↓ 0.0 0 1

Nested Loop (cost=24.36..38.29 rows=3 width=211) (actual time=0.043..0.043 rows=0 loops=1)

116. 0.003 0.043 ↓ 0.0 0 1

Nested Loop (cost=0.28..14.12 rows=1 width=211) (actual time=0.043..0.043 rows=0 loops=1)

117. 0.008 0.008 ↑ 1.0 1 1

Index Scan using operador_uk1 on operador ope_12 (cost=0.28..8.29 rows=1 width=0) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
118. 0.032 0.032 ↓ 0.0 0 1

Seq Scan on pessoa_filial pesfil_5 (cost=0.00..5.81 rows=1 width=211) (actual time=0.032..0.032 rows=0 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 65
119. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_12.cd_empresa, pesemp_12.cd_pessoa, pesemp_12.cd_regime_fiscal, pesemp_12.dt_baixa, pesemp_12.dt_arq_atos_const, pesemp_12.dt_arq_conv_simp_empr, pesemp_12.coef_acresc_venda_ncoop, pesemp_12.id_cooperativa, pesemp_12.id_origem_tribut, pesemp_12.id_controla_fci, pesemp_12.nr_max_itens_nfe, pesemp_12.id_valida_cest_fat, pesemp_12.id_consiste_ncm_xml, pesemp_12.nr_dias_rev_cad_cli_ven
120. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

121. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

122. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

123. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_13 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
124. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_4 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_13.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
125. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_12 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
126. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

127. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_14 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
128. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_13 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
129. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
130. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_14 (cost=0.00..1.01 rows=1 width=112) (never executed)

131. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.00..5.65 rows=1 width=211) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: false
132. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_6 (cost=0.00..5.65 rows=1 width=211) (never executed)

133.          

SubPlan (forHash Join)

134. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa_plano pesemppla (cost=0.00..1.08 rows=1 width=8) (never executed)

  • Filter: ((cd_empresa = findocparmov.cd_empresa) AND (to_char((findocparmov.dt_credito)::timestamp with time zone, 'yyyy'::text) >= (ano_inicio_plano)::text) AND (to_char((findocparmov.dt_credito)::timestamp with time zone, 'yyyy'::text) <= (ano_fim_plano)::text))
135. 0.000 0.021 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=210.22..280.97 rows=3 width=385) (actual time=0.021..0.021 rows=0 loops=1)

136. 0.001 0.021 ↓ 0.0 0 1

Nested Loop (cost=210.22..280.94 rows=3 width=385) (actual time=0.021..0.021 rows=0 loops=1)

137. 0.000 0.020 ↓ 0.0 0 1

Nested Loop Anti Join (cost=122.49..189.57 rows=1 width=355) (actual time=0.020..0.020 rows=0 loops=1)

  • Join Filter: ((procan_1.cd_empresa = findocparmov_1.cd_empresa) AND (procan_1.cd_base = findocparmov_1.cd_base) AND (procan_1.seq_processo = findocparmov_1.seq_processo))
138. 0.000 0.020 ↓ 0.0 0 1

Nested Loop (cost=122.07..183.36 rows=1 width=355) (actual time=0.020..0.020 rows=0 loops=1)

139. 0.001 0.020 ↓ 0.0 0 1

Nested Loop (cost=97.99..159.19 rows=1 width=347) (actual time=0.020..0.020 rows=0 loops=1)

  • Join Filter: (findocparmov_1.cd_filial_mov = pesfil_7.cd_filial)
140. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=10.58..71.55 rows=1 width=309) (actual time=0.019..0.019 rows=0 loops=1)

  • Join Filter: (aux.cd_operacao = opefinaux.cd_operacao)
141. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=10.58..63.75 rows=1 width=317) (actual time=0.019..0.019 rows=0 loops=1)

  • Join Filter: ((findocparmovvin.cd_base = aux.cd_base) AND (findocparmovvin.seq_processo = aux.seq_processo) AND (findocparmovvin.seq_mov = aux.seq_mov))
142. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=10.02..57.41 rows=1 width=341) (actual time=0.019..0.019 rows=0 loops=1)

  • Join Filter: ((findocparmov_1.cd_base = findocparmovvin.cd_base_vin) AND (findocparmov_1.seq_processo = findocparmovvin.seq_processo_vin) AND (findocparmov_1.seq_mov = findocparmovvin.seq_mov_vin))
143. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=9.88..49.23 rows=1 width=309) (actual time=0.019..0.019 rows=0 loops=1)

  • Join Filter: ((findocpar_1.cd_base = pro_1.cd_base) AND (findocpar_1.seq_processo = pro_1.seq_processo))
144. 0.000 0.019 ↓ 0.0 0 1

Nested Loop (cost=9.32..42.89 rows=1 width=341) (actual time=0.019..0.019 rows=0 loops=1)

  • Join Filter: (findocparmov_1.cd_tipo_cobranca = tcb_1.cd_tipo_cobranca)
145. 0.001 0.019 ↓ 0.0 0 1

Nested Loop (cost=9.32..41.46 rows=1 width=341) (actual time=0.019..0.019 rows=0 loops=1)

146. 0.000 0.018 ↓ 0.0 0 1

Nested Loop (cost=9.03..41.15 rows=1 width=349) (actual time=0.018..0.018 rows=0 loops=1)

  • Join Filter: (pesend_1.seq_endereco = pesendtip_1.seq_endereco)
147. 0.000 0.018 ↓ 0.0 0 1

Nested Loop (cost=8.74..40.79 rows=1 width=373) (actual time=0.018..0.018 rows=0 loops=1)

148. 0.000 0.018 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.33..40.27 rows=1 width=349) (actual time=0.018..0.018 rows=0 loops=1)

149. 0.000 0.018 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.05..39.85 rows=1 width=323) (actual time=0.018..0.018 rows=0 loops=1)

150. 0.000 0.018 ↓ 0.0 0 1

Nested Loop (cost=7.77..39.50 rows=1 width=315) (actual time=0.018..0.018 rows=0 loops=1)

151. 0.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=7.48..31.18 rows=1 width=261) (actual time=0.018..0.018 rows=0 loops=1)

152. 0.001 0.017 ↓ 0.0 0 1

Nested Loop (cost=7.33..23.00 rows=1 width=250) (actual time=0.017..0.017 rows=0 loops=1)

  • Join Filter: ((findocparmov_1.cd_base_orig = findocpar_1.cd_base) AND (findocparmov_1.seq_processo_orig = findocpar_1.seq_processo) AND ((findocparmov_1.parcela_orig)::text = (findocpar_1.parcela)::text))
153. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=6.78..16.66 rows=1 width=215) (actual time=0.016..0.016 rows=0 loops=1)

  • Join Filter: ((findoc_1.cd_base = findocparmov_1.cd_base_orig) AND (findoc_1.seq_processo = findocparmov_1.seq_processo_orig))
154. 0.016 0.016 ↓ 0.0 0 1

Index Scan using fin_doc_parcela_mov_pk on fin_doc_parcela_mov findocparmov_1 (cost=0.56..6.33 rows=1 width=136) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (cd_empresa = 30)
  • Filter: ((dt_movimento >= to_date('2018-10-01'::text, 'yyyy-MM-dd'::text)) AND (dt_movimento <= to_date('2019-01-04'::text, 'yyyy-MM-dd'::text)))
155. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=6.22..10.31 rows=1 width=79) (never executed)

  • Hash Cond: (tipdoccre_1.cd_tipo_doc_credito = findoc_1.cd_tipo_doc_credito)
156. 0.000 0.000 ↓ 0.0 0

Seq Scan on tipo_doc_credito tipdoccre_1 (cost=0.00..3.79 rows=79 width=19) (never executed)

157. 0.000 0.000 ↓ 0.0 0

Hash (cost=6.21..6.21 rows=1 width=68) (never executed)

158. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_documento_pk on fin_documento findoc_1 (cost=0.43..6.21 rows=1 width=68) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Filter: ((cd_filial = 30) AND (id_cr_cp = 'R'::bpchar) AND (id_provisao = 'N'::bpchar))
159. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_doc_parcela_pk on fin_doc_parcela findocpar_1 (cost=0.55..6.32 rows=1 width=45) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Filter: (id_situacao_eletronica = ANY ('{0,9}'::bpchar[]))
160. 0.000 0.000 ↓ 0.0 0

Index Scan using operacao_financ_pk on operacao_financ opefin_1 (cost=0.15..8.17 rows=1 width=11) (never executed)

  • Index Cond: (cd_operacao = findocparmov_1.cd_operacao)
  • Filter: ((id_tipo_operacao)::text <> 'EP'::text)
161. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_pk on pessoa pes_1 (cost=0.29..8.31 rows=1 width=54) (never executed)

  • Index Cond: (cd_pessoa = findoc_1.cd_pessoa)
162. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_associado_idx1 on pessoa_associado pesass_1 (cost=0.29..0.33 rows=1 width=16) (never executed)

  • Index Cond: (cd_pessoa = pes_1.cd_pessoa)
  • Filter: (dt_demissao IS NULL)
163. 0.000 0.000 ↓ 0.0 0

Index Scan using operacao_pk on operacao ope_15 (cost=0.28..0.42 rows=1 width=42) (never executed)

  • Index Cond: (cd_operacao = opefin_1.cd_operacao)
164. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_endereco_pk on pessoa_endereco pesend_1 (cost=0.41..0.51 rows=1 width=24) (never executed)

  • Index Cond: (cd_pessoa = pes_1.cd_pessoa)
165. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_endereco_tipo_uk1 on pessoa_endereco_tipo pesendtip_1 (cost=0.29..0.34 rows=1 width=16) (never executed)

  • Index Cond: ((cd_pessoa = pes_1.cd_pessoa) AND ((id_tipo_endereco)::text = 'PRI'::text))
166. 0.000 0.000 ↓ 0.0 0

Index Only Scan using localidade_pk on localidade loc_1 (cost=0.29..0.30 rows=1 width=8) (never executed)

  • Index Cond: (cd_localidade = pesend_1.cd_localidade)
  • Heap Fetches: 0
167. 0.000 0.000 ↓ 0.0 0

Seq Scan on tipo_cobranca tcb_1 (cost=0.00..1.19 rows=19 width=16) (never executed)

168. 0.000 0.000 ↓ 0.0 0

Index Only Scan using processo_pk on processo pro_1 (cost=0.56..6.33 rows=1 width=24) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Heap Fetches: 0
169. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_doc_parcela_mov_vin_idx1 on fin_doc_parcela_mov_vin findocparmovvin (cost=0.14..8.16 rows=1 width=56) (never executed)

  • Index Cond: (cd_empresa = 30)
170. 0.000 0.000 ↓ 0.0 0

Index Scan using fin_doc_parcela_mov_pk on fin_doc_parcela_mov aux (cost=0.56..6.33 rows=1 width=40) (never executed)

  • Index Cond: (cd_empresa = 30)
171. 0.000 0.000 ↓ 0.0 0

Seq Scan on operacao_financ opefinaux (cost=0.00..7.79 rows=1 width=8) (never executed)

  • Filter: ((id_tipo_operacao)::text = 'EP'::text)
172. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=87.41..87.48 rows=7 width=211) (never executed)

  • Group Key: pesfil_7.cd_empresa, pesfil_7.cd_filial, pesfil_7.id_atividade, pesfil_7.cd_pessoa, pesfil_7.cd_segmento_fiscal, pesfil_7.cd_lista_preco_basica, pesfil_7.cd_pessoa_clas_fiscal, pesfil_7.id_perfil_sped_fiscal, pesfil_7.id_periodo_inventario, pesfil_7.mes_inventario_anual, pesfil_7.versao_leiaute_nfe, pesfil_7.id_formato_danfe, pesfil_7.id_ambiente_nfe, pesfil_7.cd_operacao_venda, pesfil_7.id_volume_trans, pesfil_7.id_utiliza_lacre_transp, pesfil_7.cd_tipo_cobranca, pesfil_7.cd_banco_portador, pesfil_7.nr_agencia_portador, pesfil_7.nr_conta_portador, pesfil_7.id_clas_cons_en_eletr, pesfil_7.id_tipo_ligacao_default, pesfil_7.id_grupo_tensao_default, pesfil_7.id_clas_cons_gas, pesfil_7.id_tipo_assinante_comunic, pesfil_7.id_clas_cons_agua, pesfil_7.cd_lista_preco_tipo_basico, pesfil_7.cd_lista_preco_prom, pesfil_7.cd_lista_preco_tipo_prom, pesfil_7.cd_grupo_unidade_medida, pesfil_7.id_ecf, pesfil_7.id_tipo_atualizacao_est, pesfil_7.id_atualizando_est, pesfil_7.dt_ult_fec_estoque, pesfil_7.mes_invent_sped_anual, pesfil_7.id_emite_nf_conjugada, pesfil_7.id_origem_tipo_preco, pesfil_7.cd_operacao_serv, pesfil_7.id_obriga_cd_barras_nfe, pesfil_7.id_ativo, pesfil_7.abrev_filial, pesfil_7.id_geracao_nfe, pesfil_7.id_matriz, pesfil_7.cd_perfil_filial, pesfil_7.id_venda_saldo_terc
173. 0.000 0.000 ↓ 0.0 0

Append (cost=24.64..86.62 rows=7 width=211) (never executed)

174. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.64..42.61 rows=3 width=211) (never executed)

175. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..18.43 rows=1 width=211) (never executed)

  • Join Filter: (opepesfil_2.cd_filial = pesfil_7.cd_filial)
176. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..12.61 rows=1 width=16) (never executed)

177. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_16 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'N'::bpchar)
178. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_filial_pk on operador_pessoa_filial opepesfil_2 (cost=0.28..4.30 rows=1 width=23) (never executed)

  • Index Cond: ((cd_operador = (ope_16.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
179. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_7 (cost=0.00..5.81 rows=1 width=211) (never executed)

  • Filter: (cd_empresa = 30)
180. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_15.cd_empresa, pesemp_15.cd_pessoa, pesemp_15.cd_regime_fiscal, pesemp_15.dt_baixa, pesemp_15.dt_arq_atos_const, pesemp_15.dt_arq_conv_simp_empr, pesemp_15.coef_acresc_venda_ncoop, pesemp_15.id_cooperativa, pesemp_15.id_origem_tribut, pesemp_15.id_controla_fci, pesemp_15.nr_max_itens_nfe, pesemp_15.id_valida_cest_fat, pesemp_15.id_consiste_ncm_xml, pesemp_15.nr_dias_rev_cad_cli_ven
181. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

182. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

184. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_17 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
185. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_5 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_17.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
186. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_15 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
187. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

188. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_18 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
189. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_16 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
190. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
191. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_17 (cost=0.00..1.01 rows=1 width=112) (never executed)

192. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.36..38.29 rows=3 width=211) (never executed)

193. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..14.12 rows=1 width=211) (never executed)

194. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_19 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
195. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_8 (cost=0.00..5.81 rows=1 width=211) (never executed)

  • Filter: (cd_empresa = 30)
196. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_18.cd_empresa, pesemp_18.cd_pessoa, pesemp_18.cd_regime_fiscal, pesemp_18.dt_baixa, pesemp_18.dt_arq_atos_const, pesemp_18.dt_arq_conv_simp_empr, pesemp_18.coef_acresc_venda_ncoop, pesemp_18.id_cooperativa, pesemp_18.id_origem_tribut, pesemp_18.id_controla_fci, pesemp_18.nr_max_itens_nfe, pesemp_18.id_valida_cest_fat, pesemp_18.id_consiste_ncm_xml, pesemp_18.nr_dias_rev_cad_cli_ven
197. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

198. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

199. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

200. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_20 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
201. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_6 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_20.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
202. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_18 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
203. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

204. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_21 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
205. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_19 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
206. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
207. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_20 (cost=0.00..1.01 rows=1 width=112) (never executed)

208. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..5.65 rows=1 width=211) (never executed)

  • One-Time Filter: false
209. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_9 (cost=0.00..5.65 rows=1 width=211) (never executed)

210. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_21.cd_empresa, pesemp_21.cd_pessoa, pesemp_21.cd_regime_fiscal, pesemp_21.dt_baixa, pesemp_21.dt_arq_atos_const, pesemp_21.dt_arq_conv_simp_empr, pesemp_21.coef_acresc_venda_ncoop, pesemp_21.id_cooperativa, pesemp_21.id_origem_tribut, pesemp_21.id_controla_fci, pesemp_21.nr_max_itens_nfe, pesemp_21.id_valida_cest_fat, pesemp_21.id_consiste_ncm_xml, pesemp_21.nr_dias_rev_cad_cli_ven
211. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

212. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

213. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

214. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_22 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
215. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_7 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_22.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
216. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_21 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
217. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

218. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_23 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
219. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_22 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
220. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
221. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_23 (cost=0.00..1.01 rows=1 width=112) (never executed)

222. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.42..6.19 rows=1 width=24) (never executed)

223. 0.000 0.000 ↓ 0.0 0

Index Only Scan using processo_canc_pk on processo_canc procan_1 (cost=0.42..6.19 rows=1 width=24) (never executed)

  • Index Cond: (cd_empresa = 30)
  • Heap Fetches: 0
224. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=87.73..87.80 rows=7 width=211) (never executed)

  • Group Key: pesfil_10.cd_empresa, pesfil_10.cd_filial, pesfil_10.id_atividade, pesfil_10.cd_pessoa, pesfil_10.cd_segmento_fiscal, pesfil_10.cd_lista_preco_basica, pesfil_10.cd_pessoa_clas_fiscal, pesfil_10.id_perfil_sped_fiscal, pesfil_10.id_periodo_inventario, pesfil_10.mes_inventario_anual, pesfil_10.versao_leiaute_nfe, pesfil_10.id_formato_danfe, pesfil_10.id_ambiente_nfe, pesfil_10.cd_operacao_venda, pesfil_10.id_volume_trans, pesfil_10.id_utiliza_lacre_transp, pesfil_10.cd_tipo_cobranca, pesfil_10.cd_banco_portador, pesfil_10.nr_agencia_portador, pesfil_10.nr_conta_portador, pesfil_10.id_clas_cons_en_eletr, pesfil_10.id_tipo_ligacao_default, pesfil_10.id_grupo_tensao_default, pesfil_10.id_clas_cons_gas, pesfil_10.id_tipo_assinante_comunic, pesfil_10.id_clas_cons_agua, pesfil_10.cd_lista_preco_tipo_basico, pesfil_10.cd_lista_preco_prom, pesfil_10.cd_lista_preco_tipo_prom, pesfil_10.cd_grupo_unidade_medida, pesfil_10.id_ecf, pesfil_10.id_tipo_atualizacao_est, pesfil_10.id_atualizando_est, pesfil_10.dt_ult_fec_estoque, pesfil_10.mes_invent_sped_anual, pesfil_10.id_emite_nf_conjugada, pesfil_10.id_origem_tipo_preco, pesfil_10.cd_operacao_serv, pesfil_10.id_obriga_cd_barras_nfe, pesfil_10.id_ativo, pesfil_10.abrev_filial, pesfil_10.id_geracao_nfe, pesfil_10.id_matriz, pesfil_10.cd_perfil_filial, pesfil_10.id_venda_saldo_terc
225. 0.000 0.000 ↓ 0.0 0

Append (cost=24.64..86.94 rows=7 width=211) (never executed)

226. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.64..42.77 rows=3 width=211) (never executed)

227. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..18.60 rows=1 width=211) (never executed)

228. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..12.61 rows=1 width=16) (never executed)

229. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_24 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'N'::bpchar)
230. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_filial_pk on operador_pessoa_filial opepesfil_3 (cost=0.28..4.30 rows=1 width=23) (never executed)

  • Index Cond: ((cd_operador = (ope_24.cd_operador)::text) AND (cd_empresa = 30) AND (cd_filial = 30))
  • Heap Fetches: 0
231. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_10 (cost=0.00..5.97 rows=1 width=211) (never executed)

  • Filter: ((cd_empresa = 30) AND (cd_filial = 30))
232. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_24.cd_empresa, pesemp_24.cd_pessoa, pesemp_24.cd_regime_fiscal, pesemp_24.dt_baixa, pesemp_24.dt_arq_atos_const, pesemp_24.dt_arq_conv_simp_empr, pesemp_24.coef_acresc_venda_ncoop, pesemp_24.id_cooperativa, pesemp_24.id_origem_tribut, pesemp_24.id_controla_fci, pesemp_24.nr_max_itens_nfe, pesemp_24.id_valida_cest_fat, pesemp_24.id_consiste_ncm_xml, pesemp_24.nr_dias_rev_cad_cli_ven
233. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

234. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

235. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

236. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_25 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
237. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_8 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_25.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
238. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_24 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
239. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

240. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_26 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
241. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_25 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
242. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
243. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_26 (cost=0.00..1.01 rows=1 width=112) (never executed)

244. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=24.36..38.45 rows=3 width=211) (never executed)

245. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..14.28 rows=1 width=211) (never executed)

246. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_27 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
247. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_11 (cost=0.00..5.97 rows=1 width=211) (never executed)

  • Filter: ((cd_empresa = 30) AND (cd_filial = 30))
248. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=24.08..24.11 rows=3 width=112) (never executed)

  • Group Key: pesemp_27.cd_empresa, pesemp_27.cd_pessoa, pesemp_27.cd_regime_fiscal, pesemp_27.dt_baixa, pesemp_27.dt_arq_atos_const, pesemp_27.dt_arq_conv_simp_empr, pesemp_27.coef_acresc_venda_ncoop, pesemp_27.id_cooperativa, pesemp_27.id_origem_tribut, pesemp_27.id_controla_fci, pesemp_27.nr_max_itens_nfe, pesemp_27.id_valida_cest_fat, pesemp_27.id_consiste_ncm_xml, pesemp_27.nr_dias_rev_cad_cli_ven
249. 0.000 0.000 ↓ 0.0 0

Append (cost=0.55..23.98 rows=3 width=112) (never executed)

250. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..13.62 rows=1 width=112) (never executed)

251. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..12.60 rows=1 width=8) (never executed)

252. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_28 (cost=0.28..8.29 rows=1 width=9) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'N'::bpchar)
253. 0.000 0.000 ↓ 0.0 0

Index Only Scan using operador_pessoa_empresa_pk on operador_pessoa_empresa opepesemp_9 (cost=0.28..4.29 rows=1 width=17) (never executed)

  • Index Cond: ((cd_operador = (ope_28.cd_operador)::text) AND (cd_empresa = 30))
  • Heap Fetches: 0
254. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_27 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
255. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..9.32 rows=1 width=112) (never executed)

256. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_29 (cost=0.28..8.29 rows=1 width=0) (never executed)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
257. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_28 (cost=0.00..1.01 rows=1 width=112) (never executed)

  • Filter: (cd_empresa = 30)
258. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..1.01 rows=1 width=112) (never executed)

  • One-Time Filter: false
259. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa pesemp_29 (cost=0.00..1.01 rows=1 width=112) (never executed)

260. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..5.65 rows=1 width=211) (never executed)

  • One-Time Filter: false
261. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_filial pesfil_12 (cost=0.00..5.65 rows=1 width=211) (never executed)

262.          

SubPlan (forNested Loop)

263. 0.000 0.000 ↓ 0.0 0

Seq Scan on pessoa_empresa_plano pesemppla_1 (cost=0.00..1.08 rows=1 width=8) (never executed)

  • Filter: ((cd_empresa = findocparmov_1.cd_empresa) AND (to_char((findocparmov_1.dt_credito)::timestamp with time zone, 'yyyy'::text) >= (ano_inicio_plano)::text) AND (to_char((findocparmov_1.dt_credito)::timestamp with time zone, 'yyyy'::text) <= (ano_fim_plano)::text))