explain.depesz.com

PostgreSQL's explain analyze made readable

Result: God6

Settings
# exclusive inclusive rows x rows loops node
1. 0.909 6.524 ↑ 181,122,623.8 303 1

Unique (cost=149,545,057,318.80..168,615,911,181.30 rows=54,880,155,000 width=1,247) (actual time=5.588..6.524 rows=303 loops=1)

2. 1.897 5.615 ↑ 181,122,623.8 303 1

Sort (cost=149,545,057,318.80..149,682,257,706.30 rows=54,880,155,000 width=1,247) (actual time=5.586..5.615 rows=303 loops=1)

  • Sort Key: monitorame0_.dt_medicao DESC, monitorame0_.id_monitoramento_descontinuo, pontoemiss1_.id_ponto_emissao, listaequip2_.id_equipamento_utilizado, listacombu3_.id_combustivel_equipamento_util
  • Sort Method: quicksort Memory: 332kB
3. 0.322 3.718 ↑ 181,122,623.8 303 1

Merge Right Join (cost=49.87..4,197,280.46 rows=54,880,155,000 width=1,247) (actual time=2.097..3.718 rows=303 loops=1)

  • Merge Cond: (analisedes12_.id_monitoramento_descontinuo = monitorame0_.id_monitoramento_descontinuo)
4. 0.086 0.086 ↑ 6.0 42 1

Index Scan using idx_tb_analise_descontinuo_id_monitoramento_descontinuo on tb_analise_descontinuo analisedes12_ (cost=0.14..17.09 rows=250 width=296) (actual time=0.013..0.086 rows=42 loops=1)

5. 0.477 3.310 ↑ 724,490.5 303 1

Materialize (cost=49.73..630,052.66 rows=219,520,620 width=879) (actual time=2.072..3.310 rows=303 loops=1)

6. 0.255 2.833 ↑ 724,490.5 303 1

Merge Left Join (cost=49.73..81,251.11 rows=219,520,620 width=879) (actual time=2.068..2.833 rows=303 loops=1)

  • Merge Cond: (monitorame0_.id_monitoramento_descontinuo = listaanali9_.id_monitoramento_descontinuo)
7. 0.131 2.514 ↑ 25,008.0 133 1

Merge Left Join (cost=49.59..1,348.70 rows=3,326,070 width=825) (actual time=2.048..2.514 rows=133 loops=1)

  • Merge Cond: (monitorame0_.id_monitoramento_descontinuo = listaponto10_.id_monitoramento_descontinuo)
8. 0.111 2.099 ↑ 671.9 75 1

Merge Left Join (cost=49.17..73.78 rows=50,395 width=767) (actual time=1.980..2.099 rows=75 loops=1)

  • Merge Cond: (monitorame0_.id_monitoramento_descontinuo = listamedic8_.id_monitoramento_descontinuo)
9. 0.089 1.793 ↑ 13.2 37 1

Sort (cost=39.32..40.54 rows=488 width=692) (actual time=1.789..1.793 rows=37 loops=1)

  • Sort Key: monitorame0_.id_monitoramento_descontinuo
  • Sort Method: quicksort Memory: 50kB
10. 0.045 1.704 ↑ 13.2 37 1

Hash Left Join (cost=9.77..17.53 rows=488 width=692) (actual time=0.248..1.704 rows=37 loops=1)

  • Hash Cond: (listametod6_.id_config_metodo = configmeto7_.id_config_metodo)
11. 0.055 1.586 ↑ 13.2 37 1

Hash Left Join (cost=4.28..10.72 rows=488 width=669) (actual time=0.166..1.586 rows=37 loops=1)

  • Hash Cond: (monitorame0_.id_monitoramento_descontinuo = listametod6_.id_monitoramento_descontinuo)
12. 0.121 1.490 ↓ 4.6 37 1

Nested Loop Left Join (cost=1.91..8.15 rows=8 width=657) (actual time=0.114..1.490 rows=37 loops=1)

  • Join Filter: (monitorame0_.id_monitoramento_descontinuo = listamedic5_.id_monitoramento_descontinuo)
  • Rows Removed by Join Filter: 737
13. 0.029 0.469 ↓ 30.0 30 1

Nested Loop Left Join (cost=0.56..6.25 rows=1 width=510) (actual time=0.046..0.469 rows=30 loops=1)

14. 0.021 0.380 ↓ 30.0 30 1

Nested Loop Left Join (cost=0.42..3.83 rows=1 width=398) (actual time=0.040..0.380 rows=30 loops=1)

15. 0.054 0.299 ↓ 30.0 30 1

Nested Loop Left Join (cost=0.29..3.62 rows=1 width=369) (actual time=0.034..0.299 rows=30 loops=1)

16. 0.061 0.185 ↓ 30.0 30 1

Nested Loop (cost=0.14..3.41 rows=1 width=257) (actual time=0.027..0.185 rows=30 loops=1)

17. 0.034 0.034 ↓ 30.0 30 1

Seq Scan on tb_monitoramento_descontinuo monitorame0_ (cost=0.00..1.01 rows=1 width=94) (actual time=0.014..0.034 rows=30 loops=1)

  • Filter: (id_declaracao = 68)
  • Rows Removed by Filter: 23
18. 0.090 0.090 ↑ 1.0 1 30

Index Scan using pk_tb_ponto_emissao on tb_ponto_emissao pontoemiss1_ (cost=0.14..2.36 rows=1 width=163) (actual time=0.003..0.003 rows=1 loops=30)

  • Index Cond: (id_ponto_emissao = monitorame0_.id_ponto_emissao)
19. 0.060 0.060 ↑ 1.0 1 30

Index Scan using idx_tb_equipamento_utilizado_id_ponto_emissao on tb_equipamento_utilizado listaequip2_ (cost=0.14..0.20 rows=1 width=112) (actual time=0.002..0.002 rows=1 loops=30)

  • Index Cond: (pontoemiss1_.id_ponto_emissao = id_ponto_emissao)
20. 0.060 0.060 ↓ 0.0 0 30

Index Scan using idx_tb_combustivel_equipamento_utilizado_id_equipamento_utiliza on tb_combustivel_equipamento_utilizado listacombu3_ (cost=0.13..0.20 rows=1 width=29) (actual time=0.001..0.002 rows=0 loops=30)

  • Index Cond: (listaequip2_.id_equipamento_utilizado = id_equipamento_utilizado)
21. 0.060 0.060 ↑ 1.0 1 30

Index Scan using pk_tb_equipamento_utilizado on tb_equipamento_utilizado equipament4_ (cost=0.14..2.36 rows=1 width=112) (actual time=0.002..0.002 rows=1 loops=30)

  • Index Cond: (monitorame0_.id_equipamento_utilizado = id_equipamento_utilizado)
22. 0.540 0.900 ↓ 3.1 25 30

Merge Right Join (cost=1.35..1.80 rows=8 width=147) (actual time=0.005..0.030 rows=25 loops=30)

  • Merge Cond: (listavalor13_.id_medicao_mpt = listamedic5_.id_medicao_mpt)
23. 0.270 0.270 ↑ 5.3 26 30

Index Scan using idx_tb_valor_medido_id_medicao_mpt on tb_valor_medido listavalor13_ (cost=0.14..6.53 rows=139 width=33) (actual time=0.003..0.009 rows=26 loops=30)

24. 0.077 0.090 ↓ 3.1 25 30

Sort (cost=1.20..1.22 rows=8 width=114) (actual time=0.001..0.003 rows=25 loops=30)

  • Sort Key: listamedic5_.id_medicao_mpt
  • Sort Method: quicksort Memory: 28kB
25. 0.013 0.013 ↓ 3.1 25 1

Seq Scan on tb_medicoes_mpt listamedic5_ (cost=0.00..1.08 rows=8 width=114) (actual time=0.006..0.013 rows=25 loops=1)

26. 0.019 0.041 ↓ 1.1 70 1

Hash (cost=1.61..1.61 rows=61 width=12) (actual time=0.041..0.041 rows=70 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
27. 0.022 0.022 ↓ 1.1 70 1

Seq Scan on tb_metodo listametod6_ (cost=0.00..1.61 rows=61 width=12) (actual time=0.006..0.022 rows=70 loops=1)

28. 0.036 0.073 ↓ 1.0 157 1

Hash (cost=3.55..3.55 rows=155 width=23) (actual time=0.073..0.073 rows=157 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
29. 0.037 0.037 ↓ 1.0 157 1

Seq Scan on tb_config_metodo configmeto7_ (cost=0.00..3.55 rows=155 width=23) (actual time=0.011..0.037 rows=157 loops=1)

30. 0.055 0.195 ↑ 1.2 87 1

Sort (cost=9.85..10.11 rows=103 width=75) (actual time=0.183..0.195 rows=87 loops=1)

  • Sort Key: listamedic8_.id_monitoramento_descontinuo
  • Sort Method: quicksort Memory: 41kB
31. 0.056 0.140 ↓ 1.2 120 1

Hash Right Join (cost=2.64..6.41 rows=103 width=75) (actual time=0.078..0.140 rows=120 loops=1)

  • Hash Cond: (listavalor14_.id_medicoes_gases_outro = listamedic8_.id_medicoes_gases_outro)
32. 0.019 0.019 ↓ 1.0 145 1

Seq Scan on tb_valor_medido listavalor14_ (cost=0.00..3.39 rows=139 width=33) (actual time=0.007..0.019 rows=145 loops=1)

33. 0.030 0.065 ↓ 1.2 86 1

Hash (cost=1.73..1.73 rows=73 width=42) (actual time=0.064..0.065 rows=86 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
34. 0.035 0.035 ↓ 1.2 86 1

Seq Scan on tb_medicoes_gases_outro listamedic8_ (cost=0.00..1.73 rows=73 width=42) (actual time=0.015..0.035 rows=86 loops=1)

35. 0.041 0.284 ↓ 2.3 150 1

Materialize (cost=0.42..40.40 rows=66 width=58) (actual time=0.019..0.284 rows=150 loops=1)

36. 0.040 0.243 ↑ 1.1 60 1

Nested Loop Left Join (cost=0.42..40.24 rows=66 width=58) (actual time=0.017..0.243 rows=60 loops=1)

37. 0.023 0.023 ↑ 1.1 60 1

Index Scan using idx_tb_ponto_parametro_id_monitoramento_descontinuo on tb_ponto_parametro listaponto10_ (cost=0.14..4.43 rows=66 width=12) (actual time=0.007..0.023 rows=60 loops=1)

38. 0.180 0.180 ↑ 1.0 1 60

Index Scan using tb_config_parametro on tb_parametro parametro11_ (cost=0.28..0.54 rows=1 width=46) (actual time=0.003..0.003 rows=1 loops=60)

  • Index Cond: (listaponto10_.id_parametro = id_parametro)
39. 0.039 0.064 ↓ 4.8 320 1

Materialize (cost=0.14..4.60 rows=66 width=54) (actual time=0.007..0.064 rows=320 loops=1)

40. 0.025 0.025 ↑ 1.1 60 1

Index Scan using idx_tb_analise_parametro_id_monitoramento_descontinuo on tb_analise_parametro listaanali9_ (cost=0.14..4.43 rows=66 width=54) (actual time=0.005..0.025 rows=60 loops=1)

Planning time : 54.382 ms
Execution time : 7.228 ms