explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mtox

Settings
# exclusive inclusive rows x rows loops node
1. 0.092 22.401 ↑ 1.2 23 1

Sort (cost=2,556.91..2,556.98 rows=27 width=1,412) (actual time=22.400..22.401 rows=23 loops=1)

  • Sort Key: e.""IsTop"" DESC, ((e.""LastNameTranslations"" -> 'ru'::text)), ((e.""FirstNameTranslations"" -> 'ru'::text)), e.""Id"", e1.""Id"", e2.""Id"", p.""Id"
  • Sort Method: quicksort Memory: 62kB
2. 0.018 22.309 ↑ 1.2 23 1

Nested Loop Left Join (cost=2,218.75..2,556.27 rows=27 width=1,412) (actual time=22.202..22.309 rows=23 loops=1)

3. 0.004 22.276 ↑ 1.2 15 1

Nested Loop Left Join (cost=2,218.46..2,412.64 rows=18 width=1,347) (actual time=22.197..22.276 rows=15 loops=1)

4. 0.011 22.200 ↑ 1.0 12 1

Nested Loop Left Join (cost=2,217.91..2,313.38 rows=12 width=1,116) (actual time=22.182..22.200 rows=12 loops=1)

5. 0.002 22.165 ↑ 1.0 12 1

Limit (cost=2,217.62..2,217.65 rows=12 width=1,100) (actual time=22.163..22.165 rows=12 loops=1)

6. 6.079 22.163 ↑ 789.2 12 1

Sort (cost=2,217.62..2,241.30 rows=9,470 width=1,100) (actual time=22.162..22.163 rows=12 loops=1)

  • Sort Key: e.""IsTop"" DESC, ((e.""LastNameTranslations"" -> 'ru'::text)), ((e.""FirstNameTranslations"" -> 'ru'::text))
  • Sort Method: top-N heapsort Memory: 48kB
7. 5.478 16.084 ↑ 1.0 9,470 1

Hash Join (cost=548.11..2,000.53 rows=9,470 width=1,100) (actual time=6.411..16.084 rows=9,470 loops=1)

  • Hash Cond: (e."Id" = e0."EmployeeId")
8. 4.220 4.220 ↑ 1.0 10,670 1

Seq Scan on "Employees" e (cost=0.00..1,271.70 rows=10,670 width=1,036) (actual time=0.009..4.220 rows=10,670 loops=1)

9. 1.235 6.386 ↑ 1.0 9,470 1

Hash (cost=429.74..429.74 rows=9,470 width=16) (actual time=6.386..6.386 rows=9,470 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 572kB
10. 3.746 5.151 ↑ 1.0 9,470 1

HashAggregate (cost=335.04..429.74 rows=9,470 width=16) (actual time=3.948..5.151 rows=9,470 loops=1)

  • Group Key: e0."EmployeeId
11. 1.405 1.405 ↑ 1.0 14,003 1

Seq Scan on "EmployeeDivisionsPositions" e0 (cost=0.00..300.03 rows=14,003 width=16) (actual time=0.004..1.405 rows=14,003 loops=1)

12. 0.024 0.024 ↓ 0.0 0 12

Index Only Scan using "PK_Files" on "Files" f (cost=0.28..7.97 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=12)

  • Index Cond: ("Id" = e."AvatarId")
  • Heap Fetches: 5
13. 0.021 0.072 ↑ 1.0 1 12

Nested Loop (cost=0.56..8.26 rows=1 width=247) (actual time=0.005..0.006 rows=1 loops=12)

14. 0.036 0.036 ↑ 1.0 1 12

Index Scan using "IX_EmployeeDivisionsPositions_EmployeeId" on "EmployeeDivisionsPositions" e2 (cost=0.29..7.97 rows=1 width=48) (actual time=0.003..0.003 rows=1 loops=12)

  • Index Cond: (e."Id" = "EmployeeId")
15. 0.015 0.015 ↑ 1.0 1 15

Index Scan using "PK_Positions" on "Positions" p (cost=0.27..0.29 rows=1 width=215) (actual time=0.001..0.001 rows=1 loops=15)

  • Index Cond: ("Id" = e2."PositionId")
16. 0.015 0.015 ↓ 2.0 2 15

Index Scan using "IX_EmployeeDivisionsPositions_EmployeeId" on "EmployeeDivisionsPositions" e1 (cost=0.29..7.97 rows=1 width=64) (actual time=0.001..0.001 rows=2 loops=15)

  • Index Cond: (e."Id" = "EmployeeId")
Planning time : 0.771 ms
Execution time : 22.497 ms