explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IRvo

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 521.409 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,013.44..19,509.15 rows=1 width=82) (actual time=521.408..521.409 rows=0 loops=1)

  • Join Filter: (lk.id_tras = tr.id_tras)
  • Filter: (lk.code_lnk IS NULL)
  • Planning time: 10.338 ms
  • Execution time: 521.697 ms
2. 0.001 521.407 ↓ 0.0 0 1

Nested Loop (cost=1,013.44..19,410.49 rows=1 width=73) (actual time=521.407..521.407 rows=0 loops=1)

3. 36.354 521.406 ↓ 0.0 0 1

Nested Loop (cost=1,013.15..19,402.49 rows=1 width=40) (actual time=521.406..521.406 rows=0 loops=1)

  • Join Filter: (((SubPlan 8) >= 10) AND ((SubPlan 10) <= 30))
4. 60.574 324.312 ↓ 7.1 53,580 1

Nested Loop (cost=1,012.73..13,978.55 rows=7,558 width=28) (actual time=184.850..324.312 rows=53,580 loops=1)

  • Join Filter: (hr.id_hrut = rel.id_hrut)
5. 0.000 215.993 ↓ 6.9 9,549 1

Gather (cost=1,012.30..13,003.39 rows=1,391 width=28) (actual time=184.785..215.993 rows=9,549 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
6. 108.138 284.680 ↓ 5.8 4,774 2

Nested Loop (cost=12.30..11,864.29 rows=818 width=28) (actual time=173.630..284.680 rows=4,774 loops=2)

7. 98.290 176.539 ↓ 1.6 23,974 2

Hash Join (cost=11.88..3,783.44 rows=14,936 width=8) (actual time=0.238..176.539 rows=23,974 loops=2)

  • Hash Cond: (rveh.id_veh = vehiculos_en_servicio.id_veh)
8. 78.149 78.149 ↑ 1.1 161,274 2

Parallel Seq Scan on rel_hrut_veh rveh (cost=0.00..3,293.81 rows=180,381 width=8) (actual time=0.009..78.149 rows=161,274 loops=2)

9. 0.030 0.100 ↑ 1.0 39 2

Hash (cost=11.39..11.39 rows=39 width=4) (actual time=0.099..0.100 rows=39 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.070 0.070 ↑ 1.0 39 2

Seq Scan on vehiculos_en_servicio (cost=0.00..11.39 rows=39 width=4) (actual time=0.011..0.070 rows=39 loops=2)

11. 0.003 0.003 ↓ 0.0 0 47,949

Index Scan using hoja_ruta_pkey on hoja_ruta hr (cost=0.42..0.54 rows=1 width=20) (actual time=0.003..0.003 rows=0 loops=47,949)

  • Index Cond: (id_hrut = rveh.id_hrut)
  • Filter: ((inicio_efectivo IS NOT NULL) AND (id_est <> ALL ('{6,8,7,13}'::integer[])) AND CASE WHEN (inicio_estimado > inicio_efectivo) THEN ((inicio_estimado - inicio_efectivo) < '00:15:00'::interval) WHEN (inicio_estimado < inicio_efectivo) THEN ((inicio_efectivo - inicio_estimado) < '00:15:00'::interval) ELSE NULL::boolean END)
  • Rows Removed by Filter: 1
12. 47.745 47.745 ↑ 1.2 6 9,549

Index Only Scan using rel_hrut_tras_pkey on rel_hrut_tras rel (cost=0.43..0.61 rows=7 width=8) (actual time=0.003..0.005 rows=6 loops=9,549)

  • Index Cond: (id_hrut = rveh.id_hrut)
  • Heap Fetches: 4325
13. 160.740 160.740 ↓ 0.0 0 53,580

Index Scan using traslado_pkey on traslado tr (cost=0.43..0.59 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=53,580)

  • Index Cond: (id_tras = rel.id_tras)
  • Filter: (traer AND (id_per <> 130) AND (id_est <> 6) AND (id_est <> 7) AND (hora_inicio_esperada > now()))
  • Rows Removed by Filter: 1
14.          

SubPlan (forNested Loop)

15. 0.000 0.000 ↓ 0.0 0

Result (cost=0.02..0.06 rows=1 width=4) (never executed)

16.          

Initplan (forResult)

17. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Result (cost=0.02..0.06 rows=1 width=4) (never executed)

19.          

Initplan (forResult)

20. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Index Scan using persona_pkey on persona p (cost=0.29..8.00 rows=1 width=41) (never executed)

  • Index Cond: (id = tr.id_per)
  • Filter: ((fono IS NOT NULL) AND (afiliado_sms IS TRUE))
22. 0.000 0.000 ↓ 0.0 0

Seq Scan on link lk (cost=0.00..60.71 rows=2,371 width=11) (never executed)

23.          

SubPlan (forNested Loop Left Join)

24. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Index Scan using vehiculos_en_servicio_un on vehiculos_en_servicio vsms (cost=0.14..8.16 rows=1 width=1) (never executed)

  • Index Cond: (rveh.id_veh = id_veh)
26. 0.000 0.000 ↓ 0.0 0

Result (cost=0.02..0.06 rows=1 width=4) (never executed)

27.          

Initplan (forResult)

28. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Result (cost=0.02..0.06 rows=1 width=4) (never executed)

30.          

Initplan (forResult)

31. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.02 rows=1 width=8) (never executed)