perf(server): index asset (ownerId, updateId) for sync (#32624)
(cherry picked from commit 73603bcafe5d1e52434f736476d07c9578f3b888)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { Kysely, sql } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await sql`CREATE INDEX "asset_ownerId_updateId_idx" ON "asset" ("ownerId", "updateId");`.execute(db);
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await sql`DROP INDEX "asset_ownerId_updateId_idx";`.execute(db);
|
||||
}
|
||||
@@ -101,3 +101,4 @@
|
||||
1792213725597-AddAssetFaceAssetState
|
||||
1792511451454-AddPasskeyTable
|
||||
1792517020180-AddUpdateIdIndexes
|
||||
1792568637987-AddAssetOwnerIdUpdateIdIndex
|
||||
|
||||
@@ -56,6 +56,7 @@ import { ASSET_CHECKSUM_CONSTRAINT } from 'src/utils/database.js';
|
||||
})
|
||||
@Index({ columns: ['originalPath', 'libraryId'] })
|
||||
@Index({ columns: ['id', 'stackId'] })
|
||||
@Index({ columns: ['ownerId', 'updateId'] })
|
||||
@Index({
|
||||
name: 'asset_originalFilename_trigram_idx',
|
||||
using: 'gin',
|
||||
|
||||
Reference in New Issue
Block a user