add index to last connection for improved search speed
This commit is contained in:
parent
b002991686
commit
8f20a2e2cd
@ -88,7 +88,8 @@ namespace Data.Context
|
||||
// make network id unique
|
||||
modelBuilder.Entity<EFClient>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.NetworkId);
|
||||
entity.HasIndex(client => client.NetworkId);
|
||||
entity.HasIndex(client => client.LastConnection);
|
||||
entity.HasAlternateKey(client => new
|
||||
{
|
||||
client.NetworkId,
|
||||
|
1641
Data/Migrations/MySql/20230124030137_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
1641
Data/Migrations/MySql/20230124030137_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Data.Migrations.MySql
|
||||
{
|
||||
public partial class AddLastConnectionIndexEFClient : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients",
|
||||
column: "LastConnection");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients");
|
||||
}
|
||||
}
|
||||
}
|
@ -96,6 +96,8 @@ namespace Data.Migrations.MySql
|
||||
|
||||
b.HasIndex("CurrentAliasId");
|
||||
|
||||
b.HasIndex("LastConnection");
|
||||
|
||||
b.HasIndex("NetworkId");
|
||||
|
||||
b.ToTable("EFClients", (string)null);
|
||||
|
1698
Data/Migrations/Postgresql/20230124030240_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
1698
Data/Migrations/Postgresql/20230124030240_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Data.Migrations.Postgresql
|
||||
{
|
||||
public partial class AddLastConnectionIndexEFClient : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients",
|
||||
column: "LastConnection");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients");
|
||||
}
|
||||
}
|
||||
}
|
@ -103,6 +103,8 @@ namespace Data.Migrations.Postgresql
|
||||
|
||||
b.HasIndex("CurrentAliasId");
|
||||
|
||||
b.HasIndex("LastConnection");
|
||||
|
||||
b.HasIndex("NetworkId");
|
||||
|
||||
b.ToTable("EFClients", (string)null);
|
||||
|
1639
Data/Migrations/Sqlite/20230124025802_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
1639
Data/Migrations/Sqlite/20230124025802_AddLastConnectionIndexEFClient.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Data.Migrations.Sqlite
|
||||
{
|
||||
public partial class AddLastConnectionIndexEFClient : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients",
|
||||
column: "LastConnection");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_EFClients_LastConnection",
|
||||
table: "EFClients");
|
||||
}
|
||||
}
|
||||
}
|
@ -94,6 +94,8 @@ namespace Data.Migrations.Sqlite
|
||||
|
||||
b.HasIndex("CurrentAliasId");
|
||||
|
||||
b.HasIndex("LastConnection");
|
||||
|
||||
b.HasIndex("NetworkId");
|
||||
|
||||
b.ToTable("EFClients", (string)null);
|
||||
|
Loading…
Reference in New Issue
Block a user