explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b5Py

Settings
# exclusive inclusive rows x rows loops node
1. 53.506 1,106.766 ↓ 7.4 5,800 1

Hash Left Join (cost=10,006.81..82,702.31 rows=788 width=551) (actual time=556.065..1,106.766 rows=5,800 loops=1)

  • Hash Cond: (pes.cd_pessoa = pesass.cd_pessoa)
2. 6.531 995.258 ↓ 7.4 5,800 1

Nested Loop Anti Join (cost=9,988.26..79,821.34 rows=788 width=406) (actual time=555.974..995.258 rows=5,800 loops=1)

3. 8.007 958.282 ↓ 7.5 6,089 1

Nested Loop (cost=9,987.84..79,402.69 rows=814 width=406) (actual time=555.956..958.282 rows=6,089 loops=1)

4. 8.850 950.275 ↓ 156.1 6,089 1

Nested Loop (cost=9,873.26..79,277.35 rows=39 width=368) (actual time=555.787..950.275 rows=6,089 loops=1)

5. 6.810 898.802 ↓ 253.7 6,089 1

Nested Loop (cost=9,872.70..79,247.37 rows=24 width=400) (actual time=555.768..898.802 rows=6,089 loops=1)

  • Join Filter: (pesend.seq_endereco = pesendtip.seq_endereco)
  • Rows Removed by Join Filter: 20
6. 5.432 855.338 ↓ 277.7 6,109 1

Hash Join (cost=9,872.28..79,235.84 rows=22 width=424) (actual time=555.750..855.338 rows=6,109 loops=1)

  • Hash Cond: (findocparmov.cd_tipo_cobranca = tcb.cd_tipo_cobranca)
7. 9.921 849.872 ↓ 277.7 6,109 1

Nested Loop (cost=9,871.03..79,234.29 rows=22 width=424) (actual time=555.701..849.872 rows=6,109 loops=1)

8. 5.562 821.624 ↓ 277.7 6,109 1

Hash Join (cost=9,870.75..79,227.36 rows=22 width=432) (actual time=555.690..821.624 rows=6,109 loops=1)

  • Hash Cond: (findocparmov.cd_filial_mov = pesfilmov.cd_filial)
9. 4.040 815.712 ↓ 218.2 6,109 1

Nested Loop (cost=9,781.74..79,138.03 rows=28 width=394) (actual time=555.325..815.712 rows=6,109 loops=1)

10. 6.771 781.227 ↓ 217.5 6,089 1

Nested Loop (cost=9,781.32..79,123.26 rows=28 width=370) (actual time=555.311..781.227 rows=6,089 loops=1)

11. 5.064 744.011 ↓ 217.5 6,089 1

Hash Join (cost=9,780.90..79,016.76 rows=28 width=318) (actual time=555.297..744.011 rows=6,089 loops=1)

  • Hash Cond: (findoc.cd_tipo_doc_credito = tipdoccre.cd_tipo_doc_credito)
12. 5.665 738.805 ↓ 217.5 6,089 1

Hash Join (cost=9,776.61..79,012.08 rows=28 width=305) (actual time=555.142..738.805 rows=6,089 loops=1)

  • Hash Cond: (findocparmov.cd_operacao = opefin.cd_operacao)
13. 36.349 731.910 ↓ 152.2 6,089 1

Nested Loop (cost=9,752.37..78,987.40 rows=40 width=262) (actual time=553.896..731.910 rows=6,089 loops=1)

14. 25.810 269.256 ↓ 7.8 38,755 1

Nested Loop (cost=9,751.81..70,581.33 rows=4,976 width=134) (actual time=75.333..269.256 rows=38,755 loops=1)

15. 23.138 96.926 ↓ 3.2 13,320 1

Bitmap Heap Scan on fin_documento findoc (cost=9,751.25..21,878.03 rows=4,139 width=67) (actual time=75.284..96.926 rows=13,320 loops=1)

  • Recheck Cond: ((cd_filial = 30) AND (id_cr_cp = 'R'::bpchar) AND (cd_empresa = 30))
  • Filter: (id_provisao = 'N'::bpchar)
  • Heap Blocks: exact=4287
16. 1.526 73.788 ↓ 0.0 0 1

BitmapAnd (cost=9,751.25..9,751.25 rows=4,139 width=0) (actual time=73.788..73.788 rows=0 loops=1)

17. 6.554 6.554 ↑ 1.7 13,386 1

Bitmap Index Scan on fin_documento_idx1 (cost=0.00..916.98 rows=22,781 width=0) (actual time=6.554..6.554 rows=13,386 loops=1)

  • Index Cond: ((cd_filial = 30) AND (id_cr_cp = 'R'::bpchar))
18. 65.708 65.708 ↑ 1.0 300,390 1

Bitmap Index Scan on fin_documento_pk (cost=0.00..8,831.96 rows=311,404 width=0) (actual time=65.708..65.708 rows=300,390 loops=1)

  • Index Cond: (cd_empresa = 30)
19. 146.520 146.520 ↓ 1.5 3 13,320

Index Scan using fin_doc_parcela_pk on fin_doc_parcela findocpar (cost=0.56..11.75 rows=2 width=67) (actual time=0.008..0.011 rows=3 loops=13,320)

  • Index Cond: ((cd_empresa = 30) AND (cd_base = findoc.cd_base) AND (seq_processo = findoc.seq_processo))
  • Filter: (id_situacao_eletronica = ANY ('{0,9}'::bpchar[]))
20. 426.305 426.305 ↓ 0.0 0 38,755

Index Scan using fin_doc_parcela_mov_idx3 on fin_doc_parcela_mov findocparmov (cost=0.56..1.68 rows=1 width=139) (actual time=0.011..0.011 rows=0 loops=38,755)

  • Index Cond: ((cd_empresa = 30) AND (cd_base_orig = findocpar.cd_base) AND (seq_processo_orig = findocpar.seq_processo) AND ((parcela_orig)::text = (findocpar.parcela)::text))
  • 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)))
  • Rows Removed by Filter: 2
21. 0.182 1.230 ↓ 1.6 216 1

Hash (cost=22.50..22.50 rows=139 width=59) (actual time=1.230..1.230 rows=216 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
22. 0.350 1.048 ↓ 1.6 216 1

Hash Join (cost=10.27..22.50 rows=139 width=59) (actual time=0.529..1.048 rows=216 loops=1)

  • Hash Cond: (ope.cd_operacao = opefin.cd_operacao)
23. 0.195 0.195 ↓ 1.0 436 1

Seq Scan on operacao ope (cost=0.00..9.25 rows=425 width=48) (actual time=0.013..0.195 rows=436 loops=1)

24. 0.155 0.503 ↓ 1.6 216 1

Hash (cost=8.53..8.53 rows=139 width=11) (actual time=0.503..0.503 rows=216 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
25. 0.348 0.348 ↓ 1.6 216 1

Seq Scan on operacao_financ opefin (cost=0.00..8.53 rows=139 width=11) (actual time=0.023..0.348 rows=216 loops=1)

  • 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[])))
  • Rows Removed by Filter: 3
26. 0.070 0.142 ↓ 1.0 106 1

Hash (cost=3.02..3.02 rows=102 width=21) (actual time=0.142..0.142 rows=106 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
27. 0.072 0.072 ↓ 1.0 106 1

Seq Scan on tipo_doc_credito tipdoccre (cost=0.00..3.02 rows=102 width=21) (actual time=0.012..0.072 rows=106 loops=1)

28. 30.445 30.445 ↑ 1.0 1 6,089

Index Scan using pessoa_pk on pessoa pes (cost=0.42..3.79 rows=1 width=52) (actual time=0.004..0.005 rows=1 loops=6,089)

  • Index Cond: (cd_pessoa = findoc.cd_pessoa)
29. 30.445 30.445 ↑ 1.0 1 6,089

Index Scan using pessoa_endereco_pk on pessoa_endereco pesend (cost=0.42..0.52 rows=1 width=24) (actual time=0.004..0.005 rows=1 loops=6,089)

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
30. 0.010 0.350 ↑ 3.1 11 1

Hash (cost=88.58..88.58 rows=34 width=54) (actual time=0.350..0.350 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.006 0.340 ↑ 3.1 11 1

Subquery Scan on pesfilmov (cost=87.90..88.58 rows=34 width=54) (actual time=0.316..0.340 rows=11 loops=1)

32. 0.115 0.334 ↑ 3.1 11 1

HashAggregate (cost=87.90..88.24 rows=34 width=490) (actual time=0.314..0.334 rows=11 loops=1)

  • Group Key: pesfil.cd_empresa, pesfil.cd_filial, pesfil.id_atividade, pesfil.cd_pessoa, pesfil.cd_segmento_fiscal, pesfil.cd_lista_preco_basica, pesfil.cd_pessoa_clas_fiscal, pesfil.id_perfil_sped_fiscal, pesfil.id_periodo_inventario, pesfil.mes_inventario_anual, pesfil.versao_leiaute_nfe, pesfil.id_formato_danfe, pesfil.id_ambiente_nfe, pesfil.cd_operacao_venda, pesfil.id_volume_trans, pesfil.id_utiliza_lacre_transp, pesfil.cd_tipo_cobranca, pesfil.cd_banco_portador, pesfil.nr_agencia_portador, pesfil.nr_conta_portador, pesfil.id_clas_cons_en_eletr, pesfil.id_tipo_ligacao_default, pesfil.id_grupo_tensao_default, pesfil.id_clas_cons_gas, pesfil.id_tipo_assinante_comunic, pesfil.id_clas_cons_agua, pesfil.cd_lista_preco_tipo_basico, pesfil.cd_lista_preco_prom, pesfil.cd_lista_preco_tipo_prom, pesfil.cd_grupo_unidade_medida, pesfil.id_ecf, pesfil.id_tipo_atualizacao_est, pesfil.id_atualizando_est, pesfil.dt_ult_fec_estoque, pesfil.mes_invent_sped_anual, pesfil.id_emite_nf_conjugada, pesfil.id_origem_tipo_preco, pesfil.cd_operacao_serv, pesfil.id_obriga_cd_barras_nfe, pesfil.id_ativo, pesfil.abrev_filial, pesfil.id_geracao_nfe, pesfil.id_matriz, pesfil.cd_perfil_filial, pesfil.id_venda_saldo_terc
33. 0.006 0.219 ↑ 3.1 11 1

Append (cost=28.43..84.08 rows=34 width=490) (actual time=0.152..0.219 rows=11 loops=1)

34. 0.000 0.038 ↓ 0.0 0 1

Nested Loop (cost=28.43..44.65 rows=3 width=212) (actual time=0.038..0.038 rows=0 loops=1)

35. 0.002 0.038 ↓ 0.0 0 1

Nested Loop (cost=0.69..16.82 rows=1 width=212) (actual time=0.038..0.038 rows=0 loops=1)

36. 0.000 0.036 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=16) (actual time=0.036..0.036 rows=0 loops=1)

37. 0.036 0.036 ↓ 0.0 0 1

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

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

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

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

Index Scan using pessoa_filial_pk on pessoa_filial pesfil (cost=0.14..0.21 rows=1 width=212) (never executed)

  • Index Cond: ((cd_empresa = 30) AND (cd_filial = opepesfil.cd_filial))
40. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=27.74..27.77 rows=3 width=112) (never executed)

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

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

42. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..17.96 rows=1 width=56) (never executed)

43. 0.000 0.000 ↓ 0.0 0

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

44. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_2 (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)
45. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Nested Loop (cost=0.28..9.65 rows=1 width=56) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_3 (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)
49. 0.000 0.000 ↓ 0.0 0

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

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

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

  • One-Time Filter: false
51. 0.027 0.174 ↑ 2.7 11 1

Nested Loop (cost=28.02..39.10 rows=30 width=212) (actual time=0.114..0.174 rows=11 loops=1)

52. 0.037 0.037 ↓ 1.1 11 1

Seq Scan on pessoa_filial pesfil_1 (cost=0.00..2.59 rows=10 width=212) (actual time=0.013..0.037 rows=11 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 36
53. 0.015 0.110 ↑ 3.0 1 11

Materialize (cost=28.02..36.14 rows=3 width=8) (actual time=0.009..0.010 rows=1 loops=11)

54. 0.003 0.095 ↑ 3.0 1 1

Nested Loop (cost=28.02..36.13 rows=3 width=8) (actual time=0.092..0.095 rows=1 loops=1)

55. 0.017 0.017 ↑ 1.0 1 1

Index Scan using operador_uk1 on operador ope_4 (cost=0.28..8.29 rows=1 width=0) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
56. 0.014 0.075 ↑ 3.0 1 1

HashAggregate (cost=27.74..27.77 rows=3 width=112) (actual time=0.074..0.075 rows=1 loops=1)

  • 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
57. 0.001 0.061 ↑ 3.0 1 1

Append (cost=0.55..27.64 rows=3 width=112) (actual time=0.052..0.061 rows=1 loops=1)

58. 0.000 0.017 ↓ 0.0 0 1

Nested Loop (cost=0.55..17.96 rows=1 width=56) (actual time=0.017..0.017 rows=0 loops=1)

59. 0.002 0.017 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.017..0.017 rows=0 loops=1)

60. 0.015 0.015 ↓ 0.0 0 1

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

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

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

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

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

  • Filter: (cd_empresa = 30)
63. 0.006 0.043 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.65 rows=1 width=56) (actual time=0.035..0.043 rows=1 loops=1)

64. 0.014 0.014 ↑ 1.0 1 1

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

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
65. 0.023 0.023 ↑ 1.0 1 1

Seq Scan on pessoa_empresa pesemp_4 (cost=0.00..1.35 rows=1 width=56) (actual time=0.018..0.023 rows=1 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 27
66. 0.000 0.000 ↓ 0.0 0 1

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

  • One-Time Filter: false
67. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=490) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
68. 18.327 18.327 ↑ 1.0 1 6,109

Index Only Scan using localidade_pk on localidade loc (cost=0.29..0.31 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=6,109)

  • Index Cond: (cd_localidade = pesend.cd_localidade)
  • Heap Fetches: 6109
69. 0.015 0.034 ↓ 1.1 12 1

Hash (cost=1.11..1.11 rows=11 width=16) (actual time=0.034..0.034 rows=12 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.019 0.019 ↓ 1.1 12 1

Seq Scan on tipo_cobranca tcb (cost=0.00..1.11 rows=11 width=16) (actual time=0.016..0.019 rows=12 loops=1)

71. 36.654 36.654 ↑ 1.0 1 6,109

Index Scan using pessoa_endereco_tipo_uk1 on pessoa_endereco_tipo pesendtip (cost=0.42..0.51 rows=1 width=16) (actual time=0.005..0.006 rows=1 loops=6,109)

  • Index Cond: ((cd_pessoa = pes.cd_pessoa) AND ((id_tipo_endereco)::text = 'PRI'::text))
72. 42.623 42.623 ↑ 2.0 1 6,089

Index Only Scan using processo_pk on processo pro (cost=0.56..1.23 rows=2 width=24) (actual time=0.007..0.007 rows=1 loops=6,089)

  • Index Cond: ((cd_empresa = 30) AND (cd_base = findocpar.cd_base) AND (seq_processo = findocpar.seq_processo))
  • Heap Fetches: 6089
73. 0.000 0.000 ↑ 21.0 1 6,089

Materialize (cost=114.58..115.15 rows=21 width=70) (actual time=0.000..0.000 rows=1 loops=6,089)

74. 0.004 0.167 ↑ 21.0 1 1

Nested Loop (cost=114.58..115.05 rows=21 width=70) (actual time=0.165..0.167 rows=1 loops=1)

75. 0.014 0.117 ↑ 7.0 1 1

HashAggregate (cost=86.84..86.91 rows=7 width=490) (actual time=0.117..0.117 rows=1 loops=1)

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

Append (cost=28.29..86.05 rows=7 width=490) (actual time=0.095..0.103 rows=1 loops=1)

77. 0.001 0.016 ↓ 0.0 0 1

Nested Loop (cost=28.29..47.15 rows=3 width=212) (actual time=0.016..0.016 rows=0 loops=1)

78. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=0.55..19.32 rows=1 width=212) (actual time=0.015..0.015 rows=0 loops=1)

79. 0.001 0.015 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=16) (actual time=0.015..0.015 rows=0 loops=1)

80. 0.014 0.014 ↓ 0.0 0 1

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

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

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

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

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

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

HashAggregate (cost=27.74..27.77 rows=3 width=112) (never executed)

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

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

85. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.55..17.96 rows=1 width=56) (never executed)

86. 0.000 0.000 ↓ 0.0 0

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

87. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_8 (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)
88. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Nested Loop (cost=0.28..9.65 rows=1 width=56) (never executed)

91. 0.000 0.000 ↓ 0.0 0

Index Scan using operador_uk1 on operador ope_9 (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)
92. 0.000 0.000 ↓ 0.0 0

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

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

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

  • One-Time Filter: false
94. 0.003 0.085 ↑ 3.0 1 1

Nested Loop (cost=28.02..38.84 rows=3 width=212) (actual time=0.078..0.085 rows=1 loops=1)

95. 0.003 0.033 ↑ 1.0 1 1

Nested Loop (cost=0.28..11.01 rows=1 width=212) (actual time=0.027..0.033 rows=1 loops=1)

96. 0.010 0.010 ↑ 1.0 1 1

Index Scan using operador_uk1 on operador ope_10 (cost=0.28..8.29 rows=1 width=0) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_filial_todos = 'S'::bpchar)
97. 0.020 0.020 ↑ 1.0 1 1

Seq Scan on pessoa_filial pesfil_3 (cost=0.00..2.71 rows=1 width=212) (actual time=0.015..0.020 rows=1 loops=1)

  • Filter: ((cd_empresa = 30) AND (cd_filial = 30))
  • Rows Removed by Filter: 46
98. 0.012 0.049 ↑ 3.0 1 1

HashAggregate (cost=27.74..27.77 rows=3 width=112) (actual time=0.048..0.049 rows=1 loops=1)

  • Group Key: pesemp_7.cd_empresa, pesemp_7.cd_pessoa, pesemp_7.cd_regime_fiscal, pesemp_7.dt_baixa, pesemp_7.dt_arq_atos_const, pesemp_7.dt_arq_conv_simp_empr, pesemp_7.coef_acresc_venda_ncoop, pesemp_7.id_cooperativa, pesemp_7.id_origem_tribut, pesemp_7.id_controla_fci, pesemp_7.nr_max_itens_nfe, pesemp_7.id_valida_cest_fat, pesemp_7.id_consiste_ncm_xml, pesemp_7.nr_dias_rev_cad_cli_ven
99. 0.000 0.037 ↑ 3.0 1 1

Append (cost=0.55..27.64 rows=3 width=112) (actual time=0.032..0.037 rows=1 loops=1)

100. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.55..17.96 rows=1 width=56) (actual time=0.011..0.011 rows=0 loops=1)

101. 0.001 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

102. 0.009 0.009 ↓ 0.0 0 1

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

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

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

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

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

  • Filter: (cd_empresa = 30)
105. 0.002 0.025 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.65 rows=1 width=56) (actual time=0.021..0.025 rows=1 loops=1)

106. 0.010 0.010 ↑ 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.009..0.010 rows=1 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
107. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on pessoa_empresa pesemp_8 (cost=0.00..1.35 rows=1 width=56) (actual time=0.010..0.013 rows=1 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 27
108. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=112) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
109. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=490) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
110. 0.002 0.046 ↑ 3.0 1 1

Materialize (cost=27.74..27.82 rows=3 width=16) (actual time=0.045..0.046 rows=1 loops=1)

111. 0.002 0.044 ↑ 3.0 1 1

Subquery Scan on pesemp (cost=27.74..27.80 rows=3 width=16) (actual time=0.043..0.044 rows=1 loops=1)

112. 0.008 0.042 ↑ 3.0 1 1

HashAggregate (cost=27.74..27.77 rows=3 width=112) (actual time=0.042..0.042 rows=1 loops=1)

  • 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
113. 0.002 0.034 ↑ 3.0 1 1

Append (cost=0.55..27.64 rows=3 width=112) (actual time=0.030..0.034 rows=1 loops=1)

114. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.55..17.96 rows=1 width=56) (actual time=0.011..0.011 rows=0 loops=1)

115. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

116. 0.010 0.010 ↓ 0.0 0 1

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

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

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

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

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

  • Filter: (cd_empresa = 30)
119. 0.002 0.021 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.65 rows=1 width=56) (actual time=0.018..0.021 rows=1 loops=1)

120. 0.010 0.010 ↑ 1.0 1 1

Index Scan using operador_uk1 on operador ope_14 (cost=0.28..8.29 rows=1 width=0) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
121. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on pessoa_empresa pesemp_10 (cost=0.00..1.35 rows=1 width=56) (actual time=0.007..0.009 rows=1 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 27
122. 0.000 0.000 ↓ 0.0 0 1

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

  • One-Time Filter: false
123. 30.445 30.445 ↓ 0.0 0 6,089

Index Only Scan using processo_canc_pk on processo_canc procan (cost=0.41..0.51 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=6,089)

  • Index Cond: ((cd_empresa = findocparmov.cd_empresa) AND (cd_empresa = 30) AND (cd_base = findocparmov.cd_base) AND (seq_processo = findocparmov.seq_processo))
  • Heap Fetches: 289
124. 0.000 0.002 ↓ 0.0 0 1

Hash (cost=18.50..18.50 rows=4 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
125. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on pessoa_associado pesass (cost=0.00..18.50 rows=4 width=16) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: (dt_demissao IS NULL)
126.          

SubPlan (forHash Left Join)

127. 58.000 58.000 ↑ 1.0 1 5,800

Seq Scan on pessoa_empresa_plano pesemppla (cost=0.00..3.54 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=5,800)

  • 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))
  • Rows Removed by Filter: 27