explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yhqs

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 7.072 ↓ 0.0 0 1

Sort (cost=495.62..495.62 rows=1 width=3,378) (actual time=7.072..7.072 rows=0 loops=1)

  • Sort Key: tipoatendi2_.ds_tipo_atendimento
  • Sort Method: quicksort Memory: 25kB
2. 0.003 7.063 ↓ 0.0 0 1

Nested Loop Semi Join (cost=445.30..495.61 rows=1 width=3,378) (actual time=7.063..7.063 rows=0 loops=1)

  • Join Filter: (naturezapr0_.cd_tp_atendimento = naturezapr31_.cd_tp_atendimento)
3. 0.005 6.704 ↑ 1.0 1 1

Nested Loop (cost=444.75..493.64 rows=1 width=3,386) (actual time=5.253..6.704 rows=1 loops=1)

4. 0.004 6.692 ↑ 1.0 1 1

Nested Loop Left Join (cost=444.75..492.59 rows=1 width=3,160) (actual time=5.243..6.692 rows=1 loops=1)

5. 0.016 6.131 ↑ 1.0 1 1

Nested Loop Left Join (cost=444.62..492.16 rows=1 width=2,934) (actual time=4.683..6.131 rows=1 loops=1)

6. 0.002 6.115 ↑ 1.0 1 1

Nested Loop Left Join (cost=444.47..490.96 rows=1 width=2,808) (actual time=4.681..6.115 rows=1 loops=1)

7. 0.003 6.113 ↑ 1.0 1 1

Nested Loop Left Join (cost=444.20..489.36 rows=1 width=2,770) (actual time=4.680..6.113 rows=1 loops=1)

8. 0.000 6.110 ↑ 1.0 1 1

Nested Loop Left Join (cost=444.06..489.17 rows=1 width=2,644) (actual time=4.677..6.110 rows=1 loops=1)

9. 0.002 6.109 ↑ 1.0 1 1

Nested Loop Left Join (cost=443.91..488.98 rows=1 width=2,604) (actual time=4.676..6.109 rows=1 loops=1)

10. 0.002 6.107 ↑ 1.0 1 1

Nested Loop Left Join (cost=443.77..488.81 rows=1 width=2,596) (actual time=4.674..6.107 rows=1 loops=1)

11. 0.004 6.105 ↑ 1.0 1 1

Nested Loop Left Join (cost=443.49..488.37 rows=1 width=2,529) (actual time=4.672..6.105 rows=1 loops=1)

12. 0.002 6.101 ↑ 1.0 1 1

Nested Loop Left Join (cost=443.35..488.19 rows=1 width=2,403) (actual time=4.669..6.101 rows=1 loops=1)

13. 0.002 6.099 ↑ 1.0 1 1

Nested Loop Left Join (cost=443.07..484.26 rows=1 width=2,308) (actual time=4.667..6.099 rows=1 loops=1)

14. 0.002 6.097 ↑ 1.0 1 1

Nested Loop Left Join (cost=442.80..483.82 rows=1 width=2,270) (actual time=4.665..6.097 rows=1 loops=1)

15. 0.003 6.094 ↑ 1.0 1 1

Nested Loop Left Join (cost=442.52..482.49 rows=1 width=2,224) (actual time=4.662..6.094 rows=1 loops=1)

16. 0.002 6.091 ↑ 1.0 1 1

Nested Loop Left Join (cost=442.39..482.29 rows=1 width=2,102) (actual time=4.659..6.091 rows=1 loops=1)

17. 0.038 6.088 ↑ 1.0 1 1

Hash Join (cost=442.11..481.87 rows=1 width=2,060) (actual time=4.656..6.088 rows=1 loops=1)

  • Hash Cond: (naturezapr0_.cd_tp_exame = tipoexame4_.cd_tp_exame)
18. 0.161 6.017 ↑ 1.0 360 1

Hash Left Join (cost=440.15..478.54 rows=360 width=1,878) (actual time=4.361..6.017 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_tp_atendimento_internacao = tipoatendi21_.cd_tp_atendimento)
19. 0.134 5.722 ↑ 1.0 360 1

Hash Left Join (cost=423.28..460.32 rows=360 width=1,836) (actual time=4.218..5.722 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_tp_atendimento_observacao = tipoatendi17_.cd_tp_atendimento)
20. 0.135 5.457 ↑ 1.0 360 1

Hash Left Join (cost=406.42..442.09 rows=360 width=1,794) (actual time=4.078..5.457 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_tp_atendimento_prox = tipoatendi13_.cd_tp_atendimento)
21. 0.148 5.188 ↑ 1.0 360 1

Hash Left Join (cost=389.55..423.87 rows=360 width=1,752) (actual time=3.936..5.188 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_tp_ate_principal = tipoatendi11_.cd_tp_atendimento)
22. 0.149 4.908 ↑ 1.0 360 1

Hash Left Join (cost=372.69..405.39 rows=360 width=1,710) (actual time=3.796..4.908 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_cla_atendimento = classifica10_.cd_cla_atendimento)
23. 0.131 4.740 ↑ 1.0 360 1

Hash Left Join (cost=370.79..401.99 rows=360 width=1,584) (actual time=3.770..4.740 rows=360 loops=1)

  • Hash Cond: (tipoatendi2_.cd_tp_atendimento_agrupador = tipoatendi3_.cd_tp_atendimento)
24. 0.271 4.471 ↑ 1.0 360 1

Hash Join (cost=353.92..383.77 rows=360 width=1,542) (actual time=3.622..4.471 rows=360 loops=1)

  • Hash Cond: (naturezapr0_.cd_tp_atendimento = tipoatendi2_.cd_tp_atendimento)
25. 0.130 3.821 ↑ 1.0 360 1

Hash Right Join (cost=337.06..361.95 rows=360 width=1,097) (actual time=3.234..3.821 rows=360 loops=1)

  • Hash Cond: (tipoproced1_.cd_tp_procedimento = naturezapr0_.cd_tp_procedimento)
26. 0.068 3.527 ↑ 1.0 217 1

Hash Left Join (cost=321.32..342.75 rows=217 width=1,057) (actual time=3.052..3.527 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_grupo_ppi = ppigrupo25_.cd_grupo_ppi)
27. 0.153 3.458 ↑ 1.0 217 1

Hash Left Join (cost=301.87..322.48 rows=217 width=931) (actual time=3.043..3.458 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_procedimento = procedimen24_.cd_procedimento)
28. 0.083 1.302 ↑ 1.0 217 1

Hash Left Join (cost=112.35..129.98 rows=217 width=864) (actual time=0.994..1.302 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_tp_pro_cla = tipoproced20_.cd_tp_pro_cla)
29. 0.051 1.215 ↑ 1.0 217 1

Hash Left Join (cost=111.28..125.93 rows=217 width=778) (actual time=0.975..1.215 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_tp_exame_filtro = tipoexame19_.cd_tp_exame)
30. 0.079 1.147 ↑ 1.0 217 1

Hash Left Join (cost=109.32..123.13 rows=217 width=652) (actual time=0.951..1.147 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_exame_procedimento = exameproce16_.cd_exame_procedimento)
31. 0.120 0.150 ↑ 1.0 217 1

Hash Left Join (cost=1.07..14.06 rows=217 width=640) (actual time=0.015..0.150 rows=217 loops=1)

  • Hash Cond: (tipoproced1_.cd_regional = regionalsa12_.cd_regional)
32. 0.025 0.025 ↑ 1.0 217 1

Seq Scan on tipo_procedimento tipoproced1_ (cost=0.00..12.17 rows=217 width=514) (actual time=0.002..0.025 rows=217 loops=1)

33. 0.003 0.005 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=130) (actual time=0.005..0.005 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
34. 0.002 0.002 ↑ 1.0 3 1

Seq Scan on regional_saude regionalsa12_ (cost=0.00..1.03 rows=3 width=130) (actual time=0.001..0.002 rows=3 loops=1)

35. 0.446 0.918 ↑ 1.0 2,900 1

Hash (cost=72.00..72.00 rows=2,900 width=20) (actual time=0.918..0.918 rows=2,900 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 191kB
36. 0.472 0.472 ↑ 1.0 2,900 1

Seq Scan on exame_procedimento exameproce16_ (cost=0.00..72.00 rows=2,900 width=20) (actual time=0.004..0.472 rows=2,900 loops=1)

37. 0.012 0.017 ↑ 1.0 43 1

Hash (cost=1.43..1.43 rows=43 width=130) (actual time=0.017..0.017 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
38. 0.005 0.005 ↑ 1.0 43 1

Seq Scan on tipo_exame tipoexame19_ (cost=0.00..1.43 rows=43 width=130) (actual time=0.001..0.005 rows=43 loops=1)

39. 0.002 0.004 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=88) (actual time=0.004..0.004 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
40. 0.002 0.002 ↑ 1.0 3 1

Seq Scan on tipo_procedimento_cla tipoproced20_ (cost=0.00..1.03 rows=3 width=88) (actual time=0.001..0.002 rows=3 loops=1)

41. 1.089 2.003 ↑ 1.0 4,734 1

Hash (cost=130.34..130.34 rows=4,734 width=72) (actual time=2.003..2.003 rows=4,734 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 568kB
42. 0.914 0.914 ↑ 1.0 4,734 1

Seq Scan on procedimento procedimen24_ (cost=0.00..130.34 rows=4,734 width=72) (actual time=0.004..0.914 rows=4,734 loops=1)

43. 0.001 0.001 ↓ 0.0 0 1

Hash (cost=14.20..14.20 rows=420 width=130) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
44. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on ppi_grupo ppigrupo25_ (cost=0.00..14.20 rows=420 width=130) (actual time=0.000..0.000 rows=0 loops=1)

45. 0.054 0.164 ↑ 1.0 360 1

Hash (cost=11.24..11.24 rows=360 width=48) (actual time=0.164..0.164 rows=360 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 38kB
46. 0.110 0.110 ↑ 1.0 360 1

Seq Scan on natureza_procura_tp_atendimento naturezapr0_ (cost=0.00..11.24 rows=360 width=48) (actual time=0.007..0.110 rows=360 loops=1)

  • Filter: (cd_nat_procura = 118310)
  • Rows Removed by Filter: 139
47. 0.200 0.379 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=445) (actual time=0.379..0.379 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
48. 0.179 0.179 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi2_ (cost=0.00..11.94 rows=394 width=445) (actual time=0.004..0.179 rows=394 loops=1)

49. 0.075 0.138 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=50) (actual time=0.138..0.138 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
50. 0.063 0.063 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi3_ (cost=0.00..11.94 rows=394 width=50) (actual time=0.003..0.063 rows=394 loops=1)

51. 0.010 0.019 ↑ 1.0 40 1

Hash (cost=1.40..1.40 rows=40 width=130) (actual time=0.019..0.019 rows=40 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
52. 0.009 0.009 ↑ 1.0 40 1

Seq Scan on classificacao_atendimento classifica10_ (cost=0.00..1.40 rows=40 width=130) (actual time=0.003..0.009 rows=40 loops=1)

53. 0.074 0.132 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=50) (actual time=0.132..0.132 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
54. 0.058 0.058 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi11_ (cost=0.00..11.94 rows=394 width=50) (actual time=0.002..0.058 rows=394 loops=1)

55. 0.073 0.134 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=50) (actual time=0.134..0.134 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
56. 0.061 0.061 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi13_ (cost=0.00..11.94 rows=394 width=50) (actual time=0.001..0.061 rows=394 loops=1)

57. 0.069 0.131 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=50) (actual time=0.131..0.131 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 40kB
58. 0.062 0.062 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi17_ (cost=0.00..11.94 rows=394 width=50) (actual time=0.001..0.062 rows=394 loops=1)

59. 0.069 0.134 ↑ 1.0 394 1

Hash (cost=11.94..11.94 rows=394 width=50) (actual time=0.134..0.134 rows=394 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
60. 0.065 0.065 ↑ 1.0 394 1

Seq Scan on tipo_atendimento tipoatendi21_ (cost=0.00..11.94 rows=394 width=50) (actual time=0.001..0.065 rows=394 loops=1)

61. 0.015 0.033 ↑ 1.0 43 1

Hash (cost=1.43..1.43 rows=43 width=186) (actual time=0.033..0.033 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
62. 0.018 0.018 ↑ 1.0 43 1

Seq Scan on tipo_exame tipoexame4_ (cost=0.00..1.43 rows=43 width=186) (actual time=0.006..0.018 rows=43 loops=1)

  • Filter: (cd_tp_exame IS NOT NULL)
63. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pk_tipo_atendimento on tipo_atendimento tipoatendi22_ (cost=0.27..0.41 rows=1 width=50) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (tipoatendi2_.cd_tp_atendimento_alta = cd_tp_atendimento)
64. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_conduta on conduta conduta23_ (cost=0.14..0.19 rows=1 width=130) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (tipoatendi2_.cd_conduta = cd_conduta)
65. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pk_empresa on empresa empresa28_ (cost=0.28..1.32 rows=1 width=50) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (tipoatendi2_.empresa = empresa)
66. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_tipo_procedimento on tipo_procedimento tipoproced29_ (cost=0.27..0.43 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (tipoatendi2_.cd_tp_proc_transf = cd_tp_procedimento)
67. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_exame_procedimento on exame_procedimento exameproce5_ (cost=0.28..3.93 rows=1 width=99) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (tipoexame4_.cd_exame_procedimento = cd_exame_procedimento)
68. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_tipo_exame on tipo_exame tipoexame6_ (cost=0.14..0.16 rows=1 width=130) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (exameproce5_.cd_tp_exame = cd_tp_exame)
69. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_procedimento on procedimento procedimen7_ (cost=0.28..0.44 rows=1 width=72) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (exameproce5_.cd_procedimento = cd_procedimento)
70. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_exame_esus on exame_esus exameesus14_ (cost=0.14..0.16 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (exameproce5_.cd_exame_esus = cd_exame_esus)
71. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pk_formulario on formulario formulario15_ (cost=0.15..0.18 rows=1 width=44) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (exameproce5_.cd_formulario = cd_formulario)
72. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_ppi_grupo on ppi_grupo ppigrupo27_ (cost=0.15..0.18 rows=1 width=130) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (exameproce5_.cd_grupo_ppi = cd_grupo_ppi)
73. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_tipo_procedimento on tipo_procedimento tipoproced9_ (cost=0.27..1.59 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (tipoexame4_.cd_tp_procedimento = cd_tp_procedimento)
74. 0.000 0.000 ↓ 0.0 0 1

Index Scan using pk_ppi_grupo on ppi_grupo ppigrupo18_ (cost=0.15..1.19 rows=1 width=130) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (tipoexame4_.cd_grupo_ppi = cd_grupo_ppi)
75. 0.557 0.557 ↑ 1.0 1 1

Index Scan using pk_tp_mov_cta_financeira on tp_mov_cta_financeira tipomovime26_ (cost=0.13..0.43 rows=1 width=234) (actual time=0.556..0.557 rows=1 loops=1)

  • Index Cond: (tipoexame4_.cd_tp_mov_cta_financeira = cd_tp_mov_cta_financeira)
76. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on natureza_procura naturezapr8_ (cost=0.00..1.04 rows=1 width=234) (actual time=0.005..0.007 rows=1 loops=1)

  • Filter: (cd_nat_procura = 118310)
  • Rows Removed by Filter: 2
77. 0.023 0.356 ↓ 0.0 0 1

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

78. 0.325 0.325 ↑ 1.0 1 1

Index Scan using idx_nat_proc_tp_atendimento on natureza_procura_tp_atendimento naturezapr31_ (cost=0.27..0.38 rows=1 width=24) (actual time=0.325..0.325 rows=1 loops=1)

  • Index Cond: ((cd_nat_procura = 118310) AND (cd_tp_atendimento = tipoatendi2_.cd_tp_atendimento))
79. 0.008 0.008 ↓ 0.0 0 1

Index Scan using idx_emp_nat_proc_tp_atendimento on empresa_nat_proc_tp_atendimento empresanat30_ (cost=0.28..0.86 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((empresa = 7) AND (cd_nat_proc_tp_atendimento = naturezapr31_.cd_nat_proc_tp_atendimento))
  • Filter: (visivel = 'S'::bpchar)