explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s1RQ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 20.789 82,731.723 ↓ 15.0 15 1

Limit (cost=4,955,322.19..4,955,451.04 rows=1 width=579) (actual time=82,703.838..82,731.723 rows=15 loops=1)

2. 25,688.327 82,710.934 ↓ 1.2 45,045 1

WindowAgg (cost=143.20..4,955,322.19 rows=38,456 width=579) (actual time=410.963..82,710.934 rows=45,045 loops=1)

3. 40.084 310.952 ↓ 1.2 45,054 1

Nested Loop (cost=143.20..15,552.85 rows=38,456 width=528) (actual time=2.947..310.952 rows=45,054 loops=1)

4. 26.432 180.760 ↓ 1.2 45,054 1

Hash Join (cost=142.92..4,277.52 rows=38,456 width=507) (actual time=2.913..180.760 rows=45,054 loops=1)

  • Hash Cond: ("Route"."Id" = "ContractorRouteRef"."RouteId")
5. 20.744 152.196 ↓ 1.1 44,119 1

Hash Join (cost=27.87..3,536.71 rows=38,593 width=523) (actual time=0.710..152.196 rows=44,119 loops=1)

  • Hash Cond: ("Artifact"."RepairActualId" = "ActualOverhaulMethod"."Id")
6. 23.335 131.337 ↓ 1.1 44,119 1

Hash Join (cost=25.88..3,423.66 rows=38,593 width=477) (actual time=0.559..131.337 rows=44,119 loops=1)

  • Hash Cond: ("Artifact"."RepairStatedId" = "StatedOverhaulMethod"."Id")
7. 17.064 107.953 ↓ 1.1 44,119 1

Hash Join (cost=23.89..3,310.60 rows=38,593 width=431) (actual time=0.443..107.953 rows=44,119 loops=1)

  • Hash Cond: ("Artifact"."StatusId" = "StatusType"."Id")
8. 20.435 90.872 ↓ 1.1 44,119 1

Hash Join (cost=22.80..3,100.87 rows=38,593 width=408) (actual time=0.401..90.872 rows=44,119 loops=1)

  • Hash Cond: ("Artifact"."OffenceTypeId" = "OffenceType"."Id")
9. 27.165 70.421 ↓ 1.1 44,119 1

Hash Join (cost=21.71..2,891.14 rows=38,593 width=349) (actual time=0.343..70.421 rows=44,119 loops=1)

  • Hash Cond: ("Artifact"."SessionId" = "Session"."Id")
10. 42.960 42.960 ↓ 1.0 44,119 1

Seq Scan on "Artifact" (cost=0.00..2,318.10 rows=44,106 width=238) (actual time=0.012..42.960 rows=44,119 loops=1)

  • Filter: (("StatusId" = 1) OR ("StatusId" = 2) OR ("StatusId" = 3))
  • Rows Removed by Filter: 1
11. 0.024 0.296 ↑ 1.0 7 1

Hash (cost=21.63..21.63 rows=7 width=127) (actual time=0.296..0.296 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
12. 0.012 0.272 ↑ 1.0 7 1

Nested Loop (cost=0.57..21.63 rows=7 width=127) (actual time=0.140..0.272 rows=7 loops=1)

13. 0.025 0.176 ↑ 1.0 7 1

Nested Loop (cost=0.29..19.52 rows=7 width=52) (actual time=0.101..0.176 rows=7 loops=1)

14. 0.007 0.007 ↑ 1.0 8 1

Seq Scan on "Session" (cost=0.00..1.08 rows=8 width=52) (actual time=0.004..0.007 rows=8 loops=1)

15. 0.144 0.144 ↑ 1.0 1 8

Index Scan using "PK_InnerDiagnosticTarget" on "InnerDiagnosticTarget" (cost=0.29..2.31 rows=1 width=32) (actual time=0.018..0.018 rows=1 loops=8)

  • Index Cond: ("Id" = "Session"."DiagnosticTargetId")
16. 0.084 0.084 ↑ 1.0 1 7

Index Scan using "PK_Route" on "Route" (cost=0.28..0.30 rows=1 width=75) (actual time=0.012..0.012 rows=1 loops=7)

  • Index Cond: ("Id" = "InnerDiagnosticTarget"."StartRouteId")
17. 0.009 0.016 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=61) (actual time=0.016..0.016 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
18. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on "OffenceType" (cost=0.00..1.04 rows=4 width=61) (actual time=0.005..0.007 rows=4 loops=1)

19. 0.009 0.017 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=25) (actual time=0.017..0.017 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on "StatusType" (cost=0.00..1.04 rows=4 width=25) (actual time=0.006..0.008 rows=4 loops=1)

21. 0.032 0.049 ↑ 1.0 44 1

Hash (cost=1.44..1.44 rows=44 width=62) (actual time=0.049..0.049 rows=44 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
22. 0.017 0.017 ↑ 1.0 44 1

Seq Scan on "OverhaulMethod" "StatedOverhaulMethod" (cost=0.00..1.44 rows=44 width=62) (actual time=0.006..0.017 rows=44 loops=1)

23. 0.041 0.115 ↑ 1.0 44 1

Hash (cost=1.44..1.44 rows=44 width=62) (actual time=0.114..0.115 rows=44 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
24. 0.074 0.074 ↑ 1.0 44 1

Seq Scan on "OverhaulMethod" "ActualOverhaulMethod" (cost=0.00..1.44 rows=44 width=62) (actual time=0.020..0.074 rows=44 loops=1)

25. 1.418 2.132 ↑ 1.0 3,380 1

Hash (cost=72.80..72.80 rows=3,380 width=32) (actual time=2.131..2.132 rows=3,380 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 244kB
26. 0.714 0.714 ↑ 1.0 3,380 1

Seq Scan on "ContractorRouteRef" (cost=0.00..72.80 rows=3,380 width=32) (actual time=0.010..0.714 rows=3,380 loops=1)

27. 90.108 90.108 ↑ 1.0 1 45,054

Index Scan using "PK_Pipeline" on "Pipeline" (cost=0.27..0.29 rows=1 width=53) (actual time=0.002..0.002 rows=1 loops=45,054)

  • Index Cond: ("Id" = "Route"."PipelineId")
28.          

SubPlan (forWindowAgg)

29. 56,711.655 56,711.655 ↑ 7.0 1 45,045

Foreign Scan on staff_contractor_contractor "Contractor" (cost=100.00..128.41 rows=7 width=32) (actual time=1.258..1.259 rows=1 loops=45,045)

Planning time : 13.414 ms
Execution time : 82,735.614 ms