diff --git a/Iceshrimp.Backend/Core/Database/Migrations/DatabaseContextModelSnapshot.cs b/Iceshrimp.Backend/Core/Database/Migrations/DatabaseContextModelSnapshot.cs
index ce4fc087..e4177fbb 100644
--- a/Iceshrimp.Backend/Core/Database/Migrations/DatabaseContextModelSnapshot.cs
+++ b/Iceshrimp.Backend/Core/Database/Migrations/DatabaseContextModelSnapshot.cs
@@ -1527,8 +1527,12 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex("Host")
.IsUnique();
+ b.HasIndex("IncomingFollows");
+
b.HasIndex("IsSuspended");
+ b.HasIndex("OutgoingFollows");
+
b.ToTable("instance");
});
diff --git a/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta1/20240424224008_AddInstanceTableIndicies.cs b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta1/20240424224008_AddInstanceTableIndicies.cs
new file mode 100644
index 00000000..f3cab501
--- /dev/null
+++ b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta1/20240424224008_AddInstanceTableIndicies.cs
@@ -0,0 +1,39 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+
+#nullable disable
+
+namespace Iceshrimp.Backend.Core.Database.Migrations
+{
+ ///
+ [DbContext(typeof(DatabaseContext))]
+ [Migration("20240424224008_AddInstanceTableIndicies")]
+ public partial class AddInstanceTableIndicies : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateIndex(
+ name: "IX_instance_incomingFollows",
+ table: "instance",
+ column: "incomingFollows");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_instance_outgoingFollows",
+ table: "instance",
+ column: "outgoingFollows");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropIndex(
+ name: "IX_instance_incomingFollows",
+ table: "instance");
+
+ migrationBuilder.DropIndex(
+ name: "IX_instance_outgoingFollows",
+ table: "instance");
+ }
+ }
+}
diff --git a/Iceshrimp.Backend/Core/Database/Tables/Instance.cs b/Iceshrimp.Backend/Core/Database/Tables/Instance.cs
index ddb9b1b7..b0673339 100644
--- a/Iceshrimp.Backend/Core/Database/Tables/Instance.cs
+++ b/Iceshrimp.Backend/Core/Database/Tables/Instance.cs
@@ -9,6 +9,8 @@ namespace Iceshrimp.Backend.Core.Database.Tables;
[Index(nameof(CaughtAt))]
[Index(nameof(IsSuspended))]
[Index(nameof(Host), IsUnique = true)]
+[Index(nameof(IncomingFollows))]
+[Index(nameof(OutgoingFollows))]
public class Instance
{
[Key]
diff --git a/Iceshrimp.Backend/Core/Database/Tables/Notification.cs b/Iceshrimp.Backend/Core/Database/Tables/Notification.cs
index fe29b04a..d60f4059 100644
--- a/Iceshrimp.Backend/Core/Database/Tables/Notification.cs
+++ b/Iceshrimp.Backend/Core/Database/Tables/Notification.cs
@@ -13,6 +13,7 @@ namespace Iceshrimp.Backend.Core.Database.Tables;
[Index(nameof(CreatedAt))]
[Index(nameof(AppAccessTokenId))]
[Index(nameof(MastoId))]
+[Index(nameof(NoteId))]
public class Notification : IEntity
{
[PgName("notification_type_enum")]