mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
Added indexes for common queries (#8369)
This commit is contained in:
committed by
GitHub
parent
9d1267a94c
commit
35738c1b58
@@ -148,5 +148,15 @@ namespace Orchard.Core.Common {
|
|||||||
|
|
||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom7() {
|
||||||
|
// The Container_Id is basically a foreign key, used in several queries
|
||||||
|
SchemaBuilder.AlterTable(nameof(CommonPartRecord), table => {
|
||||||
|
table.CreateIndex($"IDX_{nameof(CommonPartRecord)}_Container_id",
|
||||||
|
"Container_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,18 @@ namespace Orchard.Localization {
|
|||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom2() {
|
||||||
|
// Most searches will be interested in either the content's culture
|
||||||
|
// or the group of contents that are localizations of one another
|
||||||
|
SchemaBuilder.AlterTable("LocalizationPartRecord", table => {
|
||||||
|
table.CreateIndex($"IDX_LocalizationPartRecord_CultureId",
|
||||||
|
"CultureId");
|
||||||
|
table.CreateIndex($"IDX_LocalizationPartRecord_MasterContentItemId",
|
||||||
|
"MasterContentItemId");
|
||||||
|
});
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[OrchardFeature("Orchard.Localization.Transliteration")]
|
[OrchardFeature("Orchard.Localization.Transliteration")]
|
||||||
|
|||||||
@@ -69,5 +69,15 @@ namespace Orchard.Users {
|
|||||||
|
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int UpdateFrom6() {
|
||||||
|
// users are most commonly searched by NormalizedUserName and or Email
|
||||||
|
SchemaBuilder.AlterTable("UserPartRecord", table => {
|
||||||
|
table.CreateIndex($"IDX_UserPartRecord_NameAndEmail",
|
||||||
|
"NormalizedUserName",
|
||||||
|
"Email");
|
||||||
|
});
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user