explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nnwQ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=3,158.10..3,160.93 rows=1,134 width=562) (actual rows= loops=)

  • Sort Key: ve.cod_variante
2. 0.000 0.000 ↓ 0.0

Unique (cost=3,046.70..3,089.22 rows=1,134 width=562) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=3,046.70..3,049.53 rows=1,134 width=562) (actual rows= loops=)

  • Sort Key: ve.gid, l.cod_linea, l.desc_linea, s.ordinal_sublinea, s.cod_sublinea, s.desc_sublinea, ve.cod_variante, ve.desc_variante, ve.the_geom, ve.cod_variante_maximal, ev.cod_origen, d1.desc_destino, ev.cod_destino, d2.desc_destino
4. 0.000 0.000 ↓ 0.0

Append (cost=923.46..2,989.16 rows=1,134 width=562) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=923.46..986.49 rows=378 width=3,752) (actual rows= loops=)

  • Hash Cond: (ev.cod_destino = d2.cod_destino)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=914.41..972.24 rows=378 width=3,733) (actual rows= loops=)

  • Hash Cond: (ev.cod_origen = d1.cod_destino)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=905.36..957.99 rows=378 width=3,714) (actual rows= loops=)

  • Hash Cond: (v.cod_sublinea = s.cod_sublinea)
8. 0.000 0.000 ↓ 0.0

Hash Join (cost=877.04..924.47 rows=378 width=3,673) (actual rows= loops=)

  • Hash Cond: (ve.cod_variante_maximal = v.cod_variante)
9. 0.000 0.000 ↓ 0.0

Hash Join (cost=408.99..451.23 rows=378 width=3,669) (actual rows= loops=)

  • Hash Cond: (ev.cod_variante = ve.cod_variante)
10. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_extremo_variante ev (cost=0.00..30.97 rows=1,997 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash (cost=404.26..404.26 rows=378 width=3,661) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante_especial ve (cost=34.81..404.26 rows=378 width=3,661) (actual rows= loops=)

  • Filter: (NOT (hashed SubPlan 1))
13.          

SubPlan (forSeq Scan)

14. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_desvio_variante (cost=0.00..29.85 rows=1,985 width=4) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash (cost=460.02..460.02 rows=642 width=8) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante v (cost=0.00..460.02 rows=642 width=8) (actual rows= loops=)

  • Filter: (cod_variante < 9000)
17. 0.000 0.000 ↓ 0.0

Hash (cost=23.77..23.77 rows=364 width=45) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=7.12..23.77 rows=364 width=45) (actual rows= loops=)

  • Hash Cond: (s.cod_linea = l.cod_linea)
19. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_sublinea s (cost=0.00..11.64 rows=364 width=42) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Hash (cost=5.06..5.06 rows=165 width=7) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_linea l (cost=0.00..5.06 rows=165 width=7) (actual rows= loops=)

  • Filter: ((desc_linea)::text !~~ 'PRU%'::text)
22. 0.000 0.000 ↓ 0.0

Hash (cost=6.80..6.80 rows=180 width=23) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_destino d1 (cost=0.00..6.80 rows=180 width=23) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Hash (cost=6.80..6.80 rows=180 width=23) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_destino d2 (cost=0.00..6.80 rows=180 width=23) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Hash Join (cost=948.77..1,032.40 rows=695 width=3,752) (actual rows= loops=)

  • Hash Cond: (ev_1.cod_destino = d2_1.cod_destino)
27. 0.000 0.000 ↓ 0.0

Hash Join (cost=939.72..1,013.80 rows=695 width=3,733) (actual rows= loops=)

  • Hash Cond: (ev_1.cod_origen = d1_1.cod_destino)
28. 0.000 0.000 ↓ 0.0

Hash Join (cost=930.67..995.19 rows=695 width=3,714) (actual rows= loops=)

  • Hash Cond: (v_1.cod_sublinea = s_1.cod_sublinea)
29. 0.000 0.000 ↓ 0.0

Hash Join (cost=902.35..957.32 rows=695 width=3,673) (actual rows= loops=)

  • Hash Cond: (ve_1.cod_variante_maximal = v_1.cod_variante)
30. 0.000 0.000 ↓ 0.0

Hash Join (cost=434.30..479.71 rows=695 width=3,669) (actual rows= loops=)

  • Hash Cond: (ev_1.cod_variante = ve_1.cod_variante)
31. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_extremo_variante ev_1 (cost=0.00..30.97 rows=1,997 width=12) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Hash (cost=425.61..425.61 rows=695 width=3,665) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash Join (cost=377.01..425.61 rows=695 width=3,665) (actual rows= loops=)

  • Hash Cond: (dv.cod_variante = ve_1.cod_variante)
34. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_desvio_variante dv (cost=0.00..34.81 rows=1,824 width=4) (actual rows= loops=)

  • Filter: (desvia = 'N'::bpchar)
35. 0.000 0.000 ↓ 0.0

Hash (cost=367.56..367.56 rows=756 width=3,661) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante_especial ve_1 (cost=0.00..367.56 rows=756 width=3,661) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash (cost=460.02..460.02 rows=642 width=8) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante v_1 (cost=0.00..460.02 rows=642 width=8) (actual rows= loops=)

  • Filter: (cod_variante < 9000)
39. 0.000 0.000 ↓ 0.0

Hash (cost=23.77..23.77 rows=364 width=45) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Join (cost=7.12..23.77 rows=364 width=45) (actual rows= loops=)

  • Hash Cond: (s_1.cod_linea = l_1.cod_linea)
41. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_sublinea s_1 (cost=0.00..11.64 rows=364 width=42) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash (cost=5.06..5.06 rows=165 width=7) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_linea l_1 (cost=0.00..5.06 rows=165 width=7) (actual rows= loops=)

  • Filter: ((desc_linea)::text !~~ 'PRU%'::text)
44. 0.000 0.000 ↓ 0.0

Hash (cost=6.80..6.80 rows=180 width=23) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_destino d1_1 (cost=0.00..6.80 rows=180 width=23) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Hash (cost=6.80..6.80 rows=180 width=23) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_destino d2_1 (cost=0.00..6.80 rows=180 width=23) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=434.17..959.54 rows=61 width=3,765) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Hash Join (cost=434.17..958.93 rows=61 width=3,765) (actual rows= loops=)

  • Hash Cond: (dv_1.cod_lugar_desvio = ld.codigo)
50. 0.000 0.000 ↓ 0.0

Nested Loop (cost=432.47..956.50 rows=61 width=3,756) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Nested Loop (cost=432.33..945.55 rows=61 width=3,737) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Nested Loop (cost=432.18..934.60 rows=61 width=3,718) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Hash Join (cost=431.91..912.61 rows=61 width=3,714) (actual rows= loops=)

  • Hash Cond: (v_2.cod_variante = ve_2.cod_variante_maximal)
54. 0.000 0.000 ↓ 0.0

Hash Join (cost=23.32..501.00 rows=642 width=49) (actual rows= loops=)

  • Hash Cond: (s_2.cod_linea = l_2.cod_linea)
55. 0.000 0.000 ↓ 0.0

Hash Join (cost=16.19..485.04 rows=642 width=46) (actual rows= loops=)

  • Hash Cond: (v_2.cod_sublinea = s_2.cod_sublinea)
56. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante v_2 (cost=0.00..460.02 rows=642 width=8) (actual rows= loops=)

  • Filter: (cod_variante < 9000)
57. 0.000 0.000 ↓ 0.0

Hash (cost=11.64..11.64 rows=364 width=42) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_sublinea s_2 (cost=0.00..11.64 rows=364 width=42) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Hash (cost=5.06..5.06 rows=165 width=7) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_linea l_2 (cost=0.00..5.06 rows=165 width=7) (actual rows= loops=)

  • Filter: ((desc_linea)::text !~~ 'PRU%'::text)
61. 0.000 0.000 ↓ 0.0

Hash (cost=407.83..407.83 rows=61 width=3,669) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Hash Join (cost=36.83..407.83 rows=61 width=3,669) (actual rows= loops=)

  • Hash Cond: (ve_2.cod_variante = dv_1.cod_variante)
63. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_variante_especial ve_2 (cost=0.00..367.56 rows=756 width=3,661) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Hash (cost=34.81..34.81 rows=161 width=8) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_desvio_variante dv_1 (cost=0.00..34.81 rows=161 width=8) (actual rows= loops=)

  • Filter: (desvia = 'S'::bpchar)
66. 0.000 0.000 ↓ 0.0

Index Scan using uptu_extremo_variante_pkey on uptu_extremo_variante ev_2 (cost=0.28..0.35 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (cod_variante = ve_2.cod_variante)
67. 0.000 0.000 ↓ 0.0

Index Scan using uptu_destino_cod_destino on uptu_destino d1_2 (cost=0.14..0.17 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (cod_destino = ev_2.cod_origen)
68. 0.000 0.000 ↓ 0.0

Index Scan using uptu_destino_cod_destino on uptu_destino d2_2 (cost=0.14..0.17 rows=1 width=23) (actual rows= loops=)

  • Index Cond: (cod_destino = ev_2.cod_destino)
69. 0.000 0.000 ↓ 0.0

Hash (cost=1.31..1.31 rows=31 width=18) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Seq Scan on uptu_lugar_desvio ld (cost=0.00..1.31 rows=31 width=18) (actual rows= loops=)