explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oiAp

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

Limit (cost=97.99..6,182.55 rows=10 width=1,946) (actual time=2,216.479..2,234.496 rows=10 loops=1)

2. 0.068 2,234.487 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=97.99..7,534,001.88 rows=12,382 width=1,946) (actual time=2,216.478..2,234.487 rows=10 loops=1)

3. 111.877 2,234.279 ↑ 1,238.2 10 1

Nested Loop Left Join (cost=97.58..7,523,976.84 rows=12,382 width=1,829) (actual time=2,216.336..2,234.279 rows=10 loops=1)

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

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

5. 9.413 206.475 ↑ 1.0 24,729 1

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

6. 0.632 197.062 ↑ 1.0 24,729 1

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

7. 3.686 171.701 ↑ 1.0 24,729 1

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

8. 1.829 143.286 ↑ 1.0 24,729 1

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

9. 0.000 116.728 ↑ 1.0 24,729 1

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

10. 4.819 93.387 ↑ 1.0 24,729 1

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

11. 19.587 63.839 ↑ 1.0 24,729 1

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

12. 0.000 44.252 ↑ 1.0 24,729 1

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

13. 19.672 19.672 ↑ 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.294..19.672 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.026 0.026 ↑ 1.0 1 1

Seq Scan on empresa "Extent9" (cost=0.00..1.01 rows=1 width=524) (actual time=0.022..0.026 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. 24.729 1,310.637 ↑ 1.0 1 24,729

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

25. 49.458 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. 26.383 1,236.450 ↑ 1.6 17 24,729

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

27. 199.440 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. 173.103 173.103 ↑ 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.007 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. 118.679 576.570 ↓ 1.0 418,929 1

Merge Join (cost=2.13..31,597.48 rows=418,366 width=8) (actual time=0.062..576.570 rows=418,929 loops=1)

  • Merge Cond: ("Extent16_1".id = "Extent17_1".iddetalleplanillaruteo)
36. 185.005 185.005 ↑ 1.0 419,840 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.036..185.005 rows=419,840 loops=1)

37. 272.886 272.886 ↓ 1.0 418,929 1

Index Scan using "detalleviajemovil_IX_IDDetallePlanillaRuteo" on detalleviajemovil "Extent17_1" (cost=0.42..12,762.93 rows=418,366 width=8) (actual time=0.019..272.886 rows=418,929 loops=1)

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

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

39. 0.020 0.020 ↑ 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.002..0.002 rows=1 loops=10)

  • Index Cond: (id = "Extent5".id)
  • Heap Fetches: 10
40. 0.100 0.100 ↑ 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.010..0.010 rows=1 loops=10)

  • Index Cond: (id = "Extent15".id)
Planning time : 103.237 ms
Execution time : 2,246.894 ms