explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gNbG

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 1,914.436 ↑ 1.0 10 1

Limit (cost=97.99..6,182.55 rows=10 width=1,946) (actual time=1,897.877..1,914.436 rows=10 loops=1)

2. 0.065 1,914.426 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=97.99..7,534,001.40 rows=12,382 width=1,946) (actual time=1,897.875..1,914.426 rows=10 loops=1)

3. 93.268 1,914.301 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=97.58..7,523,976.36 rows=12,382 width=1,829) (actual time=1,897.806..1,914.301 rows=10 loops=1)

  • Filter: ((NOT (alternatives: SubPlan 1 or hashed SubPlan 2)) OR (4 = "Extent11".estado))
  • Rows Removed by Filter: 24719
4. 2.176 230.155 ↑ 1.0 24,729 1

Nested Loop Left Join (cost=1.94..46,101.65 rows=24,764 width=1,825) (actual time=0.471..230.155 rows=24,729 loops=1)

5. 10.386 203.250 ↑ 1.0 24,729 1

Nested Loop (cost=1.66..38,670.66 rows=24,764 width=1,817) (actual time=0.461..203.250 rows=24,729 loops=1)

6. 1.407 192.864 ↑ 1.0 24,729 1

Nested Loop (cost=1.66..38,360.10 rows=24,764 width=1,301) (actual time=0.378..192.864 rows=24,729 loops=1)

7. 4.057 166.728 ↑ 1.0 24,729 1

Nested Loop Left Join (cost=1.39..31,166.32 rows=24,764 width=1,273) (actual time=0.308..166.728 rows=24,729 loops=1)

8. 2.423 137.942 ↑ 1.0 24,729 1

Nested Loop (cost=1.12..23,972.55 rows=24,764 width=1,237) (actual time=0.215..137.942 rows=24,729 loops=1)

9. 0.000 110.790 ↑ 1.0 24,729 1

Nested Loop (cost=0.97..19,942.73 rows=24,764 width=1,202) (actual time=0.200..110.790 rows=24,729 loops=1)

10. 4.681 87.083 ↑ 1.0 24,729 1

Nested Loop (cost=0.83..16,045.79 rows=24,764 width=1,190) (actual time=0.186..87.083 rows=24,729 loops=1)

11. 20.541 57.673 ↑ 1.0 24,729 1

Nested Loop (cost=0.56..8,852.01 rows=24,764 width=1,166) (actual time=0.172..57.673 rows=24,729 loops=1)

12. 0.000 37.132 ↑ 1.0 24,729 1

Nested Loop (cost=0.42..5,023.00 rows=24,764 width=646) (actual time=0.162..37.132 rows=24,729 loops=1)

13. 12.853 12.853 ↑ 1.0 24,729 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.132..12.853 rows=24,729 loops=1)

  • Index Cond: (idempresa = 1)
  • Filter: (activo AND (estado = 1))
  • Rows Removed by Filter: 84
14. 24.729 24.729 ↑ 1.0 1 24,729

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

22. 0.023 0.023 ↑ 1.0 1 1

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

  • Filter: (id = 1)
23. 24.729 24.729 ↑ 1.0 1 24,729

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

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

Limit (cost=95.63..95.64 rows=1 width=12) (actual time=0.052..0.052 rows=1 loops=24,729)

25. 74.187 1,285.908 ↑ 27.0 1 24,729

Sort (cost=95.63..95.70 rows=27 width=12) (actual time=0.052..0.052 rows=1 loops=24,729)

  • Sort Key: "Extent13".nroviajemovil DESC
  • Sort Method: quicksort Memory: 25kB
26. 1.654 1,211.721 ↑ 1.6 17 24,729

Nested Loop (cost=1.13..95.50 rows=27 width=12) (actual time=0.005..0.049 rows=17 loops=24,729)

27. 248.898 791.328 ↑ 1.6 17 24,729

Nested Loop (cost=0.84..87.23 rows=27 width=12) (actual time=0.004..0.032 rows=17 loops=24,729)

28. 123.645 123.645 ↑ 1.6 17 24,729

Index Scan using "detalleplanillaruteo_UQ_DetallePlanillaRuteo_LegacyPK" on detalleplanillaruteo "Extent12" (cost=0.42..15.68 rows=27 width=8) (actual time=0.002..0.005 rows=17 loops=24,729)

  • Index Cond: ((idempresa = "Extent1".idempresa) AND (idplanillaruteo = "Extent1".id))
29. 418.785 418.785 ↑ 1.0 1 418,785

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

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

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

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

SubPlan (forNested Loop Left Join)

32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..5,548.29 rows=27 width=0) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Index Scan using "detalleplanillaruteo_UQ_DetallePlanillaRuteo_LegacyPK" on detalleplanillaruteo "Extent16" (cost=0.42..5,476.74 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. 103.451 304.970 ↓ 1.0 419,050 1

Merge Join (cost=2.13..31,595.54 rows=418,569 width=8) (actual time=0.218..304.970 rows=419,050 loops=1)

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

Index Scan using "PK_dbo.detalleplanillaruteo" on detalleplanillaruteo "Extent16_1" (cost=0.42..12,577.46 rows=421,205 width=16) (actual time=0.046..78.463 rows=420,439 loops=1)

37. 123.056 123.056 ↓ 1.0 419,050 1

Index Scan using "detalleviajemovil_IX_IDDetallePlanillaRuteo" on detalleviajemovil "Extent17_1" (cost=0.42..12,768.04 rows=418,569 width=8) (actual time=0.094..123.056 rows=419,050 loops=1)

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

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

39. 0.030 0.030 ↑ 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.003..0.003 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 : 73.806 ms
Execution time : 1,915.733 ms