explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cm8z

Settings
# exclusive inclusive rows x rows loops node
1. 60.434 1,244.325 ↓ 7.4 5,800 1

Hash Left Join (cost=10,006.81..82,702.29 rows=788 width=551) (actual time=617.175..1,244.325 rows=5,800 loops=1)

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

Nested Loop Anti Join (cost=9,988.26..79,821.32 rows=788 width=406) (actual time=617.077..1,114.287 rows=5,800 loops=1)

3. 9.047 1,071.737 ↓ 7.5 6,089 1

Nested Loop (cost=9,987.84..79,402.66 rows=814 width=406) (actual time=617.056..1,071.737 rows=6,089 loops=1)

4. 9.845 1,062.690 ↓ 156.1 6,089 1

Nested Loop (cost=9,873.26..79,277.33 rows=39 width=368) (actual time=616.860..1,062.690 rows=6,089 loops=1)

5. 6.492 1,004.133 ↓ 253.7 6,089 1

Nested Loop (cost=9,872.70..79,247.35 rows=24 width=400) (actual time=616.838..1,004.133 rows=6,089 loops=1)

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

Hash Join (cost=9,872.28..79,235.82 rows=22 width=424) (actual time=616.820..954.878 rows=6,109 loops=1)

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

Nested Loop (cost=9,871.03..79,234.27 rows=22 width=424) (actual time=616.769..948.632 rows=6,109 loops=1)

8. 6.240 916.364 ↓ 277.7 6,109 1

Hash Join (cost=9,870.75..79,227.34 rows=22 width=432) (actual time=616.755..916.364 rows=6,109 loops=1)

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

Nested Loop (cost=9,781.74..79,138.01 rows=28 width=394) (actual time=616.355..909.737 rows=6,109 loops=1)

10. 6.519 870.383 ↓ 217.5 6,089 1

Nested Loop (cost=9,781.32..79,123.24 rows=28 width=370) (actual time=616.338..870.383 rows=6,089 loops=1)

11. 5.725 827.330 ↓ 217.5 6,089 1

Hash Join (cost=9,780.90..79,016.73 rows=28 width=318) (actual time=616.321..827.330 rows=6,089 loops=1)

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

Hash Join (cost=9,776.61..79,012.05 rows=28 width=305) (actual time=616.140..821.438 rows=6,089 loops=1)

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

Nested Loop (cost=9,752.37..78,987.38 rows=40 width=262) (actual time=614.785..813.573 rows=6,089 loops=1)

14. 33.825 295.074 ↓ 7.8 38,755 1

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

15. 26.063 101.409 ↓ 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=76.929..101.409 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.516 75.346 ↓ 0.0 0 1

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

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

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

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

  • Index Cond: (cd_empresa = 30)
19. 159.840 159.840 ↓ 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.009..0.012 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. 465.060 465.060 ↓ 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.012..0.012 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.204 1.337 ↓ 1.6 216 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
22. 0.372 1.133 ↓ 1.6 216 1

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

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

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

24. 0.150 0.570 ↓ 1.6 216 1

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
27. 0.092 0.092 ↓ 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.092 rows=106 loops=1)

28. 36.534 36.534 ↑ 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.005..0.006 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.005..0.005 rows=1 loops=6,089)

  • Index Cond: (cd_pessoa = pes.cd_pessoa)
30. 0.004 0.387 ↑ 3.1 11 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.015 0.383 ↑ 3.1 11 1

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

32. 0.111 0.368 ↑ 3.1 11 1

HashAggregate (cost=87.90..88.24 rows=34 width=490) (actual time=0.352..0.368 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.007 0.257 ↑ 3.1 11 1

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

34. 0.001 0.040 ↓ 0.0 0 1

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

35. 0.000 0.039 ↓ 0.0 0 1

Nested Loop (cost=0.69..16.82 rows=1 width=212) (actual time=0.039..0.039 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.030 0.210 ↑ 2.7 11 1

Nested Loop (cost=28.02..39.10 rows=30 width=212) (actual time=0.149..0.210 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.014..0.037 rows=11 loops=1)

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

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

54. 0.003 0.130 ↑ 3.0 1 1

Nested Loop (cost=28.02..36.13 rows=3 width=8) (actual time=0.128..0.130 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.110 ↑ 3.0 1 1

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

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

58. 0.001 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.001 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.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.038 0.077 ↑ 1.0 1 1

Nested Loop (cost=0.28..9.65 rows=1 width=56) (actual time=0.033..0.077 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.014..0.016 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.017..0.023 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. 24.436 24.436 ↑ 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.004..0.004 rows=1 loops=6,109)

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

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

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

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

71. 42.763 42.763 ↑ 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.006..0.007 rows=1 loops=6,109)

  • Index Cond: ((cd_pessoa = pes.cd_pessoa) AND ((id_tipo_endereco)::text = 'PRI'::text))
72. 48.712 48.712 ↑ 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.008..0.008 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.002 0.193 ↑ 21.0 1 1

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

75. 0.016 0.139 ↑ 7.0 1 1

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

Append (cost=28.29..86.05 rows=7 width=490) (actual time=0.113..0.123 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.001 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.001 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.55..16.60 rows=1 width=16) (actual time=0.018..0.018 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.099 ↑ 3.0 1 1

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

95. 0.003 0.040 ↑ 1.0 1 1

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

96. 0.011 0.011 ↑ 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.010..0.011 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.020..0.026 rows=1 loops=1)

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

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

Append (cost=0.55..27.64 rows=3 width=112) (actual time=0.039..0.044 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.001 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.011 0.011 ↓ 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.011..0.011 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.003 0.030 ↑ 1.0 1 1

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

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

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

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

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

111. 0.002 0.050 ↑ 3.0 1 1

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

112. 0.008 0.048 ↑ 3.0 1 1

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

Append (cost=0.55..27.64 rows=3 width=112) (actual time=0.032..0.040 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.004 0.026 ↑ 1.0 1 1

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

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

  • Index Cond: ((seq_operador)::text = '0164'::text)
  • Filter: (id_visao_emp_todos = 'S'::bpchar)
121. 0.011 0.011 ↑ 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.011 rows=1 loops=1)

  • Filter: (cd_empresa = 30)
  • Rows Removed by Filter: 27
122. 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
123. 36.534 36.534 ↓ 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.006..0.006 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.001 0.004 ↓ 0.0 0 1

Hash (cost=18.50..18.50 rows=4 width=16) (actual time=0.004..0.004 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. 69.600 69.600 ↑ 1.0 1 5,800

Seq Scan on pessoa_empresa_plano pesemppla (cost=0.00..3.54 rows=1 width=8) (actual time=0.009..0.012 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