explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jk5w

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 3,907.674 ↓ 6.0 6 1

Sort (cost=8,261.43..8,261.44 rows=1 width=129) (actual time=3,907.673..3,907.674 rows=6 loops=1)

  • Sort Key: v_1.cd_identificador
  • Sort Method: quicksort Memory: 26kB
  • Buffers: shared hit=1,175,432 read=141
2. 0.064 3,907.647 ↓ 6.0 6 1

Nested Loop (cost=413.33..8,261.42 rows=1 width=129) (actual time=1,039.587..3,907.647 rows=6 loops=1)

  • Buffers: shared hit=1,175,432 read=141
3. 11.992 3,907.529 ↓ 6.0 6 1

Nested Loop (cost=411.78..8,258.64 rows=1 width=121) (actual time=1,039.571..3,907.529 rows=6 loops=1)

  • Buffers: shared hit=1,175,392 read=141
4. 0.100 0.257 ↓ 16.0 16 1

Nested Loop (cost=0.57..22.03 rows=1 width=8) (actual time=0.035..0.257 rows=16 loops=1)

  • Buffers: shared hit=52
5. 0.045 0.045 ↓ 2.3 16 1

Index Only Scan using pk00_tb_filial_veiculo on tb_filial_veiculo b (cost=0.29..2.81 rows=7 width=4) (actual time=0.021..0.045 rows=16 loops=1)

  • Index Cond: (b.id_filial = 1,526)
  • Heap Fetches: 9
  • Buffers: shared hit=4
6. 0.112 0.112 ↑ 1.0 1 16

Index Scan using pk00_tb_veiculo on tb_veiculo v (cost=0.29..2.71 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=16)

  • Index Cond: ((v.id_veiculo)::integer = (b.id_veiculo)::integer)
  • Filter: (v.rotulos && '{3589}'::integer[])
  • Buffers: shared hit=48
7. 2,016.242 3,895.280 ↓ 4.1 3,035 16

Hash Join (cost=411.21..8,220.12 rows=733 width=113) (actual time=0.341..243.455 rows=3,035 loops=16)

  • Buffers: shared hit=1,175,340 read=141
8. 75.696 1,879.024 ↓ 4.1 3,035 16

Nested Loop (cost=409.65..7,637.25 rows=733 width=112) (actual time=0.267..117.439 rows=3,035 loops=16)

  • Buffers: shared hit=1,039,707 read=141
9. 16.949 1,657.648 ↓ 4.1 3,035 16

Hash Join (cost=409.21..5,995.31 rows=733 width=112) (actual time=0.261..103.603 rows=3,035 loops=16)

  • Buffers: shared hit=868,987 read=141
10. 64.880 1,640.688 ↓ 4.1 3,035 16

Nested Loop (cost=407.76..5,991.53 rows=733 width=97) (actual time=0.259..102.543 rows=3,035 loops=16)

  • Buffers: shared hit=868,986 read=141
11. 43.840 1,575.808 ↓ 4.1 3,035 16

Nested Loop (cost=407.34..4,803.5 rows=733 width=97) (actual time=0.258..98.488 rows=3,035 loops=16)

  • Buffers: shared hit=862,202 read=141
12. 70.896 1,143.488 ↓ 4.1 3,035 16

Nested Loop (cost=406.91..1,700.12 rows=733 width=99) (actual time=0.25..71.468 rows=3,035 loops=16)

  • Buffers: shared hit=563,180 read=139
13. 29.706 229.008 ↓ 10.5 3,766 16

Hash Join (cost=405.42..733.5 rows=358 width=33) (actual time=0.145..14.313 rows=3,766 loops=16)

  • Buffers: shared hit=100,163
14. 55.616 197.904 ↓ 6.9 3,766 16

Merge Join (cost=0.57..323.02 rows=546 width=33) (actual time=0.056..12.369 rows=3,766 loops=16)

  • Buffers: shared hit=99,376
15. 75.744 75.744 ↓ 2.6 3,766 16

Index Scan using ix03f_tb_veiculo on tb_veiculo v_1 (cost=0.29..337.94 rows=1,465 width=33) (actual time=0.028..4.734 rows=3,766 loops=16)

  • Index Cond: (v_1.id_equipamento IS NOT NULL)
  • Filter: v_1.vf_ativo
  • Buffers: shared hit=31,152
16. 66.544 66.544 ↓ 1.0 6,012 16

Index Scan using pk_id_equipamento on tb_equipamentos eq (cost=0.28..175.53 rows=5,816 width=8) (actual time=0.025..4.159 rows=6,012 loops=16)

  • Buffers: shared hit=68,224
17. 0.050 1.398 ↓ 1.0 261 1

Hash (cost=401.6..401.6 rows=260 width=4) (actual time=1.398..1.398 rows=261 loops=1)

  • Buffers: shared hit=787
18. 0.071 1.348 ↓ 1.0 261 1

Hash Join (cost=1.89..401.6 rows=260 width=4) (actual time=0.031..1.348 rows=261 loops=1)

  • Buffers: shared hit=787
19. 0.185 1.265 ↓ 1.0 261 1

Nested Loop (cost=0.28..399.2 rows=260 width=7) (actual time=0.015..1.265 rows=261 loops=1)

  • Buffers: shared hit=786
20. 0.032 0.032 ↓ 1.0 262 1

Seq Scan on tb_filial f (cost=0..5.6 rows=260 width=12) (actual time=0.004..0.032 rows=262 loops=1)

  • Buffers: shared hit=3
21. 1.048 1.048 ↑ 1.0 1 262

Index Scan using municipios_cod_ibge_key on municipios m (cost=0.28..1.51 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=262)

  • Index Cond: ((m.cod_ibge)::text = (f.cod_ibge_mun)::text)
  • Buffers: shared hit=783
22. 0.007 0.012 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=3) (actual time=0.011..0.012 rows=27 loops=1)

  • Buffers: shared hit=1
23. 0.005 0.005 ↑ 1.0 27 1

Seq Scan on tb_uf uf (cost=0..1.27 rows=27 width=3) (actual time=0.002..0.005 rows=27 loops=1)

  • Buffers: shared hit=1
24. 602.560 843.584 ↑ 1.0 1 60,256

Bitmap Heap Scan on tb_veiculo_situacao vs_1 (cost=1.49..2.7 rows=1 width=70) (actual time=0.014..0.014 rows=1 loops=60,256)

  • Heap Blocks: exact=255,588
  • Buffers: shared hit=463,017 read=139
25. 241.024 241.024 ↓ 4.0 4 60,256

Bitmap Index Scan on pk00_tb_veiculo_situacao (cost=0..1.49 rows=1 width=0) (actual time=0.004..0.004 rows=4 loops=60,256)

  • Index Cond: ((vs_1.id_veiculo)::integer = (v_1.id_veiculo)::integer)
  • Buffers: shared hit=207,568
26. 97.120 388.480 ↑ 2.0 1 48,560

Append (cost=0.43..4.21 rows=2 width=6) (actual time=0.005..0.008 rows=1 loops=48,560)

  • Buffers: shared hit=299,022 read=2
27. 194.240 194.240 ↑ 1.0 1 48,560

Index Scan using pk00_tb_trecho_viagem on tb_trecho_viagem tv (cost=0.43..1.72 rows=1 width=6) (actual time=0.004..0.004 rows=1 loops=48,560)

  • Index Cond: ((vs_1.id_trecho_viagem)::integer = (tv.id_trecho_viagem)::integer)
  • Buffers: shared hit=170,686 read=2
28. 97.120 97.120 ↓ 0.0 0 48,560

Index Scan using pk00_tbtrechoviagemu20191111 on tb_trecho_viagem_clust_until_20191111 tv_1 (cost=0.43..2.48 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=48,560)

  • Index Cond: ((vs_1.id_trecho_viagem)::integer = (tv_1.id_trecho_viagem)::integer)
  • Buffers: shared hit=128,336
29. 0.000 0.000 ↓ 0.0 0 48,560

Index Scan using pk00_tb_ocorrencia on tb_ocorrencia oc (cost=0.43..1.62 rows=1 width=8) (actual time=0..0 rows=0 loops=48,560)

  • Index Cond: ((vs_1.id_ocorrencia)::integer = (oc.id_ocorrencia)::integer)
  • Buffers: shared hit=6,784
30. 0.006 0.011 ↑ 1.0 20 1

Hash (cost=1.2..1.2 rows=20 width=23) (actual time=0.011..0.011 rows=20 loops=1)

  • Buffers: shared hit=1
31. 0.005 0.005 ↑ 1.0 20 1

Seq Scan on tb_modelo_ocorrencia mo (cost=0..1.2 rows=20 width=23) (actual time=0.003..0.005 rows=20 loops=1)

  • Buffers: shared hit=1
32. 145.680 145.680 ↑ 1.0 1 48,560

Index Scan using pk00_tb_rd on tb_rd rd (cost=0.43..2.24 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=48,560)

  • Index Cond: ((vs_1.id_rd)::integer = (rd.id_rd)::integer)
  • Buffers: shared hit=170,720
33. 0.009 0.014 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=6) (actual time=0.014..0.014 rows=25 loops=1)

  • Buffers: shared hit=1
34. 0.005 0.005 ↑ 1.0 25 1

Seq Scan on tb_modelo_coleta mc (cost=0..1.25 rows=25 width=6) (actual time=0.002..0.005 rows=25 loops=1)

  • Buffers: shared hit=1
35. 0.036 0.054 ↑ 1.0 1 6

Bitmap Heap Scan on tb_veiculo_situacao vs (cost=1.55..2.76 rows=1 width=8) (actual time=0.009..0.009 rows=1 loops=6)

  • Heap Blocks: exact=17
  • Buffers: shared hit=40
36. 0.018 0.018 ↓ 3.0 3 6

Bitmap Index Scan on pk00_tb_veiculo_situacao (cost=0..1.55 rows=1 width=0) (actual time=0.003..0.003 rows=3 loops=6)

  • Index Cond: ((vs.id_veiculo)::integer = (v_1.id_veiculo)::integer)
  • Buffers: shared hit=23
Planning time : 3.04 ms
Execution time : 3,908.93 ms