1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 11:02:57 +08:00

Further improve beatmap carousel load performance by avoiding incorrect query construction

This commit is contained in:
Dean Herbert 2020-04-29 16:51:22 +09:00
parent 68fe3e12bc
commit d1ec99ffd9

View File

@ -300,7 +300,7 @@ namespace osu.Game.Beatmaps
/// </summary>
/// <param name="includes">The level of detail to include in the returned objects.</param>
/// <returns>A list of available <see cref="BeatmapSetInfo"/>.</returns>
public IQueryable<BeatmapSetInfo> GetAllUsableBeatmapSetsEnumerable(IncludedDetails includes)
public IEnumerable<BeatmapSetInfo> GetAllUsableBeatmapSetsEnumerable(IncludedDetails includes)
{
IQueryable<BeatmapSetInfo> queryable;
@ -319,7 +319,10 @@ namespace osu.Game.Beatmaps
break;
}
return queryable.Where(s => !s.DeletePending && !s.Protected);
// AsEnumerable used here to avoid applying the WHERE in sql. When done so, ef core 2.x uses an incorrect ORDER BY
// clause which causes queries to take 5-10x longer.
// TODO: remove if upgrading to EF core 3.x.
return queryable.AsEnumerable().Where(s => !s.DeletePending && !s.Protected);
}
/// <summary>