explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Dema

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 444.092 ↓ 755.0 755 1

Nested Loop (cost=1,103.79..16,152.36 rows=1 width=70) (actual time=175.516..444.092 rows=755 loops=1)

  • Planning time: 2.313 ms
  • Execution time: 457.680 ms
2. 20.381 447.526 ↓ 756.0 756 1

Gather (cost=1,103.50..16,143.86 rows=1 width=40) (actual time=175.473..447.526 rows=756 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 0.527 427.145 ↓ 378.0 378 2

Hash Left Join (cost=103.50..15,143.76 rows=1 width=40) (actual time=164.903..427.145 rows=378 loops=2)

  • Hash Cond: (tr.id_tras = lk.id_tras)
  • Filter: (lk.code_lnk IS NULL)
  • Rows Removed by Filter: 12
4. 104.772 423.862 ↑ 1.6 390 2

Nested Loop (cost=13.16..15,050.35 rows=609 width=40) (actual time=162.120..423.862 rows=390 loops=2)

5. 56.797 319.087 ↓ 6.0 26,794 2

Nested Loop (cost=12.73..12,437.76 rows=4,446 width=28) (actual time=157.685..319.087 rows=26,794 loops=2)

  • Join Filter: (hr.id_hrut = rel.id_hrut)
6. 96.686 262.284 ↓ 5.8 4,776 2

Nested Loop (cost=12.30..11,864.29 rows=818 width=28) (actual time=157.644..262.284 rows=4,776 loops=2)

7. 92.650 165.595 ↓ 1.6 23,976 2

Hash Join (cost=11.88..3,783.44 rows=14,936 width=8) (actual time=0.306..165.595 rows=23,976 loops=2)

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

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

9. 0.028 0.083 ↑ 1.0 39 2

Hash (cost=11.39..11.39 rows=39 width=4) (actual time=0.082..0.083 rows=39 loops=2)

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

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

11. 0.003 0.003 ↓ 0.0 0 47,952

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,952)

  • 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. 0.006 0.006 ↑ 1.2 6 9,551

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.006 rows=6 loops=9,551)

  • Index Cond: (id_hrut = rveh.id_hrut)
  • Heap Fetches: 2273
13. 0.003 0.003 ↓ 0.0 0 53,587

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,587)

  • Index Cond: (id_tras = rel.id_tras)
  • Filter: (traer AND (id_per <> 130) AND (id_est <> 6) AND (id_est <> 7))
  • Rows Removed by Filter: 1
14. 1.364 2.756 ↓ 1.0 2,480 2

Hash (cost=60.71..60.71 rows=2,371 width=11) (actual time=2.756..2.756 rows=2,480 loops=2)

  • Buckets: 4096 Batches: 1 Memory Usage: 137kB
15. 1.392 1.392 ↓ 1.0 2,480 2

Seq Scan on link lk (cost=0.00..60.71 rows=2,371 width=11) (actual time=0.015..1.392 rows=2,480 loops=2)

16. 2.268 2.268 ↑ 1.0 1 756

Index Scan using persona_pkey on persona p (cost=0.29..0.32 rows=1 width=41) (actual time=0.003..0.003 rows=1 loops=756)

  • Index Cond: (id = tr.id_per)
  • Filter: ((fono IS NOT NULL) AND (afiliado_sms IS TRUE))
  • Rows Removed by Filter: 0
17.          

SubPlan (forNested Loop)

18. 0.755 0.755 ↑ 1.0 1 755

Result (cost=0.00..0.02 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=755)

19. 1.510 1.510 ↑ 1.0 1 755

Index Scan using vehiculos_en_servicio_un on vehiculos_en_servicio vsms (cost=0.14..8.16 rows=1 width=1) (actual time=0.002..0.002 rows=1 loops=755)

  • Index Cond: (rveh.id_veh = id_veh)