explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HvO4

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 1.220 ↑ 3.0 1 1

Nested Loop Left Join (cost=74.08..167.39 rows=3 width=3,510) (actual time=0.938..1.220 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_internacao = internacao23_.isn_internacao)
2. 0.004 1.204 ↑ 3.0 1 1

Nested Loop Left Join (cost=73.66..158.90 rows=3 width=2,574) (actual time=0.922..1.204 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_tipo_telefone_2 = tipotelefo22_.isn_tipo_telefone)
  • Rows Removed by Join Filter: 4
3. 0.004 1.196 ↑ 3.0 1 1

Nested Loop Left Join (cost=73.66..157.61 rows=3 width=2,562) (actual time=0.916..1.196 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_tipo_telefone_1 = tipotelefo21_.isn_tipo_telefone)
  • Rows Removed by Join Filter: 4
4. 0.005 1.187 ↑ 3.0 1 1

Nested Loop Left Join (cost=73.66..156.33 rows=3 width=2,550) (actual time=0.909..1.187 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_tipo_atendimento = tipoatendi20_.isn_tipo_atendimento)
  • Rows Removed by Join Filter: 4
5. 0.006 1.175 ↑ 3.0 1 1

Nested Loop Left Join (cost=73.66..155.04 rows=3 width=2,533) (actual time=0.900..1.175 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_situacao_familiar = situacaofa19_.isn_situacao_familiar)
  • Rows Removed by Join Filter: 6
6. 0.556 1.160 ↑ 3.0 1 1

Hash Right Join (cost=73.66..153.64 rows=3 width=2,484) (actual time=0.888..1.160 rows=1 loops=1)

  • Hash Cond: ((usuario16_.isn_usuario)::numeric = internacao0_.isn_profissional)
7. 0.332 0.332 ↑ 1.0 1,976 1

Seq Scan on t_usuario usuario16_ (cost=0.00..69.63 rows=2,063 width=172) (actual time=0.004..0.332 rows=1,976 loops=1)

8. 0.007 0.272 ↑ 1.0 1 1

Hash (cost=73.65..73.65 rows=1 width=2,312) (actual time=0.272..0.272 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
9. 0.000 0.265 ↑ 1.0 1 1

Nested Loop Left Join (cost=44.89..73.65 rows=1 width=2,312) (actual time=0.215..0.265 rows=1 loops=1)

10. 0.003 0.264 ↑ 1.0 1 1

Nested Loop Left Join (cost=44.61..65.35 rows=1 width=2,276) (actual time=0.214..0.264 rows=1 loops=1)

11. 0.004 0.256 ↑ 1.0 1 1

Nested Loop Left Join (cost=44.34..57.05 rows=1 width=2,240) (actual time=0.206..0.256 rows=1 loops=1)

12. 0.000 0.252 ↑ 1.0 1 1

Nested Loop Left Join (cost=44.20..56.88 rows=1 width=2,222) (actual time=0.203..0.252 rows=1 loops=1)

13. 0.003 0.251 ↑ 1.0 1 1

Nested Loop Left Join (cost=44.07..56.72 rows=1 width=2,204) (actual time=0.202..0.251 rows=1 loops=1)

14. 0.002 0.245 ↑ 1.0 1 1

Nested Loop Left Join (cost=43.94..56.56 rows=1 width=2,185) (actual time=0.196..0.245 rows=1 loops=1)

15. 0.007 0.243 ↑ 1.0 1 1

Nested Loop Left Join (cost=43.81..56.41 rows=1 width=2,172) (actual time=0.194..0.243 rows=1 loops=1)

16. 0.002 0.232 ↑ 1.0 1 1

Nested Loop Left Join (cost=43.68..56.25 rows=1 width=2,157) (actual time=0.184..0.232 rows=1 loops=1)

17. 0.004 0.230 ↑ 1.0 1 1

Nested Loop Left Join (cost=43.55..56.09 rows=1 width=2,142) (actual time=0.182..0.230 rows=1 loops=1)

18. 0.052 0.215 ↑ 1.0 1 1

Hash Right Join (cost=43.13..47.64 rows=1 width=1,937) (actual time=0.167..0.215 rows=1 loops=1)

  • Hash Cond: (ocupacao8_.isn_ocupacao = internacao0_.isn_ocupacao)
19. 0.023 0.023 ↑ 1.0 182 1

Seq Scan on t_ocupacao ocupacao8_ (cost=0.00..3.82 rows=182 width=20) (actual time=0.003..0.023 rows=182 loops=1)

20. 0.008 0.140 ↑ 1.0 1 1

Hash (cost=43.12..43.12 rows=1 width=1,917) (actual time=0.140..0.140 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
21. 0.003 0.132 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.15..43.12 rows=1 width=1,917) (actual time=0.121..0.132 rows=1 loops=1)

22. 0.005 0.125 ↑ 1.0 1 1

Nested Loop Left Join (cost=9.02..42.91 rows=1 width=1,899) (actual time=0.115..0.125 rows=1 loops=1)

23. 0.003 0.115 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.74..34.61 rows=1 width=1,871) (actual time=0.105..0.115 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_especialidade = especialid4_.isn_especialidade)
  • Rows Removed by Join Filter: 18
24. 0.011 0.107 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.74..33.21 rows=1 width=1,852) (actual time=0.097..0.107 rows=1 loops=1)

  • Join Filter: (internacao0_.isn_escolaridade = escolarida3_.isn_escolaridade)
  • Rows Removed by Join Filter: 12
25. 0.003 0.092 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.74..31.91 rows=1 width=1,827) (actual time=0.088..0.092 rows=1 loops=1)

26. 0.002 0.089 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.60..23.74 rows=1 width=1,387) (actual time=0.086..0.089 rows=1 loops=1)

27. 0.037 0.086 ↑ 1.0 1 1

Hash Right Join (cost=8.45..15.57 rows=1 width=1,187) (actual time=0.083..0.086 rows=1 loops=1)

  • Hash Cond: (especialid5_.isn_especialidade = internacao0_.isn_especialidade_perfil)
28. 0.027 0.027 ↓ 1.1 170 1

Seq Scan on t_especialidade especialid5_ (cost=0.00..6.53 rows=153 width=71) (actual time=0.004..0.027 rows=170 loops=1)

29. 0.004 0.022 ↑ 1.0 1 1

Hash (cost=8.44..8.44 rows=1 width=1,116) (actual time=0.022..0.022 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
30. 0.018 0.018 ↑ 1.0 1 1

Index Scan using internacao_fk11 on t_internacao internacao0_ (cost=0.42..8.44 rows=1 width=1,116) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (isn_internacao = 424::numeric)
31. 0.001 0.001 ↓ 0.0 0 1

Index Scan using pk_t_classificacao_internacao on t_classificacao_internacao classifica1_ (cost=0.15..8.17 rows=1 width=200) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (internacao0_.isn_classificacao_internacao = isn_classificacao_internacao)
32. 0.000 0.000 ↓ 0.0 0 1

Index Scan using t_emergencia_unidade_pkey on t_emergencia_unidade emergencia2_ (cost=0.14..8.16 rows=1 width=440) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (internacao0_.isn_emergencia_unidade = isn_emergencia_unidade)
33. 0.004 0.004 ↑ 1.0 13 1

Seq Scan on t_escolaridade escolarida3_ (cost=0.00..1.13 rows=13 width=25) (actual time=0.002..0.004 rows=13 loops=1)

34. 0.005 0.005 ↑ 1.0 18 1

Seq Scan on t_especialidade especialid4_ (cost=0.00..1.18 rows=18 width=19) (actual time=0.002..0.005 rows=18 loops=1)

35. 0.005 0.005 ↑ 1.0 1 1

Index Scan using municipio_pk on t_municipio municipio6_ (cost=0.27..8.29 rows=1 width=28) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (internacao0_.isn_municipio = isn_municipio)
36. 0.004 0.004 ↑ 1.0 1 1

Index Scan using uf_pk on t_uf uf7_ (cost=0.14..0.20 rows=1 width=18) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (municipio6_.isn_uf = isn_uf)
37. 0.011 0.011 ↑ 1.0 1 1

Index Scan using t_paciente_isn_paciente_idx on t_paciente paciente9_ (cost=0.42..8.44 rows=1 width=205) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (internacao0_.isn_paciente = isn_paciente)
38. 0.000 0.000 ↓ 0.0 0 1

Index Scan using tipo_certidao_pk on t_tipo_certidao tipocertid10_ (cost=0.13..0.15 rows=1 width=15) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (paciente9_.isn_tipo_certidao = isn_tipo_certidao)
39. 0.004 0.004 ↑ 1.0 1 1

Index Scan using cor_pk on t_cor cor11_ (cost=0.13..0.15 rows=1 width=15) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (paciente9_.isn_cor = isn_cor)
40. 0.000 0.000 ↓ 0.0 0 1

Index Scan using nacionalidade_pk on t_nacionalidade nacionalid12_ (cost=0.13..0.15 rows=1 width=13) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (paciente9_.isn_nacionalidade = isn_nacionalidade)
41. 0.003 0.003 ↑ 1.0 1 1

Index Scan using sexo_pk on t_sexo sexo13_ (cost=0.13..0.15 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=1)

  • Index Cond: (paciente9_.isn_sexo = isn_sexo)
42. 0.001 0.001 ↓ 0.0 0 1

Index Scan using uf_pk on t_uf uf14_ (cost=0.14..0.16 rows=1 width=18) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (paciente9_.isn_uf_emissao_rg = isn_uf)
43. 0.000 0.000 ↓ 0.0 0 1

Index Scan using uf_pk on t_uf uf15_ (cost=0.14..0.16 rows=1 width=18) (actual time=0.000..0.000 rows=0 loops=1)

  • Index Cond: (paciente9_.isn_uf_naturalidade = isn_uf)
44. 0.005 0.005 ↑ 1.0 1 1

Index Scan using sys_c0022913 on t_referencia referencia17_ (cost=0.27..8.29 rows=1 width=36) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (internacao0_.isn_referencia = isn_referencia)
45. 0.001 0.001 ↓ 0.0 0 1

Index Scan using sys_c0022913 on t_referencia referencia18_ (cost=0.27..8.29 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (internacao0_.isn_referencia_perfil = isn_referencia)
46. 0.006 0.009 ↑ 1.0 7 1

Materialize (cost=0.00..1.10 rows=7 width=49) (actual time=0.006..0.009 rows=7 loops=1)

47. 0.003 0.003 ↑ 1.0 7 1

Seq Scan on t_situacao_familiar situacaofa19_ (cost=0.00..1.07 rows=7 width=49) (actual time=0.002..0.003 rows=7 loops=1)

48. 0.006 0.007 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=17) (actual time=0.004..0.007 rows=5 loops=1)

49. 0.001 0.001 ↑ 1.0 5 1

Seq Scan on t_tipo_atendimento tipoatendi20_ (cost=0.00..1.05 rows=5 width=17) (actual time=0.001..0.001 rows=5 loops=1)

50. 0.004 0.005 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=12) (actual time=0.003..0.005 rows=5 loops=1)

51. 0.001 0.001 ↑ 1.0 5 1

Seq Scan on t_tipo_telefone tipotelefo21_ (cost=0.00..1.05 rows=5 width=12) (actual time=0.001..0.001 rows=5 loops=1)

52. 0.003 0.004 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=12) (actual time=0.003..0.004 rows=5 loops=1)

53. 0.001 0.001 ↑ 1.0 5 1

Seq Scan on t_tipo_telefone tipotelefo22_ (cost=0.00..1.05 rows=5 width=12) (actual time=0.001..0.001 rows=5 loops=1)

54. 0.005 0.013 ↓ 0.0 0 1

Materialize (cost=0.42..8.44 rows=1 width=936) (actual time=0.013..0.013 rows=0 loops=1)

55. 0.008 0.008 ↓ 0.0 0 1

Index Scan using internacao_isn_idx1 on t_internacao_atendimento internacao23_ (cost=0.42..8.44 rows=1 width=936) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (isn_internacao = 424::numeric)
Total runtime : 2.737 ms