Optimise file lookups and other database operations

FirstOrDefault when called on a TableQuery with a predicate doesn't use table indices
This commit is contained in:
Dean Herbert
2017-08-01 17:37:21 +09:00
parent e7e822ecd5
commit 3b1166d1e6
5 changed files with 10 additions and 12 deletions

View File

@ -62,7 +62,7 @@ namespace osu.Game.Rulesets
{
var us = createRulesetInfo(r);
var existing = Query<RulesetInfo>().FirstOrDefault(ri => ri.InstantiationInfo == us.InstantiationInfo);
var existing = Query<RulesetInfo>().Where(ri => ri.InstantiationInfo == us.InstantiationInfo).FirstOrDefault();
if (existing == null)
Connection.Insert(us);