explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hRs5

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 1,945.303 ↑ 1.0 10 1

Limit (cost=85.54..1,866.59 rows=10 width=1,946) (actual time=1,928.007..1,945.303 rows=10 loops=1)

2. 0.087 1,945.294 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=85.54..2,205,383.21 rows=12,382 width=1,946) (actual time=1,928.005..1,945.294 rows=10 loops=1)

3. 89.854 1,945.137 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=85.13..2,195,358.17 rows=12,382 width=1,829) (actual time=1,927.912..1,945.137 rows=10 loops=1)

  • Filter: ((NOT (alternatives: SubPlan 1 or hashed SubPlan 2)) OR (4 = "Extent11".estado))
  • Rows Removed by Filter: 24720
4. 1.605 224.215 ↑ 1.0 24,730 1

Nested Loop Left Join (cost=1.94..46,101.65 rows=24,764 width=1,825) (actual time=0.187..224.215 rows=24,730 loops=1)

5. 9.342 197.880 ↑ 1.0 24,730 1

Nested Loop (cost=1.66..38,670.66 rows=24,764 width=1,817) (actual time=0.179..197.880 rows=24,730 loops=1)

6. 0.706 188.538 ↑ 1.0 24,730 1

Nested Loop (cost=1.66..38,360.10 rows=24,764 width=1,301) (actual time=0.157..188.538 rows=24,730 loops=1)

7. 3.180 163.102 ↑ 1.0 24,730 1

Nested Loop Left Join (cost=1.39..31,166.32 rows=24,764 width=1,273) (actual time=0.143..163.102 rows=24,730 loops=1)

8. 2.375 135.192 ↑ 1.0 24,730 1

Nested Loop (cost=1.12..23,972.55 rows=24,764 width=1,237) (actual time=0.133..135.192 rows=24,730 loops=1)

9. 0.000 108.087 ↑ 1.0 24,730 1

Nested Loop (cost=0.97..19,942.73 rows=24,764 width=1,202) (actual time=0.116..108.087 rows=24,730 loops=1)

10. 3.720 85.397 ↑ 1.0 24,730 1

Nested Loop (cost=0.83..16,045.79 rows=24,764 width=1,190) (actual time=0.106..85.397 rows=24,730 loops=1)

11. 19.390 56.947 ↑ 1.0 24,730 1

Nested Loop (cost=0.56..8,852.01 rows=24,764 width=1,166) (actual time=0.086..56.947 rows=24,730 loops=1)

12. 0.000 37.557 ↑ 1.0 24,730 1

Nested Loop (cost=0.42..5,023.00 rows=24,764 width=646) (actual time=0.073..37.557 rows=24,730 loops=1)

13. 14.022 14.022 ↑ 1.0 24,730 1

Index Scan using "planillaruteo_UQ_PlanillaRuteo_LegacyPK" on planillaruteo "Extent1" (cost=0.29..1,193.99 rows=24,764 width=126) (actual time=0.042..14.022 rows=24,730 loops=1)

  • Index Cond: (idempresa = 1)
  • Filter: (activo AND (estado = 1))
  • Rows Removed by Filter: 83
14. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.deposito" on deposito "Extent2" (cost=0.14..0.16 rows=1 width=528) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".iddepositoorigen)
15. 0.000 0.000 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.deposito" on deposito "Extent3" (cost=0.14..0.16 rows=1 width=528) (actual time=0.000..0.000 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".iddepositodestino)
16. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.empleado" on empleado "Extent4" (cost=0.27..0.29 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".idempleado)
17. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "chofer_IX_ID" on chofer "Extent5" (cost=0.14..0.16 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".idchofer)
18. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.movil" on movil "Extent6" (cost=0.14..0.16 rows=1 width=43) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".idmovil)
19. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.empleado" on empleado "Extent7" (cost=0.27..0.29 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: ("Extent1".idempleadoayudante = id)
20. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.empleado" on empleado "Extent8" (cost=0.27..0.29 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: (id = "Extent1".idempleadoencargado)
21. 0.000 0.000 ↑ 1.0 1 24,730

Materialize (cost=0.00..1.02 rows=1 width=524) (actual time=0.000..0.000 rows=1 loops=24,730)

22. 0.017 0.017 ↑ 1.0 1 1

Seq Scan on empresa "Extent9" (cost=0.00..1.01 rows=1 width=524) (actual time=0.014..0.017 rows=1 loops=1)

  • Filter: (id = 1)
23. 24.730 24.730 ↑ 1.0 1 24,730

Index Scan using "PK_dbo.lotefacturacion" on lotefacturacion "Extent10" (cost=0.28..0.30 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=24,730)

  • Index Cond: ("Extent1".idlotefacturacion = id)
24. 0.000 1,261.230 ↑ 1.0 1 24,730

Limit (cost=83.18..83.19 rows=1 width=12) (actual time=0.051..0.051 rows=1 loops=24,730)

25. 49.460 1,261.230 ↑ 27.0 1 24,730

Sort (cost=83.18..83.25 rows=27 width=12) (actual time=0.051..0.051 rows=1 loops=24,730)

  • Sort Key: "Extent13".nroviajemovil DESC
  • Sort Method: quicksort Memory: 25kB
26. 26.400 1,211.770 ↑ 1.6 17 24,730

Nested Loop (cost=1.13..83.05 rows=27 width=12) (actual time=0.006..0.049 rows=17 loops=24,730)

27. 199.464 766.630 ↑ 1.6 17 24,730

Nested Loop (cost=0.84..74.77 rows=27 width=12) (actual time=0.004..0.031 rows=17 loops=24,730)

28. 148.380 148.380 ↑ 1.6 17 24,730

Index Scan using detalleplanillaruteo_idplanillaruteo_idx on detalleplanillaruteo "Extent12" (cost=0.42..3.22 rows=27 width=8) (actual time=0.002..0.006 rows=17 loops=24,730)

  • Index Cond: (idplanillaruteo = "Extent1".id)
  • Filter: (idempresa = "Extent1".idempresa)
29. 418.786 418.786 ↑ 1.0 1 418,786

Index Scan using "detalleviajemovil_IX_IDDetallePlanillaRuteo" on detalleviajemovil "Extent11" (cost=0.42..2.64 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=418,786)

  • Index Cond: (iddetalleplanillaruteo = "Extent12".id)
  • Filter: activo
  • Rows Removed by Filter: 0
30. 418.740 418.740 ↑ 1.0 1 418,740

Index Scan using "PK_dbo.viajemovil" on viajemovil "Extent13" (cost=0.29..0.31 rows=1 width=16) (actual time=0.001..0.001 rows=1 loops=418,740)

  • Index Cond: (id = "Extent11".idviajemovil)
31.          

SubPlan (forNested Loop Left Join)

32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..74.71 rows=27 width=0) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Index Scan using detalleplanillaruteo_idplanillaruteo_idx on detalleplanillaruteo "Extent16" (cost=0.42..3.16 rows=27 width=8) (never executed)

  • Index Cond: ("Extent1".id = idplanillaruteo)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using "detalleviajemovil_IX_IDDetallePlanillaRuteo" on detalleviajemovil "Extent17" (cost=0.42..2.64 rows=1 width=8) (never executed)

  • Index Cond: (iddetalleplanillaruteo = "Extent16".id)
  • Filter: activo
35. 112.793 369.838 ↓ 1.0 419,221 1

Merge Join (cost=2.13..31,590.70 rows=418,734 width=8) (actual time=0.060..369.838 rows=419,221 loops=1)

  • Merge Cond: ("Extent16_1".id = "Extent17_1".iddetalleplanillaruteo)
36. 95.581 95.581 ↑ 1.0 420,444 1

Index Scan using "PK_dbo.detalleplanillaruteo" on detalleplanillaruteo "Extent16_1" (cost=0.42..12,566.80 rows=420,494 width=16) (actual time=0.030..95.581 rows=420,444 loops=1)

37. 161.464 161.464 ↓ 1.0 419,221 1

Index Scan using "detalleviajemovil_IX_IDDetallePlanillaRuteo" on detalleviajemovil "Extent17_1" (cost=0.42..12,773.67 rows=418,734 width=8) (actual time=0.024..161.464 rows=419,221 loops=1)

  • Filter: activo
  • Rows Removed by Filter: 8388
38. 0.020 0.070 ↑ 1.0 1 10

Nested Loop (cost=0.41..0.71 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=10)

39. 0.040 0.040 ↑ 1.0 1 10

Index Only Scan using "chofer_IX_ID" on chofer "Extent15" (cost=0.14..0.21 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=10)

  • Index Cond: (id = "Extent5".id)
  • Heap Fetches: 10
40. 0.010 0.010 ↑ 1.0 1 10

Index Scan using "PK_dbo.empleado" on empleado "Extent14" (cost=0.27..0.50 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=10)

  • Index Cond: (id = "Extent15".id)
Planning time : 82.311 ms
Execution time : 1,946.149 ms