explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WaUT

Settings
# exclusive inclusive rows x rows loops node
1. 0.320 1,260,276.139 ↑ 1,583.5 2 1

HashAggregate (cost=76,010.40..76,049.99 rows=3,167 width=540) (actual time=1,260,276.130..1,260,276.139 rows=2 loops=1)

2.          

CTE consultor

3. 0.683 4.603 ↓ 26.1 183 1

HashAggregate (cost=53.85..53.92 rows=7 width=4) (actual time=4.306..4.603 rows=183 loops=1)

4. 1.532 3.920 ↓ 44.3 310 1

Hash Join (cost=2.69..53.84 rows=7 width=4) (actual time=0.209..3.920 rows=310 loops=1)

  • Hash Cond: ((((dpf.perfil)::text || '#'::text) || (fpc.dd_tipo)::text) = (aux.nk_perfil_ambiente_consultor)::text)
5. 1.499 2.364 ↑ 1.0 1,436 1

Hash Join (cost=1.50..43.60 rows=1,436 width=28) (actual time=0.131..2.364 rows=1,436 loops=1)

  • Hash Cond: (fpc.sk_perfil = dpf.sk_perfil)
6. 0.822 0.822 ↑ 1.0 1,436 1

Seq Scan on fato_perfil_consultor fpc (cost=0.00..22.36 rows=1,436 width=10) (actual time=0.010..0.822 rows=1,436 loops=1)

7. 0.023 0.043 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=26) (actual time=0.043..0.043 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
8. 0.020 0.020 ↑ 1.0 22 1

Seq Scan on dim_perfil dpf (cost=0.00..1.22 rows=22 width=26) (actual time=0.008..0.020 rows=22 loops=1)

9. 0.004 0.024 ↑ 1.0 1 1

Hash (cost=1.18..1.18 rows=1 width=25) (actual time=0.024..0.024 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
10. 0.020 0.020 ↑ 1.0 1 1

Seq Scan on aux_perfil_gestao_alfa aux (cost=0.00..1.18 rows=1 width=25) (actual time=0.019..0.020 rows=1 loops=1)

  • Filter: (filtrar IS TRUE)
  • Rows Removed by Filter: 17
11.          

CTE empresa

12. 12.126 27.512 ↑ 9.4 18 1

HashAggregate (cost=83.57..85.26 rows=169 width=4) (actual time=27.507..27.512 rows=18 loops=1)

13. 13.711 15.386 ↓ 9.3 29,250 1

Hash Join (cost=35.33..75.70 rows=3,150 width=4) (actual time=1.644..15.386 rows=29,250 loops=1)

  • Hash Cond: ((du.cod_empresa)::text = (de.cod_empresa)::text)
14. 0.200 0.200 ↑ 1.0 126 1

Index Only Scan using dim_usuario_login_idx on dim_usuario du (cost=0.00..3.96 rows=126 width=2) (actual time=0.087..0.200 rows=126 loops=1)

  • Index Cond: (login = 'schuster'::text)
  • Heap Fetches: 0
15. 0.215 1.475 ↓ 7.8 234 1

Hash (cost=34.96..34.96 rows=30 width=6) (actual time=1.475..1.475 rows=234 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.323 1.260 ↓ 7.8 234 1

Hash Join (cost=28.33..34.96 rows=30 width=6) (actual time=0.988..1.260 rows=234 loops=1)

  • Hash Cond: (de.sk_empresa = frf.sk_empresa)
17. 0.208 0.208 ↑ 1.0 169 1

Seq Scan on dim_empresa de (cost=0.00..5.69 rows=169 width=6) (actual time=0.026..0.208 rows=169 loops=1)

18. 0.195 0.729 ↓ 7.8 234 1

Hash (cost=27.96..27.96 rows=30 width=4) (actual time=0.729..0.729 rows=234 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
19. 0.200 0.534 ↓ 7.8 234 1

Nested Loop (cost=0.00..27.96 rows=30 width=4) (actual time=0.262..0.534 rows=234 loops=1)

20. 0.045 0.045 ↑ 1.0 1 1

Seq Scan on dim_regiao dr (cost=0.00..1.60 rows=1 width=4) (actual time=0.040..0.045 rows=1 loops=1)

  • Filter: (cod_regiao = 61365998)
  • Rows Removed by Filter: 47
21. 0.289 0.289 ↓ 1.6 234 1

Index Only Scan using fato_regiao_filial_cidade_pkey on fato_regiao_filial_cidade frf (cost=0.00..24.91 rows=145 width=8) (actual time=0.149..0.289 rows=234 loops=1)

  • Index Cond: (sk_regiao = dr.sk_regiao)
  • Heap Fetches: 0
22.          

CTE empresa_regional

23. 0.242 29.223 ↑ 80.3 18 1

HashAggregate (cost=77.03..91.49 rows=1,446 width=21) (actual time=29.205..29.223 rows=18 loops=1)

24. 0.219 28.981 ↑ 6.2 234 1

Hash Join (cost=7.57..69.80 rows=1,446 width=21) (actual time=27.806..28.981 rows=234 loops=1)

  • Hash Cond: (frf.sk_regiao = dr.sk_regiao)
25. 0.629 28.651 ↑ 6.2 234 1

Hash Join (cost=5.49..47.84 rows=1,446 width=8) (actual time=27.649..28.651 rows=234 loops=1)

  • Hash Cond: (frf.sk_empresa = e.sk_empresa)
26. 0.457 0.457 ↑ 1.0 1,446 1

Seq Scan on fato_regiao_filial_cidade frf (cost=0.00..22.46 rows=1,446 width=8) (actual time=0.013..0.457 rows=1,446 loops=1)

27. 0.028 27.565 ↑ 9.4 18 1

Hash (cost=3.38..3.38 rows=169 width=4) (actual time=27.565..27.565 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
28. 27.537 27.537 ↑ 9.4 18 1

CTE Scan on empresa e (cost=0.00..3.38 rows=169 width=4) (actual time=27.516..27.537 rows=18 loops=1)

29. 0.056 0.111 ↑ 1.0 48 1

Hash (cost=1.48..1.48 rows=48 width=21) (actual time=0.111..0.111 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
30. 0.055 0.055 ↑ 1.0 48 1

Seq Scan on dim_regiao dr (cost=0.00..1.48 rows=48 width=21) (actual time=0.016..0.055 rows=48 loops=1)

31.          

CTE data_corte

32. 0.027 0.240 ↑ 3.0 2 1

HashAggregate (cost=22.86..22.92 rows=6 width=6) (actual time=0.235..0.240 rows=2 loops=1)

33. 0.213 0.213 ↑ 3.0 2 1

Seq Scan on dim_tempo_mes dtm (cost=0.00..22.83 rows=6 width=6) (actual time=0.074..0.213 rows=2 loops=1)

  • Filter: ((mes = 12) AND (2019 >= (ano + 1)) AND (2019 <= (ano + 2)))
  • Rows Removed by Filter: 657
34.          

CTE consultor_hist

35. 0.332 6.730 ↓ 17.6 334 1

HashAggregate (cost=105.27..105.46 rows=19 width=6) (actual time=6.650..6.730 rows=334 loops=1)

36. 0.383 6.398 ↓ 26.4 502 1

Nested Loop (cost=2.69..105.17 rows=19 width=6) (actual time=0.623..6.398 rows=502 loops=1)

  • Join Filter: (((fvpc.sk_tempo_dia_inicio_vigencia IS NULL) OR (dtdi.nk_tempo_dia <= dc.data_ultimo_dia_mes)) AND ((fvpc.sk_tempo_dia_fim_vigencia IS NULL) OR (dtdf.nk_tempo_dia >= dc.data_ultimo_dia_mes)))
  • Rows Removed by Join Filter: 494
37. 0.007 0.007 ↑ 3.0 2 1

CTE Scan on data_corte dc (cost=0.00..0.12 rows=6 width=6) (actual time=0.003..0.007 rows=2 loops=1)

38. 0.335 6.008 ↓ 41.5 498 2

Materialize (cost=2.69..103.82 rows=12 width=20) (actual time=0.217..3.004 rows=498 loops=2)

39. 0.164 5.673 ↓ 41.5 498 1

Nested Loop Left Join (cost=2.69..103.76 rows=12 width=20) (actual time=0.431..5.673 rows=498 loops=1)

40. 0.245 5.011 ↓ 41.5 498 1

Nested Loop Left Join (cost=2.69..97.83 rows=12 width=16) (actual time=0.426..5.011 rows=498 loops=1)

41. 1.305 3.272 ↓ 41.5 498 1

Hash Join (cost=2.69..91.90 rows=12 width=12) (actual time=0.401..3.272 rows=498 loops=1)

  • Hash Cond: ((((dpf.perfil)::text || '#'::text) || (fvpc.dd_tipo)::text) = (aux.nk_perfil_ambiente_consultor)::text)
42. 1.420 1.945 ↑ 1.0 2,403 1

Hash Join (cost=1.50..75.57 rows=2,403 width=36) (actual time=0.077..1.945 rows=2,403 loops=1)

  • Hash Cond: (fvpc.sk_perfil = dpf.sk_perfil)
43. 0.510 0.510 ↑ 1.0 2,403 1

Seq Scan on fato_vigencia_perfil_consultor fvpc (cost=0.00..41.03 rows=2,403 width=18) (actual time=0.037..0.510 rows=2,403 loops=1)

44. 0.004 0.015 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=26) (actual time=0.015..0.015 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
45. 0.011 0.011 ↑ 1.0 22 1

Seq Scan on dim_perfil dpf (cost=0.00..1.22 rows=22 width=26) (actual time=0.004..0.011 rows=22 loops=1)

46. 0.003 0.022 ↑ 1.0 1 1

Hash (cost=1.18..1.18 rows=1 width=25) (actual time=0.022..0.022 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
47. 0.019 0.019 ↑ 1.0 1 1

Seq Scan on aux_perfil_gestao_alfa aux (cost=0.00..1.18 rows=1 width=25) (actual time=0.018..0.019 rows=1 loops=1)

  • Filter: (filtrar IS TRUE)
  • Rows Removed by Filter: 17
48. 1.494 1.494 ↑ 1.0 1 498

Index Scan using dim_tempo_dia_pkey on dim_tempo_dia dtdi (cost=0.00..0.48 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=498)

  • Index Cond: (sk_tempo_dia = fvpc.sk_tempo_dia_inicio_vigencia)
49. 0.498 0.498 ↓ 0.0 0 498

Index Scan using dim_tempo_dia_pkey on dim_tempo_dia dtdf (cost=0.00..0.48 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=498)

  • Index Cond: (sk_tempo_dia = fvpc.sk_tempo_dia_fim_vigencia)
50.          

CTE cliente_ativo

51. 154.868 533.399 ↓ 333.1 132,583 1

HashAggregate (cost=18,310.44..18,314.42 rows=398 width=6) (actual time=468.158..533.399 rows=132,583 loops=1)

52. 151.937 378.531 ↓ 333.1 132,583 1

Nested Loop (cost=0.00..18,308.45 rows=398 width=6) (actual time=270.951..378.531 rows=132,583 loops=1)

  • Join Filter: (dc.data_ultimo_dia_mes <@ daterange(f.nk_tempo_dia_inicio, f.nk_tempo_dia_fim, '[)'::text))
  • Rows Removed by Join Filter: 133527
53. 0.010 0.010 ↑ 3.0 2 1

CTE Scan on data_corte dc (cost=0.00..0.12 rows=6 width=6) (actual time=0.001..0.010 rows=2 loops=1)

54. 66.317 226.584 ↓ 2.0 133,055 2

Materialize (cost=0.00..11,512.78 rows=66,298 width=12) (actual time=0.018..113.292 rows=133,055 loops=2)

55. 160.267 160.267 ↓ 2.0 133,055 1

Seq Scan on fato_trns_situacao_cliente f (cost=0.00..11,181.30 rows=66,298 width=12) (actual time=0.033..160.267 rows=133,055 loops=1)

  • Filter: (((dd_atributo)::text = 'ATIVO'::text) AND ((valor)::text = 'SIM'::text))
  • Rows Removed by Filter: 377098
56.          

CTE local_ativo

57. 124.070 449.693 ↓ 165.8 109,597 1

HashAggregate (cost=16,002.42..16,009.03 rows=661 width=6) (actual time=400.985..449.693 rows=109,597 loops=1)

58. 166.071 325.623 ↓ 165.8 109,597 1

Nested Loop (cost=0.00..15,999.11 rows=661 width=6) (actual time=222.436..325.623 rows=109,597 loops=1)

  • Join Filter: (dc.data_ultimo_dia_mes <@ daterange(f.nk_tempo_dia_inicio, f.nk_tempo_dia_fim, '[)'::text))
  • Rows Removed by Join Filter: 111861
59. 0.252 0.252 ↑ 3.0 2 1

CTE Scan on data_corte dc (cost=0.00..0.12 rows=6 width=6) (actual time=0.241..0.252 rows=2 loops=1)

60. 78.036 159.300 ↓ 1.0 110,729 2

Materialize (cost=0.00..4,708.10 rows=110,155 width=12) (actual time=0.007..79.650 rows=110,729 loops=2)

61. 81.264 81.264 ↓ 1.0 110,729 1

Seq Scan on fato_trns_ativo_local f (cost=0.00..4,157.33 rows=110,155 width=12) (actual time=0.010..81.264 rows=110,729 loops=1)

  • Filter: dd_ativo
  • Rows Removed by Filter: 159104
62.          

CTE carteira_hist_ano

63. 35.465 1,255,027.938 ↓ 21,716.0 21,716 1

WindowAgg (cost=599.91..599.94 rows=1 width=21) (actual time=1,254,986.449..1,255,027.938 rows=21,716 loops=1)

64. 49.813 1,254,992.473 ↓ 21,716.0 21,716 1

Sort (cost=599.91..599.91 rows=1 width=21) (actual time=1,254,986.264..1,254,992.473 rows=21,716 loops=1)

  • Sort Key: f.sk_empresa, f.sk_consultor, f.sk_cliente, f.sk_cliente_local, dc.ano
  • Sort Method: quicksort Memory: 2465kB
65. 32.670 1,254,942.660 ↓ 21,716.0 21,716 1

HashAggregate (cost=599.88..599.90 rows=1 width=21) (actual time=1,254,929.370..1,254,942.660 rows=21,716 loops=1)

66. 67.742 1,254,909.990 ↓ 21,716.0 21,716 1

Hash Join (cost=581.68..599.87 rows=1 width=21) (actual time=1,254,742.568..1,254,909.990 rows=21,716 loops=1)

  • Hash Cond: ((la.ano = ca.ano) AND (la.sk_cliente_local = f.sk_cliente_local))
67. 500.954 500.954 ↓ 165.8 109,597 1

CTE Scan on local_ativo la (cost=0.00..13.22 rows=661 width=6) (actual time=400.988..500.954 rows=109,597 loops=1)

68. 34.345 1,254,341.294 ↓ 22,101.0 22,101 1

Hash (cost=581.67..581.67 rows=1 width=25) (actual time=1,254,341.294..1,254,341.294 rows=22,101 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1259kB
69. 16,535.028 1,254,306.949 ↓ 22,101.0 22,101 1

Nested Loop (cost=10.77..581.67 rows=1 width=25) (actual time=700.531..1,254,306.949 rows=22,101 loops=1)

  • Join Filter: (dc.data_ultimo_dia_mes <@ daterange(f.nk_tempo_dia_inicio, f.nk_tempo_dia_fim, '[)'::text))
  • Rows Removed by Join Filter: 37844
70. 11,284.504 18,008.321 ↓ 24,395,272.0 24,395,272 1

Merge Join (cost=10.77..10.93 rows=1 width=18) (actual time=697.900..18,008.321 rows=24,395,272 loops=1)

  • Merge Cond: (ca.ano = ch.ano)
71. 199.067 847.682 ↓ 11,048.6 132,583 1

Sort (cost=9.98..10.01 rows=12 width=12) (actual time=690.825..847.682 rows=132,583 loops=1)

  • Sort Key: dc.ano
  • Sort Method: quicksort Memory: 12359kB
72. 54.801 648.615 ↓ 11,048.6 132,583 1

Hash Join (cost=0.20..9.77 rows=12 width=12) (actual time=468.204..648.615 rows=132,583 loops=1)

  • Hash Cond: (ca.ano = dc.ano)
73. 593.809 593.809 ↓ 333.1 132,583 1

CTE Scan on cliente_ativo ca (cost=0.00..7.96 rows=398 width=6) (actual time=468.162..593.809 rows=132,583 loops=1)

74. 0.003 0.005 ↑ 3.0 2 1

Hash (cost=0.12..0.12 rows=6 width=6) (actual time=0.005..0.005 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
75. 0.002 0.002 ↑ 3.0 2 1

CTE Scan on data_corte dc (cost=0.00..0.12 rows=6 width=6) (actual time=0.002..0.002 rows=2 loops=1)

76. 5,869.268 5,876.135 ↓ 1,276,991.6 24,262,840 1

Sort (cost=0.78..0.83 rows=19 width=6) (actual time=6.980..5,876.135 rows=24,262,840 loops=1)

  • Sort Key: ch.ano
  • Sort Method: quicksort Memory: 40kB
77. 6.867 6.867 ↓ 17.6 334 1

CTE Scan on consultor_hist ch (cost=0.00..0.38 rows=19 width=6) (actual time=6.652..6.867 rows=334 loops=1)

78. 243,952.720 1,219,763.600 ↓ 0.0 0 24,395,272

Nested Loop (cost=0.00..568.20 rows=169 width=27) (actual time=0.050..0.050 rows=0 loops=24,395,272)

79. 97,581.088 97,581.088 ↑ 9.4 18 24,395,272

CTE Scan on empresa e (cost=0.00..3.38 rows=169 width=4) (actual time=0.000..0.004 rows=18 loops=24,395,272)

80. 878,229.792 878,229.792 ↓ 0.0 0 439,114,896

Index Scan using fato_trns_carteira_consultor_pkey on fato_trns_carteira_consultor f (cost=0.00..3.33 rows=1 width=27) (actual time=0.002..0.002 rows=0 loops=439,114,896)

  • Index Cond: ((sk_empresa = e.sk_empresa) AND (sk_consultor = ch.sk_consultor) AND (sk_cliente = ca.sk_cliente))
81.          

CTE carteira

82. 7.717 1,259,533.927 ↓ 8.3 36,209 1

Append (cost=27,185.51..27,316.84 rows=4,377 width=12) (actual time=4,426.815..1,259,533.927 rows=36,209 loops=1)

83. 91.494 4,445.185 ↓ 5.8 25,299 1

HashAggregate (cost=27,185.51..27,273.03 rows=4,376 width=12) (actual time=4,426.813..4,445.185 rows=25,299 loops=1)

84. 218.577 4,353.691 ↓ 10.2 44,741 1

Hash Join (cost=11,902.70..27,141.75 rows=4,376 width=12) (actual time=511.517..4,353.691 rows=44,741 loops=1)

  • Hash Cond: (f.sk_empresa = e.sk_empresa)
85. 251.219 4,135.088 ↓ 97.5 426,853 1

Nested Loop (cost=11,897.20..27,032.32 rows=4,376 width=12) (actual time=410.454..4,135.088 rows=426,853 loops=1)

86. 604.676 1,749.409 ↓ 50.7 426,892 1

Hash Join (cost=11,897.20..20,498.47 rows=8,418 width=12) (actual time=410.319..1,749.409 rows=426,892 loops=1)

  • Hash Cond: (f.sk_cliente_local = dcl.sk_cliente_local)
87. 114.934 739.615 ↓ 21.0 427,009 1

Nested Loop (cost=40.57..8,329.05 rows=20,320 width=16) (actual time=4.951..739.615 rows=427,009 loops=1)

88. 5.226 5.226 ↓ 26.1 183 1

CTE Scan on consultor co (cost=0.00..0.14 rows=7 width=4) (actual time=4.308..5.226 rows=183 loops=1)

89. 536.922 619.455 ↑ 1.2 2,333 183

Bitmap Heap Scan on fato_cobertura_consultor f (cost=40.57..1,160.81 rows=2,903 width=16) (actual time=0.586..3.385 rows=2,333 loops=183)

  • Recheck Cond: (sk_consultor = co.sk_consultor)
90. 82.533 82.533 ↑ 1.2 2,333 183

Bitmap Index Scan on fato_cobertura_consultor_consultor_idx (cost=0.00..39.84 rows=2,903 width=0) (actual time=0.451..0.451 rows=2,333 loops=183)

  • Index Cond: (sk_consultor = co.sk_consultor)
91. 65.461 405.118 ↑ 1.0 110,272 1

Hash (cost=10,471.52..10,471.52 rows=110,809 width=4) (actual time=405.118..405.118 rows=110,272 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 3877kB
92. 339.657 339.657 ↑ 1.0 110,272 1

Seq Scan on dim_cliente_local dcl (cost=0.00..10,471.52 rows=110,809 width=4) (actual time=0.086..339.657 rows=110,272 loops=1)

  • Filter: ((ativo)::text = 'SIM'::text)
  • Rows Removed by Filter: 157210
93. 2,134.460 2,134.460 ↑ 1.0 1 426,892

Index Scan using dim_cliente_pkey on dim_cliente dc (cost=0.00..0.77 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=426,892)

  • Index Cond: (sk_cliente = f.sk_cliente)
  • Filter: ((ativo)::text = 'SIM'::text)
  • Rows Removed by Filter: 0
94. 0.015 0.026 ↑ 9.4 18 1

Hash (cost=3.38..3.38 rows=169 width=4) (actual time=0.026..0.026 rows=18 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
95. 0.011 0.011 ↑ 9.4 18 1

CTE Scan on empresa e (cost=0.00..3.38 rows=169 width=4) (actual time=0.002..0.011 rows=18 loops=1)

96. 5.528 1,255,081.025 ↓ 10,910.0 10,910 1

Subquery Scan on *SELECT* 2 (cost=0.03..0.05 rows=1 width=14) (actual time=1,255,066.199..1,255,081.025 rows=10,910 loops=1)

97. 27.873 1,255,075.497 ↓ 10,910.0 10,910 1

HashAggregate (cost=0.03..0.04 rows=1 width=14) (actual time=1,255,066.124..1,255,075.497 rows=10,910 loops=1)

98. 1,255,047.624 1,255,047.624 ↓ 21,716.0 21,716 1

CTE Scan on carteira_hist_ano cha (cost=0.00..0.02 rows=1 width=14) (actual time=1,254,986.456..1,255,047.624 rows=21,716 loops=1)

99.          

CTE atendimentos

100. 59.553 1,260,246.370 ↑ 16.8 26 1

HashAggregate (cost=13,209.20..13,213.58 rows=438 width=34) (actual time=1,260,246.358..1,260,246.370 rows=26 loops=1)

101. 42.636 1,260,186.817 ↓ 11.7 51,037 1

Nested Loop Left Join (cost=0.00..13,121.66 rows=4,377 width=34) (actual time=4,426.945..1,260,186.817 rows=51,037 loops=1)

102. 1,259,564.837 1,259,564.837 ↓ 8.3 36,209 1

CTE Scan on carteira ca (cost=0.00..87.54 rows=4,377 width=20) (actual time=4,426.817..1,259,564.837 rows=36,209 loops=1)

103. 58.129 579.344 ↑ 1.0 1 36,209

Nested Loop (cost=0.00..2.97 rows=1 width=36) (actual time=0.010..0.016 rows=1 loops=36,209)

  • Join Filter: (ca.ano = (dtd.ano)::double precision)
  • Rows Removed by Join Filter: 1
104. 62.892 398.299 ↑ 1.0 1 36,209

Nested Loop (cost=0.00..2.67 rows=1 width=38) (actual time=0.005..0.011 rows=1 loops=36,209)

105. 253.463 253.463 ↑ 1.0 1 36,209

Index Scan using fato_atendimento_agenda_dia_evento_pkey on fato_atendimento_agenda_dia_evento f (cost=0.00..2.39 rows=1 width=24) (actual time=0.004..0.007 rows=1 loops=36,209)

  • Index Cond: ((sk_empresa = ca.sk_empresa) AND (sk_consultor = ca.sk_consultor) AND (sk_cliente = ca.sk_cliente))
106. 81.944 81.944 ↑ 1.0 1 40,972

Index Scan using dim_tipo_de_atendimento_pkey1 on dim_tipo_de_atendimento dta (cost=0.00..0.27 rows=1 width=22) (actual time=0.001..0.002 rows=1 loops=40,972)

  • Index Cond: (sk_tipo_de_atendimento = f.sk_tipo_de_atendimento)
107. 122.916 122.916 ↑ 1.0 1 40,972

Index Scan using dim_tempo_dia_pkey on dim_tempo_dia dtd (cost=0.00..0.28 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=40,972)

  • Index Cond: (sk_tempo_dia = f.sk_tempo_dia)
  • Filter: ((2019 >= ano) AND (2019 <= (ano + 2)))
108. 0.136 1,260,275.819 ↑ 121.8 26 1

Hash Join (cost=14.23..157.97 rows=3,167 width=540) (actual time=1,260,275.764..1,260,275.819 rows=26 loops=1)

  • Hash Cond: (er.sk_empresa = a.sk_empresa)
109. 29.250 29.250 ↑ 80.3 18 1

CTE Scan on empresa_regional er (cost=0.00..28.92 rows=1,446 width=520) (actual time=29.214..29.250 rows=18 loops=1)

110. 0.035 1,260,246.433 ↑ 16.8 26 1

Hash (cost=8.76..8.76 rows=438 width=28) (actual time=1,260,246.433..1,260,246.433 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
111. 1,260,246.398 1,260,246.398 ↑ 16.8 26 1

CTE Scan on atendimentos a (cost=0.00..8.76 rows=438 width=28) (actual time=1,260,246.362..1,260,246.398 rows=26 loops=1)