explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I4eW

Settings
# exclusive inclusive rows x rows loops node
1. 48.197 1,229.559 ↓ 8.0 5,797 1

Hash Left Join (cost=10,006.81..82,423.10 rows=723 width=551) (actual time=691.902..1,229.559 rows=5,797 loops=1)

  • Hash Cond: (pes.cd_pessoa = pesass.cd_pessoa)
2. 5.169 1,123.389 ↓ 8.0 5,797 1

Nested Loop Anti Join (cost=9,988.26..79,778.24 rows=723 width=406) (actual time=691.805..1,123.389 rows=5,797 loops=1)

3. 7.494 1,087.790 ↓ 8.1 6,086 1

Nested Loop (cost=9,987.84..79,394.04 rows=747 width=406) (actual time=691.786..1,087.790 rows=6,086 loops=1)

4. 6.930 1,080.296 ↓ 169.1 6,086 1

Nested Loop (cost=9,873.26..79,269.49 rows=36 width=368) (actual time=691.598..1,080.296 rows=6,086 loops=1)

5. 10.677 1,030.764 ↓ 276.6 6,086 1

Nested Loop (cost=9,872.70..79,242.01 rows=22 width=400) (actual time=691.577..1,030.764 rows=6,086 loops=1)

  • Join Filter: (pesend.seq_endereco = pesendtip.seq_endereco)
  • Rows Removed by Join Filter: 20
6. 5.149 989.557 ↓ 290.8 6,106 1

Hash Join (cost=9,872.28..79,231.00 rows=21 width=424) (actual time=691.560..989.557 rows=6,106 loops=1)

  • Hash Cond: (findocparmov.cd_tipo_cobranca = tcb.cd_tipo_cobranca)
7. 9.378 984.371 ↓ 290.8 6,106 1

Nested Loop (cost=9,871.03..79,229.47 rows=21 width=424) (actual time=691.506..984.371 rows=6,106 loops=1)

8. 5.396 956.675 ↓ 290.8 6,106 1

Hash Join (cost=9,870.75..79,222.85 rows=21 width=432) (actual time=691.493..956.675 rows=6,106 loops=1)

  • Hash Cond: (findocparmov.cd_filial_mov = pesfilmov.cd_filial)
9. 9.381 950.825 ↓ 226.1 6,106 1

Nested Loop (cost=9,781.74..79,133.53 rows=27 width=394) (actual time=691.024..950.825 rows=6,106 loops=1)

10. 5.638 917.100 ↓ 225.4 6,086 1

Nested Loop (cost=9,781.32..79,119.30 rows=27 width=370) (actual time=691.010..917.100 rows=6,086 loops=1)

11. 4.995 881.032 ↓ 225.4 6,086 1

Hash Join (cost=9,780.90..79,016.59 rows=27 width=318) (actual time=690.993..881.032 rows=6,086 loops=1)

  • Hash Cond: (findoc.cd_tipo_doc_credito = tipdoccre.cd_tipo_doc_credito)
12. 5.498 875.869 ↓ 225.4 6,086 1

Hash Join (cost=9,776.61..79,011.93 rows=27 width=305) (actual time=690.810..875.869 rows=6,086 loops=1)

  • Hash Cond: (findocparmov.cd_operacao = opefin.cd_operacao)
13. 50.215 869.046 ↓ 152.2 6,086 1

Nested Loop (cost=9,752.37..78,987.26 rows=40 width=262) (actual time=689.467..869.046 rows=6,086 loops=1)

14. 39.282 315.016 ↓ 7.8 38,755 1

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

15. 27.164 102.574 ↓ 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=77.052..102.574 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.537 75.410 ↓ 0.0 0 1

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

17. 6.592 6.592 ↑ 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.592..6.592 rows=13,386 loops=1)

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

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

  • Index Cond: (cd_empresa = 30)
19. 173.160 173.160 ↓ 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.010..0.013 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. 503.815 503.815 ↓ 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.013..0.013 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.186 1.325 ↓ 1.6 216 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
22. 0.430 1.139 ↓ 1.6 216 1

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

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

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

24. 0.136 0.523 ↓ 1.6 216 1

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

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

Seq Scan on operacao_financ opefin (cost=0.00..8.53 rows=139 width=11) (actual time=0.023..0.387 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.090 0.168 ↓ 1.0 106 1

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

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

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

28. 30.430 30.430 ↑ 1.0 1 6,086

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,086)

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

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

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
30. 0.012 0.454 ↑ 3.1 11 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.005 0.442 ↑ 3.1 11 1

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

32. 0.183 0.437 ↑ 3.1 11 1

HashAggregate (cost=87.90..88.24 rows=34 width=490) (actual time=0.418..0.437 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.009 0.254 ↑ 3.1 11 1

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

34. 0.001 0.041 ↓ 0.0 0 1

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

35. 0.001 0.040 ↓ 0.0 0 1

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

36. 0.001 0.039 ↓ 0.0 0 1

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

37. 0.038 0.038 ↓ 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.038..0.038 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.034 0.204 ↑ 2.7 11 1

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

52. 0.038 0.038 ↓ 1.1 11 1

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

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

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

54. 0.004 0.117 ↑ 3.0 1 1

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

55. 0.038 0.038 ↑ 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.037..0.038 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.075..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.000 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.018 ↓ 0.0 0 1

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

59. 0.002 0.018 ↓ 0.0 0 1

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

60. 0.016 0.016 ↓ 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.016..0.016 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.002 0.042 ↑ 1.0 1 1

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

64. 0.016 0.016 ↑ 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.015..0.016 rows=1 loops=1)

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

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

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 27
66. 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
67. 0.000 0.000 ↓ 0.0 0 1

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

  • One-Time Filter: false
68. 18.318 18.318 ↑ 1.0 1 6,106

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,106)

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

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

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

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

71. 30.530 30.530 ↑ 1.0 1 6,106

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.005 rows=1 loops=6,106)

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

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

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

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

74. 0.004 0.185 ↑ 21.0 1 1

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

75. 0.014 0.134 ↑ 7.0 1 1

HashAggregate (cost=86.84..86.91 rows=7 width=490) (actual time=0.134..0.134 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.002 0.120 ↑ 7.0 1 1

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

77. 0.001 0.020 ↓ 0.0 0 1

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

78. 0.002 0.019 ↓ 0.0 0 1

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

79. 0.000 0.017 ↓ 0.0 0 1

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

80. 0.017 0.017 ↓ 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.017..0.017 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.097 ↑ 3.0 1 1

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

95. 0.006 0.041 ↑ 1.0 1 1

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

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

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

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

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

HashAggregate (cost=27.74..27.77 rows=3 width=112) (actual time=0.053..0.053 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.002 0.041 ↑ 3.0 1 1

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

100. 0.000 0.012 ↓ 0.0 0 1

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

101. 0.002 0.012 ↓ 0.0 0 1

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

102. 0.010 0.010 ↓ 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.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
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.001 0.026 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.65 rows=1 width=56) (actual time=0.022..0.026 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.015 0.015 ↑ 1.0 1 1

Seq Scan on pessoa_empresa pesemp_8 (cost=0.00..1.35 rows=1 width=56) (actual time=0.012..0.015 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.001 0.047 ↑ 3.0 1 1

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

111. 0.003 0.046 ↑ 3.0 1 1

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

112. 0.007 0.043 ↑ 3.0 1 1

HashAggregate (cost=27.74..27.77 rows=3 width=112) (actual time=0.043..0.043 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.003 0.036 ↑ 3.0 1 1

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

114. 0.000 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.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.011..0.011 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.003 0.022 ↑ 1.0 1 1

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

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

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

Seq Scan on pessoa_empresa pesemp_10 (cost=0.00..1.35 rows=1 width=56) (actual time=0.008..0.010 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.430 30.430 ↓ 0.0 0 6,086

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,086)

  • 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.003 ↓ 0.0 0 1

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

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

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

  • Filter: (dt_demissao IS NULL)
126.          

SubPlan (forHash Left Join)

127. 57.970 57.970 ↑ 1.0 1 5,797

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,797)

  • 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