explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1tRr

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 1.123 ↑ 3.0 1 1

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

  • Join Filter: (internacao0_.isn_internacao = internacao23_.isn_internacao)
2. 0.003 1.112 ↑ 3.0 1 1

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

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

Nested Loop Left Join (cost=73.66..157.61 rows=3 width=2,562) (actual time=0.834..1.106 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.099 ↑ 3.0 1 1

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

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

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

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

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

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

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

8. 0.005 0.234 ↑ 1.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
9. 0.001 0.229 ↑ 1.0 1 1

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

10. 0.003 0.228 ↑ 1.0 1 1

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

11. 0.001 0.221 ↑ 1.0 1 1

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

12. 0.002 0.220 ↑ 1.0 1 1

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

13. 0.000 0.218 ↑ 1.0 1 1

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

14. 0.002 0.214 ↑ 1.0 1 1

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

15. 0.002 0.212 ↑ 1.0 1 1

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

16. 0.001 0.208 ↑ 1.0 1 1

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

17. 0.003 0.207 ↑ 1.0 1 1

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

18. 0.049 0.192 ↑ 1.0 1 1

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

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

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

20. 0.004 0.126 ↑ 1.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 1kB
21. 0.000 0.122 ↑ 1.0 1 1

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

22. 0.002 0.118 ↑ 1.0 1 1

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

23. 0.002 0.105 ↑ 1.0 1 1

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

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

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

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

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

26. 0.004 0.083 ↑ 1.0 1 1

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

27. 0.034 0.078 ↑ 1.0 1 1

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

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

Seq Scan on t_especialidade especialid5_ (cost=0.00..6.53 rows=153 width=71) (actual time=0.004..0.022 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.001..0.004 rows=13 loops=1)

34. 0.006 0.006 ↑ 1.0 18 1

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

35. 0.011 0.011 ↑ 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.011..0.011 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.012 0.012 ↑ 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.012 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.002 0.002 ↑ 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.002..0.002 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.004 0.004 ↑ 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.004 rows=1 loops=1)

  • Index Cond: (paciente9_.isn_sexo = isn_sexo)
42. 0.000 0.000 ↓ 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.000..0.000 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.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

  • Index Cond: (internacao0_.isn_referencia = isn_referencia)
45. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=1)

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

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

47. 0.002 0.002 ↑ 1.0 7 1

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

48. 0.000 0.001 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=17) (actual time=0.001..0.001 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.000 0.001 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=12) (actual time=0.001..0.001 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.002 0.003 ↑ 1.0 5 1

Materialize (cost=0.00..1.07 rows=5 width=12) (actual time=0.001..0.003 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.000..0.001 rows=5 loops=1)

54. 0.001 0.009 ↓ 0.0 0 1

Materialize (cost=0.42..8.44 rows=1 width=936) (actual time=0.009..0.009 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.005 ms