explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m3tX : evai gay

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 7,233.743 ↑ 1.0 10 1

Limit (cost=28,899,943,580,014.62..28,899,943,580,015.68 rows=10 width=1,961) (actual time=7,233.682..7,233.743 rows=10 loops=1)

2.          

CTE veiculo

3. 66.087 169.596 ↑ 13.5 10,824 1

Hash Join (cost=8,034.52..13,659.32 rows=146,506 width=530) (actual time=152.905..169.596 rows=10,824 loops=1)

  • Hash Cond: (vtra_veiculo_transportador_1.vtra_veic_oras_codigo = veic_veiculo_1.veic_oras_codigo)
4. 13.612 91.751 ↑ 13.5 10,824 1

HashAggregate (cost=6,018.66..7,483.72 rows=146,506 width=4) (actual time=87.880..91.751 rows=10,824 loops=1)

  • Group Key: vtra_veiculo_transportador_1.vtra_veic_oras_codigo
5. 2.756 78.139 ↑ 3.8 38,873 1

Append (cost=1,618.38..5,652.39 rows=146,506 width=4) (actual time=26.376..78.139 rows=38,873 loops=1)

6. 6.710 53.233 ↑ 4.3 32,513 1

Hash Join (cost=1,618.38..2,457.88 rows=140,046 width=4) (actual time=26.374..53.233 rows=32,513 loops=1)

  • Hash Cond: (vtra_veiculo_transportador_1.vtra_tran_pess_oras_codigo = pess_pessoa_12.pess_oras_codigo)
7. 20.249 20.249 ↓ 1.0 39,312 1

Index Only Scan using vtra_veiculo_transpo_idx_70510 on vtra_veiculo_transportador vtra_veiculo_transportador_1 (cost=0.29..737.39 rows=38,940 width=8) (actual time=0.032..20.249 rows=39,312 loops=1)

  • Heap Fetches: 37314
8. 1.531 26.274 ↓ 1.0 8,855 1

Hash (cost=1,509.25..1,509.25 rows=8,707 width=4) (actual time=26.274..26.274 rows=8,855 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 440kB
9. 4.866 24.743 ↓ 1.0 8,855 1

HashAggregate (cost=1,335.11..1,422.18 rows=8,707 width=4) (actual time=23.323..24.743 rows=8,855 loops=1)

  • Group Key: pess_pessoa_12.pess_oras_codigo
10. 0.759 19.877 ↓ 1.0 8,869 1

Append (cost=0.57..1,313.35 rows=8,707 width=4) (actual time=0.041..19.877 rows=8,869 loops=1)

11. 0.002 0.041 ↑ 1.0 1 1

Nested Loop (cost=0.57..2.61 rows=1 width=4) (actual time=0.040..0.041 rows=1 loops=1)

12. 0.022 0.022 ↑ 1.0 1 1

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_12 (cost=0.29..1.31 rows=1 width=4) (actual time=0.022..0.022 rows=1 loops=1)

  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
13. 0.017 0.017 ↑ 1.0 1 1

Index Only Scan using tran_transportador_pkey on tran_transportador tran_transportador_8 (cost=0.28..1.30 rows=1 width=4) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
14. 0.087 1.353 ↑ 1.4 127 1

Nested Loop (cost=0.29..457.30 rows=177 width=4) (actual time=0.243..1.353 rows=127 loops=1)

15. 0.885 0.885 ↑ 1.4 127 1

Seq Scan on tran_transportador tran_transportador_9 (cost=0.00..296.31 rows=177 width=4) (actual time=0.222..0.885 rows=127 loops=1)

  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
16. 0.381 0.381 ↑ 1.0 1 127

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_13 (cost=0.29..0.91 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=127)

  • Index Cond: (pess_oras_codigo = tran_transportador_9.tran_pess_oras_codigo)
  • Heap Fetches: 126
17. 4.795 17.724 ↓ 1.0 8,741 1

Merge Join (cost=0.65..766.36 rows=8,529 width=4) (actual time=0.062..17.724 rows=8,741 loops=1)

  • Merge Cond: (pess_pessoa_14.pess_oras_codigo = temb_transportador_embarcador_4.temb_emba_pjur_pess_oras_codigo)
18. 10.970 10.970 ↓ 1.0 19,699 1

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_14 (cost=0.29..424.14 rows=19,390 width=4) (actual time=0.023..10.970 rows=19,699 loops=1)

  • Heap Fetches: 18486
19. 1.959 1.959 ↓ 1.0 8,741 1

Index Only Scan using temb_emba_tran_tvco_idx on temb_transportador_embarcador temb_transportador_embarcador_4 (cost=0.29..188.81 rows=8,529 width=4) (actual time=0.027..1.959 rows=8,741 loops=1)

  • Index Cond: (temb_tran_pess_oras_codigo = 11)
  • Heap Fetches: 302
20. 0.650 19.118 ↑ 43.7 3 1

Hash Join (cost=1,336.18..1,544.28 rows=131 width=4) (actual time=17.427..19.118 rows=3 loops=1)

  • Hash Cond: (pess_pessoa_15.pess_oras_codigo = vemb_veiculo_embarcador_1.vemb_emba_pjur_pess_oras_codigo)
21. 3.694 18.456 ↓ 1.0 8,855 1

HashAggregate (cost=1,335.11..1,422.18 rows=8,707 width=4) (actual time=17.299..18.456 rows=8,855 loops=1)

  • Group Key: pess_pessoa_15.pess_oras_codigo
22. 0.594 14.762 ↓ 1.0 8,869 1

Append (cost=0.57..1,313.35 rows=8,707 width=4) (actual time=0.026..14.762 rows=8,869 loops=1)

23. 0.002 0.027 ↑ 1.0 1 1

Nested Loop (cost=0.57..2.61 rows=1 width=4) (actual time=0.026..0.027 rows=1 loops=1)

24. 0.015 0.015 ↑ 1.0 1 1

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_15 (cost=0.29..1.31 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=1)

  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
25. 0.010 0.010 ↑ 1.0 1 1

Index Only Scan using tran_transportador_pkey on tran_transportador tran_transportador_10 (cost=0.28..1.30 rows=1 width=4) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
26. 0.088 1.073 ↑ 1.4 127 1

Nested Loop (cost=0.29..457.30 rows=177 width=4) (actual time=0.163..1.073 rows=127 loops=1)

27. 0.731 0.731 ↑ 1.4 127 1

Seq Scan on tran_transportador tran_transportador_11 (cost=0.00..296.31 rows=177 width=4) (actual time=0.151..0.731 rows=127 loops=1)

  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
28. 0.254 0.254 ↑ 1.0 1 127

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_16 (cost=0.29..0.91 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=127)

  • Index Cond: (pess_oras_codigo = tran_transportador_11.tran_pess_oras_codigo)
  • Heap Fetches: 126
29. 3.570 13.068 ↓ 1.0 8,741 1

Merge Join (cost=0.65..766.36 rows=8,529 width=4) (actual time=0.040..13.068 rows=8,741 loops=1)

  • Merge Cond: (pess_pessoa_17.pess_oras_codigo = temb_transportador_embarcador_5.temb_emba_pjur_pess_oras_codigo)
30. 7.960 7.960 ↓ 1.0 19,699 1

Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_17 (cost=0.29..424.14 rows=19,390 width=4) (actual time=0.017..7.960 rows=19,699 loops=1)

  • Heap Fetches: 18486
31. 1.538 1.538 ↓ 1.0 8,741 1

Index Only Scan using temb_emba_tran_tvco_idx on temb_transportador_embarcador temb_transportador_embarcador_5 (cost=0.29..188.81 rows=8,529 width=4) (actual time=0.016..1.538 rows=8,741 loops=1)

  • Index Cond: (temb_tran_pess_oras_codigo = 11)
  • Heap Fetches: 302
32. 0.002 0.012 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=8) (actual time=0.012..0.012 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
33. 0.010 0.010 ↑ 1.0 3 1

Seq Scan on vemb_veiculo_embarcador vemb_veiculo_embarcador_1 (cost=0.00..1.03 rows=3 width=8) (actual time=0.009..0.010 rows=3 loops=1)

34. 0.000 0.014 ↓ 0.0 0 1

Nested Loop (cost=0.58..62.27 rows=21 width=4) (actual time=0.014..0.014 rows=0 loops=1)

35. 0.014 0.014 ↓ 0.0 0 1

Index Scan using beg_viag_viagem_viag_emba_pjur_pess_oras_codigo_i on viag_viagem viag_viagem_2 (cost=0.29..15.52 rows=14 width=4) (actual time=0.014..0.014 rows=0 loops=1)

  • Index Cond: (viag_emba_pjur_pess_oras_codigo = 11)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using beg_vvei_viagem_veiculo_vvei_viag_codigo_i on vvei_viagem_veiculo vvei_viagem_veiculo_1 (cost=0.29..3.32 rows=2 width=8) (never executed)

  • Index Cond: (vvei_viag_codigo = viag_viagem_2.viag_codigo)
37. 3.018 3.018 ↓ 1.0 6,357 1

Index Only Scan using vcca_veiculo_cavalo__idx_70524 on vcca_veiculo_cavalo_carreta vcca_veiculo_cavalo_carreta_1 (cost=0.28..122.90 rows=6,308 width=4) (actual time=0.014..3.018 rows=6,357 loops=1)

  • Heap Fetches: 5368
38. 8.439 11.758 ↓ 1.0 17,026 1

Hash (cost=639.16..639.16 rows=17,016 width=530) (actual time=11.758..11.758 rows=17,026 loops=1)

  • Buckets: 16384 Batches: 2 Memory Usage: 1618kB
39. 3.319 3.319 ↓ 1.0 17,026 1

Seq Scan on veic_veiculo veic_veiculo_1 (cost=0.00..639.16 rows=17,016 width=530) (actual time=0.011..3.319 rows=17,026 loops=1)

40. 0.052 7,233.741 ↑ 96,704,814,985.3 10 1

Unique (cost=28,899,943,566,355.31..29,001,483,622,089.88 rows=967,048,149,853 width=1,961) (actual time=7,233.681..7,233.741 rows=10 loops=1)

41. 743.262 7,233.689 ↑ 34,537,433,923.3 28 1

Sort (cost=28,899,943,566,355.31..28,902,361,186,729.94 rows=967,048,149,853 width=1,961) (actual time=7,233.679..7,233.689 rows=28 loops=1)

  • Sort Key: veic_p.veic_placa DESC, veic_p.veic_oras_codigo, viag.viag_codigo, tvei_tipo_veiculo.tvei_descricao, veic_p.veic_frota, veic_p.veic_observacao, upos_ultima_posicao.upos_ignicao, upos_ultima_posicao.upos_velocidade, upos_ultima_posic (...)
  • Sort Method: external merge Disk: 5792kB
42. 147.616 6,490.427 ↑ 75,087,207.8 12,879 1

Hash Left Join (cost=93,759,921.10..25,415,310,444,071.83 rows=967,048,149,853 width=1,961) (actual time=3,469.712..6,490.427 rows=12,879 loops=1)

  • Hash Cond: (mvel.mvel_moto_pfis_pess_oras_codigo = moto_veic.pess_oras_codigo)
43. 13.542 5,833.220 ↑ 75,087,207.8 12,879 1

Hash Left Join (cost=93,759,153.82..3,772,504,547,987.79 rows=967,048,149,853 width=1,961) (actual time=3,462.089..5,833.220 rows=12,879 loops=1)

  • Hash Cond: (mvel.mvel_moto_pfis_pess_oras_codigo = pfmotoveic.pfis_pess_oras_codigo)
44. 15.864 5,813.601 ↑ 75,087,207.8 12,879 1

Hash Left Join (cost=93,758,883.97..3,769,964,661,002.58 rows=967,048,149,853 width=1,949) (actual time=3,455.965..5,813.601 rows=12,879 loops=1)

  • Hash Cond: (veic_p.veic_oras_codigo = mvel.mvel_veic_oras_codigo)
45. 12.886 5,795.904 ↑ 75,509,342.5 12,807 1

Hash Left Join (cost=93,758,693.18..3,754,880,484,567.80 rows=967,048,149,853 width=1,945) (actual time=3,454.081..5,795.904 rows=12,807 loops=1)

  • Hash Cond: (pfmotoviag.pfis_pess_oras_codigo = moto_viag.pess_oras_codigo)
46. 15.033 5,775.570 ↑ 75,509,342.5 12,807 1

Hash Left Join (cost=93,757,925.91..3,752,341,427,563.91 rows=967,048,149,853 width=1,919) (actual time=3,446.484..5,775.570 rows=12,807 loops=1)

  • Hash Cond: (vmoo.vmoo_moto_pfis_pess_oras_codigo = pfmotoviag.pfis_pess_oras_codigo)
47. 30.862 5,754.212 ↑ 75,509,342.5 12,807 1

Hash Left Join (cost=93,757,656.06..3,749,801,540,578.69 rows=967,048,149,853 width=1,907) (actual time=3,440.111..5,754.212 rows=12,807 loops=1)

  • Hash Cond: (viag.viag_codigo = vmoo.vmoo_viag_codigo)
  • Join Filter: (((SubPlan 6))::text = '1'::text)
  • Rows Removed by Join Filter: 380
48. 12.631 5,494.320 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,756,311.09..309,486,318,113.70 rows=967,048,149,853 width=1,903) (actual time=3,419.753..5,494.320 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_pess_oras_codigo_gestor = gfro_veic.pess_oras_codigo)
49. 21.072 5,474.475 ↑ 75,615,618.9 12,789 1

Nested Loop Left Join (cost=93,755,543.82..306,947,261,109.81 rows=967,048,149,853 width=1,881) (actual time=3,412.383..5,474.475 rows=12,789 loops=1)

  • Join Filter: (embnome.pess_oras_codigo = emba_embarcador.emba_pjur_pess_oras_codigo)
  • Rows Removed by Join Filter: 12789
50. 11.696 5,453.403 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,755,543.53..292,441,538,859.71 rows=967,048,149,853 width=1,855) (actual time=3,412.364..5,453.403 rows=12,789 loops=1)

  • Hash Cond: (term_terminal.term_gmac_central_veiculo = gmac_grupo_macro.gmac_codigo)
51. 12.951 5,441.453 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,755,520.13..289,897,261,027.67 rows=967,048,149,853 width=1,829) (actual time=3,412.090..5,441.453 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_oras_codigo = vinc.vtra_veic_oras_codigo)
52. 14.060 5,424.976 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,754,890.39..287,357,918,700.68 rows=967,048,149,853 width=1,825) (actual time=3,408.513..5,424.976 rows=12,789 loops=1)

  • Hash Cond: (viag.viag_tran_pess_oras_codigo = emviagem.pess_oras_codigo)
  • Join Filter: ((viag.viag_data_inicio IS NOT NULL) AND (viag.viag_data_fim IS NULL))
  • Rows Removed by Join Filter: 369
53. 12.493 5,403.651 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,754,123.12..284,819,397,833.35 rows=967,048,149,853 width=1,799) (actual time=3,401.088..5,403.651 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_pess_oras_codigo_propri = semviagem.pess_oras_codigo)
54. 29.379 5,383.483 ↑ 75,615,618.9 12,789 1

Hash Left Join (cost=93,753,355.84..282,280,340,829.46 rows=967,048,149,853 width=1,773) (actual time=3,393.257..5,383.483 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_oras_codigo = vemb.vemb_veic_oras_codigo)
  • Filter: ((hashed SubPlan 4) OR (hashed SubPlan 5))
55. 13.022 5,317.937 ↑ 100,820,825.2 12,789 1

Hash Join (cost=93,750,465.57..277,348,392,374.92 rows=1,289,397,533,138 width=1,769) (actual time=3,353.532..5,317.937 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_tvei_codigo = tvei_tipo_veiculo.tvei_codigo)
56. 10.121 5,304.883 ↑ 2,240,462,781.6 12,789 1

Hash Left Join (cost=93,750,464.37..200,539,697,656.67 rows=28,653,278,514,172 width=1,765) (actual time=3,353.483..5,304.883 rows=12,789 loops=1)

  • Hash Cond: (viag.viag_codigo = vvei_terceiro.vvei_viag_codigo)
  • Join Filter: ((viag.viag_data_inicio IS NOT NULL) AND (viag.viag_data_fim IS NULL))
  • Rows Removed by Join Filter: 14
57. 12.884 5,284.620 ↑ 38,262,172.7 12,789 1

Hash Left Join (cost=93,739,316.45..5,532,047,514.60 rows=489,334,927,187 width=1,679) (actual time=3,343.295..5,284.620 rows=12,789 loops=1)

  • Hash Cond: (veic_p.veic_oras_codigo = vcca2.vcca_vcav_veic_oras_codigo)
58. 3,131.927 5,269.068 ↑ 1,667,373.4 12,636 1

Hash Right Join (cost=93,735,803.04..729,103,603.55 rows=21,068,930,424 width=1,593) (actual time=3,340.546..5,269.068 rows=12,636 loops=1)

  • Hash Cond: (vveicarreta.veic_oras_codigo = vvei_segundo.vvei_veic_oras_codigo)
59. 19.667 19.667 ↑ 13.5 10,824 1

CTE Scan on veiculo vveicarreta (cost=0.00..2,930.12 rows=146,506 width=90) (actual time=0.004..19.667 rows=10,824 loops=1)

60. 96.992 2,117.474 ↑ 28,475.1 12,636 1

Hash (cost=21,773,611.09..21,773,611.09 rows=359,810,956 width=1,511) (actual time=2,117.474..2,117.474 rows=12,636 loops=1)

  • Buckets: 4096 Batches: 131072 Memory Usage: 2403kB
61. 1,240.652 2,020.482 ↑ 28,475.1 12,636 1

Hash Left Join (cost=6,982,867.28..21,773,611.09 rows=359,810,956 width=1,511) (actual time=905.442..2,020.482 rows=12,636 loops=1)

  • Hash Cond: (veic_p.veic_oras_codigo = vtra.vtra_veic_oras_codigo)
  • -> Nested Loop Left Join (cost=6979797.44..14302989.96 rows=238119491 width=1507) (actual time=837.480..1941.729 rows=1071 loo (...)
  • -> Hash Right Join (cost=6979797.30..11326494.16 rows=238119491 width=1368) (actual time=837.453..1938.424 rows=1071 loo (...)
  • Hash Cond: (carreta.veic_oras_codigo = vcca_veiculo_cavalo_carreta.vcca_vcar_veic_oras_codigo)
  • -> CTE Scan on veiculo carreta (cost=0.00..2930.12 rows=146506 width=90) (actual time=0.003..7.403 rows=10824 loop (...)
62. 710.894 710.894 ↑ 9,572.9 1,071 1

Hash (cost=5,209,632.63..5,209,632.63 rows=10,252,534 width=1,286) (actual time=710.894..710.894 rows=1,071 loops=1)

  • Buckets: 4096 Batches: 4096 Memory Usage: 55kB
  • -> Hash Left Join (cost=69109.86..5209632.63 rows=10252534 width=1286) (actual time=510.981..523.967 rows=10 (...)
  • Hash Cond: ((CASE WHEN (viag_viagem.viag_codigo IS NOT NULL) THEN viag_viagem.viag_codigo ELSE semviagve (...)
  • -> Merge Right Join (cost=55953.89..2971310.32 rows=10252534 width=804) (actual time=364.646..371.444 (...)
  • Merge Cond: (veic_te.veic_oras_codigo = veic_p.veic_oras_codigo)
  • -> Merge Left Join (cost=47422.54..2414662.73 rows=157731290 width=8) (actual time=242.724..247. (...)
  • Merge Cond: (veic_te.veic_oras_codigo = veic_pa.veic_oras_codigo)
  • -> Sort (cost=21010.26..21376.52 rows=146506 width=8) (actual time=216.380..217.898 rows=1 (...)
  • Sort Key: veic_te.veic_oras_codigo
  • Sort Method: quicksort Memory: 892kB
  • -> Hash Left Join (cost=5116.75..8439.60 rows=146506 width=8) (actual time=208.685.. (...)
  • Hash Cond: (veic_te.veic_oras_codigo = semviagveic.veic_oras_codigo)
  • -> CTE Scan on veiculo veic_te (cost=0.00..2930.12 rows=146506 width=4) (actua (...)
  • -> Hash (cost=5114.25..5114.25 rows=200 width=8) (actual time=55.749..55.749 r (...)
  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • -> Subquery Scan on semviagveic (cost=5110.25..5114.25 rows=200 width=8) (...)
  • -> HashAggregate (cost=5110.25..5112.25 rows=200 width=8) (actual (...)
  • Group Key: veic_ty.veic_oras_codigo
  • -> Hash Join (cost=1560.42..5090.88 rows=3875 width=8) (actu (...)
  • Hash Cond: (veic_ty.veic_oras_codigo = vvei_viagem_veicu (...)
  • -> CTE Scan on veiculo veic_ty (cost=0.00..2930.12 row (...)
  • -> Hash (cost=1559.33..1559.33 rows=87 width=8) (actua (...)
  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • -> Hash Join (cost=1340.79..1559.33 rows=87 widt (...)
  • Hash Cond: (pess_pessoa.pess_oras_codigo = v (...)
  • -> HashAggregate (cost=1335.11..1422.18 ro (...)
  • Group Key: pess_pessoa.pess_oras_codig (...)
  • -> Append (cost=0.57..1313.35 rows=8 (...)
  • -> Nested Loop (cost=0.57..2.6 (...)
  • -> Index Only Scan using (...)
  • Index Cond: (pess_or (...)
  • Heap Fetches: 1
  • -> Index Only Scan using (...)
  • Index Cond: (tran_pe (...)
  • Heap Fetches: 0
  • -> Nested Loop (cost=0.29..457 (...)
  • -> Seq Scan on tran_trans (...)
  • Filter: (tran_pess_o (...)
  • Rows Removed by Filt (...)
  • -> Index Only Scan using (...)
  • Index Cond: (pess_or (...)
  • Heap Fetches: 126
  • -> Merge Join (cost=0.65..766. (...)
  • Merge Cond: (pess_pessoa_2 (...)
  • -> Index Only Scan using (...)
  • Heap Fetches: 18486
  • -> Index Only Scan using (...)
  • Index Cond: (temb_tr (...)
  • Heap Fetches: 302
  • -> Hash (cost=5.65..5.65 rows=2 width=12) (...)
  • Buckets: 1024 Batches: 1 Memory Usag (...)
  • -> Nested Loop (cost=0.58..5.65 rows (...)
  • -> Index Scan using viag_viagem (...)
  • Index Cond: ((viag_data_in (...)
  • -> Index Scan using beg_vvei_vi (...)
  • Index Cond: (vvei_viag_cod (...)
  • -> Materialize (cost=26412.29..27488.91 rows=215324 width=8) (actual time=26.338..26.822 r (...)
  • -> Sort (cost=26412.29..26950.60 rows=215324 width=8) (actual time=26.335..26.572 ro (...)
  • Sort Key: veic_pa.veic_oras_codigo
  • Sort Method: quicksort Memory: 108kB
  • -> Hash Join (cost=2326.70..5654.73 rows=215324 width=8) (actual time=23.299.. (...)
  • Hash Cond: (viag_viagem.viag_tran_pess_oras_codigo = pess_pessoa_3.pess_or (...)
  • -> Hash Join (cost=708.61..4023.37 rows=4946 width=12) (actual time=1.06 (...)
  • Hash Cond: (veic_pa.veic_viag_codigo = viag_viagem.viag_codigo)
  • -> CTE Scan on veiculo veic_pa (cost=0.00..2930.12 rows=146506 wid (...)
  • -> Hash (cost=697.48..697.48 rows=890 width=8) (actual time=1.053. (...)
  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
  • -> Index Scan using viag_viagem_idx_70488 on viag_viagem (co (...)
  • Index Cond: (viag_data_fim IS NULL)
  • -> Hash (cost=1509.25..1509.25 rows=8707 width=4) (actual time=22.217..2 (...)
  • Buckets: 16384 Batches: 1 Memory Usage: 440kB
  • -> HashAggregate (cost=1335.11..1422.18 rows=8707 width=4) (actual (...)
  • Group Key: pess_pessoa_3.pess_oras_codigo
  • -> Append (cost=0.57..1313.35 rows=8707 width=4) (actual tim (...)
  • -> Nested Loop (cost=0.57..2.61 rows=1 width=4) (actua (...)
  • -> Index Only Scan using pess_oras_nome_codigo_id (...)
  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
  • -> Index Only Scan using tran_transportador_pkey (...)
  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
  • -> Nested Loop (cost=0.29..457.30 rows=177 width=4) (a (...)
  • -> Seq Scan on tran_transportador tran_transporta (...)
  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
  • -> Index Only Scan using pess_oras_nome_codigo_id (...)
  • Index Cond: (pess_oras_codigo = tran_transpo (...)
  • Heap Fetches: 126
  • -> Merge Join (cost=0.65..766.36 rows=8529 width=4) (a (...)
  • Merge Cond: (pess_pessoa_5.pess_oras_codigo = temb (...)
  • -> Index Only Scan using pess_oras_nome_codigo_id (...)
  • Heap Fetches: 18486
  • -> Index Only Scan using temb_emba_tran_tvco_idx (...)
  • Index Cond: (temb_tran_pess_oras_codigo = 11 (...)
  • Heap Fetches: 302
  • -> Sort (cost=8531.35..8531.38 rows=13 width=800) (actual time=121.913..122.225 rows=1071 loops= (...)
  • Sort Key: veic_p.veic_oras_codigo
  • Sort Method: quicksort Memory: 477kB
  • -> Nested Loop Left Join (cost=5045.56..8531.11 rows=13 width=800) (actual time=112.221..1 (...)
  • -> Nested Loop (cost=5045.28..8527.04 rows=13 width=796) (actual time=112.204..117.5 (...)
  • -> Hash Join (cost=5045.13..8524.80 rows=13 width=789) (actual time=112.190..1 (...)
  • Hash Cond: (veic_p.veic_oras_codigo = oras_objeto_rastreado.oras_codigo)
  • -> CTE Scan on veiculo veic_p (cost=0.00..2930.12 rows=146506 width=622) (...)
  • -> Hash (cost=5045.08..5045.08 rows=4 width=179) (actual time=112.147..1 (...)
  • Buckets: 1024 Batches: 1 Memory Usage: 218kB
  • -> Nested Loop (cost=4440.48..5045.08 rows=4 width=179) (actual ti (...)
  • -> Nested Loop (cost=4440.20..5043.87 rows=4 width=154) (act (...)
  • -> Nested Loop (cost=4439.93..4950.36 rows=152 width=4 (...)
  • Join Filter: (orte_objeto_rastreado_termina.orte_o (...)
  • -> Hash Join (cost=4439.64..4671.40 rows=694 wid (...)
  • Hash Cond: (orte_objeto_rastreado_termina.or (...)
  • -> Merge Join (cost=4252.18..4477.11 rows= (...)
  • Merge Cond: (orte_objeto_rastreado_ter (...)
  • -> Index Only Scan using orte_objeto_ (...)
  • Index Cond: (orte_sequencia = 'P (...)
  • Heap Fetches: 2337
  • -> Sort (cost=4251.90..4273.17 rows= (...)
  • Sort Key: veic_veiculo.veic_oras (...)
  • Sort Method: quicksort Memory: (...)
  • -> HashAggregate (cost=3611.48 (...)
  • Group Key: veic_veiculo.ve (...)
  • -> Hash Join (cost=2411. (...)
  • Hash Cond: (vtra_vei (...)
  • -> Hash Left Join (...)
  • Hash Cond: (ve (...)
  • Filter: ((vemb (...)
  • Rows Removed b (...)
  • -> Hash Join (...)
  • Hash Con (...)
  • -> Inde (...)
  • He (...)
  • -> Hash (...)
  • Bu (...)
  • -> (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • -> Hash (cos (...)
  • Buckets: (...)
  • -> Seq (...)
  • -> Hash (cost=1509 (...)
  • Buckets: 16384 (...)
  • -> HashAggreg (...)
  • Group Ke (...)
  • -> Appe (...)
  • -> (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • -> (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • -> (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • (...)
  • -> Hash (cost=164.67..164.67 rows=1823 wid (...)
  • Buckets: 2048 Batches: 1 Memory Usag (...)
  • -> Bitmap Heap Scan on term_terminal (...)
  • Recheck Cond: ((term_ativo_ws = (...)
  • Heap Blocks: exact=52
  • -> BitmapOr (cost=22.21..22.21 (...)
  • -> Bitmap Index Scan on t (...)
  • Index Cond: (term_at (...)
  • -> Bitmap Index Scan on t (...)
  • Index Cond: (term_at (...)
  • -> Index Scan using oras_objeto_rastreado_pkey on (...)
  • Index Cond: (oras_codigo = veic_veiculo.veic (...)
  • Filter: (oras_eobj_codigo = 1)
  • -> Index Scan using upos_ultima_posicao_beg_i04 on upos (...)
  • Index Cond: ((upos_vtec_codigo = term_terminal.ter (...)
  • -> Index Scan using vtec_versao_tecnolog_idx_70503 on vtec_ve (...)
  • Index Cond: (vtec_codigo = term_terminal.term_vtec_codig (...)
  • -> Index Scan using tecn_tecnologia_pkey on tecn_tecnologia (cost=0.14..0.17 r (...)
  • Index Cond: (tecn_codigo = vtec_versao_tecnologia.vtec_tecn_codigo)
  • -> Index Only Scan using vcca_veiculo_cavalo_carreta_seq_idx on vcca_veiculo_cavalo_c (...)
  • Index Cond: ((vcca_vcav_veic_oras_codigo = veic_p.veic_oras_codigo) AND (vcca_se (...)
  • Heap Fetches: 982
  • -> Hash (cost=11178.43..11178.43 rows=26363 width=486) (actual time=146.259..146.259 rows=20665 loops= (...)
  • Buckets: 16384 Batches: 4 Memory Usage: 439kB
  • -> Hash Left Join (cost=8684.21..11178.43 rows=26363 width=486) (actual time=98.231..135.562 row (...)
  • Hash Cond: (viag.viag_codigo = vvei_segundo.vvei_viag_codigo)
  • Join Filter: ((viag.viag_data_inicio IS NOT NULL) AND (viag.viag_data_fim IS NULL))
  • Rows Removed by Join Filter: 18865
  • -> Hash Left Join (cost=7072.40..9143.24 rows=26363 width=482) (actual time=72.807..98.536 (...)
  • Hash Cond: (viag.viag_codigo = vest.vest_viag_codigo)
  • -> Seq Scan on viag_viagem viag (cost=0.00..2001.63 rows=26363 width=480) (actual ti (...)
  • -> Hash (cost=6810.25..6810.25 rows=20972 width=6) (actual time=72.684..72.684 rows= (...)
  • Buckets: 32768 Batches: 1 Memory Usage: 1064kB
  • -> Subquery Scan on vest (cost=6309.66..6810.25 rows=20972 width=6) (actual ti (...)
  • -> Unique (cost=6309.66..6600.53 rows=20972 width=14) (actual time=44.84 (...)
  • -> Sort (cost=6309.66..6455.09 rows=58174 width=14) (actual time=4 (...)
  • Sort Key: vest_viagem_estatus.vest_viag_codigo, vest_viagem_es (...)
  • Sort Method: quicksort Memory: 4204kB
  • -> Seq Scan on vest_viagem_estatus (cost=0.00..1705.74 rows= (...)
  • -> Hash (cost=1370.94..1370.94 rows=19270 width=8) (actual time=25.381..25.381 rows=19479 (...)
  • Buckets: 32768 Batches: 1 Memory Usage: 1017kB
  • -> Index Scan using vvei_viagem_veiculo_idx_70583 on vvei_viagem_veiculo vvei_segundo (...)
  • Index Cond: (((vvei_precedencia)::text = '2'::text) AND ((vvei_ativo)::text = 'S (...)
63. 1.071 1.071 ↑ 1.0 1 1,071

Materialize (cost=0.14..2.16 rows=1 width=139) (actual time=0.000..0.001 rows=1 loops=1,071)

  • -> Index Scan using pk_cdes_constante_descricao on cdes_constante_descricao cdes_vest_estatus (cost=0.14..2.16 row (...)
  • Index Cond: ((cdes_campo)::text = 'vest_estatus'::text)
64. 8.102 67.865 ↓ 1.7 32,275 1

Hash (cost=2,828.02..2,828.02 rows=19,346 width=8) (actual time=67.864..67.865 rows=32,275 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1517kB
65. 39.945 59.763 ↓ 1.7 32,275 1

Hash Join (cost=1,618.38..2,828.02 rows=19,346 width=8) (actual time=19.908..59.763 rows=32,275 loops=1)

  • Hash Cond: (vtra.vtra_tran_pess_oras_codigo = pess_pessoa_9.pess_oras_codigo)
  • -> Index Only Scan using vtra_idx1 on vtra_veiculo_transportador vtra (cost=0.29..893.13 rows=38693 width=8) (actu (...)
  • Index Cond: (vtra_eobj_codigo = 1)
  • Heap Fetches: 37076
66. 1.299 19.818 ↓ 1.0 8,855 1

Hash (cost=1,509.25..1,509.25 rows=8,707 width=4) (actual time=19.818..19.818 rows=8,855 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 440kB
67. 3.802 18.519 ↓ 1.0 8,855 1

HashAggregate (cost=1,335.11..1,422.18 rows=8,707 width=4) (actual time=17.184..18.519 rows=8,855 loops=1)

  • Group Key: pess_pessoa_9.pess_oras_codigo
68. 13.563 14.717 ↓ 1.0 8,869 1

Append (cost=0.57..1,313.35 rows=8,707 width=4) (actual time=0.030..14.717 rows=8,869 loops=1)

  • -> Merge Join (cost=0.65..766.36 rows=8529 width=4) (actual time=0.044..12.964 rows=8741 loops=1 (...)
69. 0.031 0.031 ↑ 1.0 1 1

Nested Loop (cost=0.57..2.61 rows=1 width=4) (actual time=0.030..0.031 rows=1 loops=1)

  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_9 (cost=0.29 (...)
  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
  • -> Index Only Scan using tran_transportador_pkey on tran_transportador tran_transportador_6 (...)
  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
70. 1.123 1.123 ↑ 1.4 127 1

Nested Loop (cost=0.29..457.30 rows=177 width=4) (actual time=0.216..1.123 rows=127 loops=1)

  • -> Seq Scan on tran_transportador tran_transportador_7 (cost=0.00..296.31 rows=177 width=4 (...)
  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_10 (cost=0.2 (...)
  • Index Cond: (pess_oras_codigo = tran_transportador_7.tran_pess_oras_codigo)
  • Heap Fetches: 126
  • Merge Cond: (pess_pessoa_11.pess_oras_codigo = temb_transportador_embarcador_3.temb_emba_pju (...)
  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_11 (cost=0.2 (...)
  • Heap Fetches: 18486
  • -> Index Only Scan using temb_emba_tran_tvco_idx on temb_transportador_embarcador temb_tran (...)
  • Index Cond: (temb_tran_pess_oras_codigo = 11)
  • Heap Fetches: 302
71. 0.067 2.668 ↑ 34.2 247 1

Hash (cost=3,407.74..3,407.74 rows=8,454 width=90) (actual time=2.668..2.668 rows=247 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 140kB
72. 1.004 2.601 ↑ 34.2 247 1

Hash Right Join (cost=92.78..3,407.74 rows=8,454 width=90) (actual time=0.490..2.601 rows=247 loops=1)

  • Hash Cond: (carreta2.veic_oras_codigo = vcca2.vcca_vcar_veic_oras_codigo)
73. 1.141 1.141 ↑ 13.5 10,824 1

CTE Scan on veiculo carreta2 (cost=0.00..2,930.12 rows=146,506 width=90) (actual time=0.001..1.141 rows=10,824 loops=1)

74. 0.456 0.456 ↑ 1.5 247 1

Hash (cost=88.23..88.23 rows=364 width=8) (actual time=0.456..0.456 rows=247 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
  • -> Index Only Scan using vcca_veiculo_cavalo_carreta_seq_idx on vcca_veiculo_cavalo_carreta vcca2 (cost=0.28..88.23 rows=364 w (...)
  • Index Cond: (vcca_sequencia = 2)
  • Heap Fetches: 229
75. 0.123 10.142 ↑ 13.9 429 1

Hash (cost=11,073.25..11,073.25 rows=5,973 width=90) (actual time=10.142..10.142 rows=429 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 85kB
76. 3.868 10.019 ↑ 13.9 429 1

Hash Left Join (cost=6,908.73..11,073.25 rows=5,973 width=90) (actual time=6.616..10.019 rows=429 loops=1)

  • Hash Cond: (vvei_terceiro.vvei_veic_oras_codigo = vveicarreta2.veic_oras_codigo)
  • -> Index Scan using vvei_viagem_veiculo_idx_70583 on vvei_viagem_veiculo vvei_terceiro (cost=0.29..87.82 rows=102 width=8) (actual time=0. (...)
  • Index Cond: (((vvei_precedencia)::text = '3'::text) AND ((vvei_ativo)::text = 'S'::text))
77. 3.185 6.151 ↑ 13.5 10,824 1

Hash (cost=2,930.12..2,930.12 rows=146,506 width=90) (actual time=6.151..6.151 rows=10,824 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 584kB
78. 2.966 2.966 ↑ 13.5 10,824 1

CTE Scan on veiculo vveicarreta2 (cost=0.00..2,930.12 rows=146,506 width=90) (actual time=0.001..2.966 rows=10,824 loops=1)

79. 0.016 0.032 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=12) (actual time=0.032..0.032 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
80. 0.016 0.016 ↑ 1.0 9 1

Seq Scan on tvei_tipo_veiculo (cost=0.00..1.09 rows=9 width=12) (actual time=0.013..0.016 rows=9 loops=1)

81. 0.001 0.022 ↓ 0.0 0 1

Hash (cost=2.36..2.36 rows=1 width=12) (actual time=0.022..0.022 rows=0 loops=1)

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

Nested Loop Left Join (cost=0.29..2.36 rows=1 width=12) (actual time=0.021..0.021 rows=0 loops=1)

  • Join Filter: (emba_embarcador.emba_pjur_pess_oras_codigo = vemb.vemb_emba_pjur_pess_oras_codigo)
83. 0.021 0.021 ↓ 0.0 0 1

Seq Scan on vemb_veiculo_embarcador vemb (cost=0.00..1.04 rows=1 width=8) (actual time=0.021..0.021 rows=0 loops=1)

  • Filter: ((vemb_eobj_codigo = 1) AND (vemb_emba_pjur_pess_oras_codigo = 11))
  • Rows Removed by Filter: 3
84. 0.000 0.000 ↓ 0.0 0

Index Only Scan using emba_embarcador_pkey on emba_embarcador (cost=0.29..1.30 rows=1 width=4) (never executed)

  • Index Cond: (emba_pjur_pess_oras_codigo = 11)
  • Heap Fetches: 0
85.          

SubPlan (for Hash Left Join)

86. 3.628 18.254 ↓ 1.0 8,855 1

HashAggregate (cost=1,335.11..1,422.18 rows=8,707 width=4) (actual time=17.154..18.254 rows=8,855 loops=1)

  • Group Key: pess_pessoa_18.pess_oras_codigo
87. 0.591 14.626 ↓ 1.0 8,869 1

Append (cost=0.57..1,313.35 rows=8,707 width=4) (actual time=0.033..14.626 rows=8,869 loops=1)

88. 0.034 0.034 ↑ 1.0 1 1

Nested Loop (cost=0.57..2.61 rows=1 width=4) (actual time=0.033..0.034 rows=1 loops=1)

  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_18 (cost=0.29..1.31 rows=1 width=4) (actual time=0.017..0.018 ro (...)
  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
  • -> Index Only Scan using tran_transportador_pkey on tran_transportador tran_transportador_12 (cost=0.28..1.30 rows=1 width=4) (actual time=0.0 (...)
  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
89. 0.346 1.076 ↑ 1.4 127 1

Nested Loop (cost=0.29..457.30 rows=177 width=4) (actual time=0.198..1.076 rows=127 loops=1)

  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_19 (cost=0.29..0.91 rows=1 width=4) (actual time=0.002..0.002 ro (...)
90. 0.730 0.730 ↑ 1.4 127 1

Seq Scan on tran_transportador tran_transportador_13 (cost=0.00..296.31 rows=177 width=4) (actual time=0.178..0.730 rows=127 loops=1)

  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
  • Index Cond: (pess_oras_codigo = tran_transportador_13.tran_pess_oras_codigo)
  • Heap Fetches: 126
91. 12.925 12.925 ↓ 1.0 8,741 1

Merge Join (cost=0.65..766.36 rows=8,529 width=4) (actual time=0.056..12.925 rows=8,741 loops=1)

  • Merge Cond: (pess_pessoa_20.pess_oras_codigo = temb_transportador_embarcador_6.temb_emba_pjur_pess_oras_codigo)
  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_20 (cost=0.29..424.14 rows=19390 width=4) (actual time=0.021..7. (...)
  • Heap Fetches: 18486
  • -> Index Only Scan using temb_emba_tran_tvco_idx on temb_transportador_embarcador temb_transportador_embarcador_6 (cost=0.29..188.81 rows=8529 (...)
  • Index Cond: (temb_tran_pess_oras_codigo = 11)
  • Heap Fetches: 302
92. 3.697 17.891 ↓ 1.0 8,855 1

HashAggregate (cost=1,335.11..1,422.18 rows=8,707 width=4) (actual time=16.693..17.891 rows=8,855 loops=1)

  • Group Key: pess_pessoa_21.pess_oras_codigo
93. 0.568 14.194 ↓ 1.0 8,869 1

Append (cost=0.57..1,313.35 rows=8,707 width=4) (actual time=0.033..14.194 rows=8,869 loops=1)

94. 0.034 0.034 ↑ 1.0 1 1

Nested Loop (cost=0.57..2.61 rows=1 width=4) (actual time=0.033..0.034 rows=1 loops=1)

  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_21 (cost=0.29..1.31 rows=1 width=4) (actual time=0.019..0.019 ro (...)
  • Index Cond: (pess_oras_codigo = 11)
  • Heap Fetches: 1
  • -> Index Only Scan using tran_transportador_pkey on tran_transportador tran_transportador_14 (cost=0.28..1.30 rows=1 width=4) (actual time=0.0 (...)
  • Index Cond: (tran_pess_oras_codigo = 11)
  • Heap Fetches: 0
95. 0.307 0.992 ↑ 1.4 127 1

Nested Loop (cost=0.29..457.30 rows=177 width=4) (actual time=0.171..0.992 rows=127 loops=1)

  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_22 (cost=0.29..0.91 rows=1 width=4) (actual time=0.002..0.002 ro (...)
96. 0.685 0.685 ↑ 1.4 127 1

Seq Scan on tran_transportador tran_transportador_15 (cost=0.00..296.31 rows=177 width=4) (actual time=0.155..0.685 rows=127 loops=1)

  • Filter: (tran_pess_oras_codigo_matriz = 11)
  • Rows Removed by Filter: 4923
  • Index Cond: (pess_oras_codigo = tran_transportador_15.tran_pess_oras_codigo)
  • Heap Fetches: 126
97. 12.600 12.600 ↓ 1.0 8,741 1

Merge Join (cost=0.65..766.36 rows=8,529 width=4) (actual time=0.067..12.600 rows=8,741 loops=1)

  • Merge Cond: (pess_pessoa_23.pess_oras_codigo = temb_transportador_embarcador_7.temb_emba_pjur_pess_oras_codigo)
  • -> Index Only Scan using pess_oras_nome_codigo_idx on pess_pessoa pess_pessoa_23 (cost=0.29..424.14 rows=19390 width=4) (actual time=0.032..7. (...)
  • Heap Fetches: 18486
  • -> Index Only Scan using temb_emba_tran_tvco_idx on temb_transportador_embarcador temb_transportador_embarcador_7 (cost=0.29..188.81 rows=8529 (...)
  • Index Cond: (temb_tran_pess_oras_codigo = 11)
  • Heap Fetches: 302
98. 4.344 7.675 ↓ 1.0 19,699 1

Hash (cost=524.90..524.90 rows=19,390 width=30) (actual time=7.675..7.675 rows=19,699 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1496kB
99. 3.331 3.331 ↓ 1.0 19,699 1

Seq Scan on pess_pessoa semviagem (cost=0.00..524.90 rows=19,390 width=30) (actual time=0.026..3.331 rows=19,699 loops=1)

100. 4.217 7.265 ↓ 1.0 19,699 1

Hash (cost=524.90..524.90 rows=19,390 width=30) (actual time=7.265..7.265 rows=19,699 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1496kB
101. 3.048 3.048 ↓ 1.0 19,699 1

Seq Scan on pess_pessoa emviagem (cost=0.00..524.90 rows=19,390 width=30) (actual time=0.011..3.048 rows=19,699 loops=1)

102. 3.526 3.526 ↑ 1.1 6,250 1

Hash (cost=547.48..547.48 rows=6,581 width=8) (actual time=3.526..3.526 rows=6,250 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 309kB
  • -> Index Scan using beg_vtra_veiculo_transportador_vtra_tran_pess_oras_codigo_i on vtra_veiculo_transportador vinc (cost=0.29..547.48 rows=6581 width=8) (actual time=0.023..2 (...)
  • Index Cond: (vtra_tran_pess_oras_codigo = 11)
103. 0.135 0.254 ↓ 1.0 655 1

Hash (cost=15.40..15.40 rows=640 width=34) (actual time=0.254..0.254 rows=655 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 52kB
104. 0.119 0.119 ↓ 1.0 655 1

Seq Scan on gmac_grupo_macro (cost=0.00..15.40 rows=640 width=34) (actual time=0.021..0.119 rows=655 loops=1)

105. 0.000 0.000 ↑ 1.0 1 12,789

Materialize (cost=0.29..2.31 rows=1 width=30) (actual time=0.000..0.000 rows=1 loops=12,789)

106. 0.012 0.012 ↑ 1.0 1 1

Index Scan using pess_oras_nome_codigo_idx on pess_pessoa embnome (cost=0.29..2.31 rows=1 width=30) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: (pess_oras_codigo = 11)
107. 4.161 7.214 ↓ 1.0 19,699 1

Hash (cost=524.90..524.90 rows=19,390 width=30) (actual time=7.214..7.214 rows=19,699 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1496kB
108. 3.053 3.053 ↓ 1.0 19,699 1

Seq Scan on pess_pessoa gfro_veic (cost=0.00..524.90 rows=19,390 width=30) (actual time=0.008..3.053 rows=19,699 loops=1)

109. 3.722 20.213 ↑ 1.0 20,595 1

Hash (cost=1,085.49..1,085.49 rows=20,758 width=8) (actual time=20.213..20.213 rows=20,595 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1061kB
110. 16.491 16.491 ↑ 1.0 20,595 1

Index Scan using vmoo_precedencia_idx_10000 on vmoo_viagem_motorista vmoo (cost=0.29..1,085.49 rows=20,758 width=8) (actual time=0.045..16.491 rows=20,595 loops=1)

  • Index Cond: (((vmoo_precedencia)::text = '1'::text) AND (vmoo_ativo = 'S'::bpchar))
111.          

SubPlan (for Hash Left Join)

112. 18.158 208.817 ↑ 1.0 1 9,079

Limit (cost=4.48..4.48 rows=1 width=10) (actual time=0.023..0.023 rows=1 loops=9,079)

113. 81.711 190.659 ↑ 3.0 1 9,079

Sort (cost=4.48..4.49 rows=3 width=10) (actual time=0.021..0.021 rows=1 loops=9,079)

  • Sort Key: vest_viagem_estatus_1.vest_data_cadastro DESC
  • Sort Method: quicksort Memory: 25kB
114. 108.948 108.948 ↑ 1.5 2 9,079

Index Scan using vest_viag_status_idx on vest_viagem_estatus vest_viagem_estatus_1 (cost=0.41..4.47 rows=3 width=10) (actual time=0.010..0.012 rows=2 loops=9,079)

  • Index Cond: (vest_viag_codigo = viag.viag_codigo)
115. 1.595 6.325 ↓ 1.0 7,847 1

Hash (cost=172.77..172.77 rows=7,766 width=16) (actual time=6.325..6.325 rows=7,847 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 461kB
116. 4.730 4.730 ↓ 1.0 7,847 1

Index Only Scan using pfis_oras_codigo_idx on pfis_pessoa_fisica pfmotoviag (cost=0.28..172.77 rows=7,766 width=16) (actual time=0.020..4.730 rows=7,847 loops=1)

  • Heap Fetches: 7737
117. 4.074 7.448 ↓ 1.0 19,699 1

Hash (cost=524.90..524.90 rows=19,390 width=30) (actual time=7.448..7.448 rows=19,699 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1468kB
118. 3.374 3.374 ↓ 1.0 19,699 1

Seq Scan on pess_pessoa moto_viag (cost=0.00..524.90 rows=19,390 width=30) (actual time=0.012..3.374 rows=19,699 loops=1)

119. 0.661 1.833 ↓ 1.0 4,272 1

Hash (cost=138.26..138.26 rows=4,202 width=8) (actual time=1.833..1.833 rows=4,272 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 231kB
120. 1.172 1.172 ↓ 1.0 4,272 1

Seq Scan on mvel_motorista_veiculo mvel (cost=0.00..138.26 rows=4,202 width=8) (actual time=0.037..1.172 rows=4,272 loops=1)

  • Filter: (((mvel_precedencia)::text = '1'::text) AND (mvel_ativo = 'S'::bpchar))
  • Rows Removed by Filter: 317
121. 1.647 6.077 ↓ 1.0 7,847 1

Hash (cost=172.77..172.77 rows=7,766 width=16) (actual time=6.077..6.077 rows=7,847 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 461kB
122. 4.430 4.430 ↓ 1.0 7,847 1

Index Only Scan using pfis_oras_codigo_idx on pfis_pessoa_fisica pfmotoveic (cost=0.28..172.77 rows=7,766 width=16) (actual time=0.020..4.430 rows=7,847 loops=1)

  • Heap Fetches: 7737
123. 4.077 7.310 ↓ 1.0 19,699 1

Hash (cost=524.90..524.90 rows=19,390 width=30) (actual time=7.310..7.310 rows=19,699 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1468kB
124. 3.233 3.233 ↓ 1.0 19,699 1

Seq Scan on pess_pessoa moto_veic (cost=0.00..524.90 rows=19,390 width=30) (actual time=0.010..3.233 rows=19,699 loops=1)

125.          

SubPlan (for Hash Left Join)

126. 51.516 437.886 ↑ 1.0 1 12,879

Aggregate (cost=3.43..3.44 rows=1 width=32) (actual time=0.034..0.034 rows=1 loops=12,879)

127. 386.370 386.370 ↑ 1.0 1 12,879

Index Scan using urpe_ultimo_rec_peri_idx_704700 on urpe_ultimo_rec_periferico (cost=0.41..3.41 rows=1 width=6) (actual time=0.025..0.030 rows=1 loops=12,879)

  • Index Cond: ((upos_ultima_posicao.upos_vtec_codigo = urpe_vtec_codigo) AND ((urpe_term_numero_terminal)::text = (upos_ultima_posicao.upos_term_numero_terminal)::text))
  • Filter: ((urpe_valor IS NOT NULL) AND ((urpe_valor)::text <> ''::text) AND (urpe_eppa_codigo = ANY ('{11,33,34,35,36,37,38,39,40,41}'::integer[])))
  • Rows Removed by Filter: 17
128. 12.879 64.395 ↑ 1.0 1 12,879

Aggregate (cost=18.91..18.92 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=12,879)

129. 51.516 51.516 ↓ 0.0 0 12,879

Nested Loop (cost=0.14..18.91 rows=1 width=218) (actual time=0.004..0.004 rows=0 loops=12,879)

130. 0.000 0.000 ↓ 0.0 0 12,879

Seq Scan on iemv_instrucao_embarque_viagem (cost=0.00..15.50 rows=2 width=4) (actual time=0.000..0.000 rows=0 loops=12,879)

  • Filter: (iemv_viag_codigo = viag.viag_codigo)
131. 0.000 0.000 ↓ 0.0 0

Index Scan using iemb_instrucao_embarque_pkey on iemb_instrucao_embarque (cost=0.14..1.65 rows=1 width=222) (never executed)

  • Index Cond: (iemb_codigo = iemv_instrucao_embarque_viagem.iemv_iemb_codigo)
Planning time : 154.123 ms
Execution time : 7,241.500 ms