mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 00:43:49 +01:00
[backend] Add multi column index for userHost to note table
This drastically improves local and social timeline performance
This commit is contained in:
parent
eff0f32dc1
commit
6e82e18eea
@ -0,0 +1,13 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddNoteIdUserhostIdx1700623165718 implements MigrationInterface {
|
||||
name = 'AddNoteIdUserhostIdx1700623165718'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE INDEX "IDX_note_id_userHost" ON "note" ("id", "userHost") `);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP INDEX "public"."IDX_note_id_userHost"`);
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import { Channel } from "./channel.js";
|
||||
@Index("IDX_NOTE_MENTIONS", { synchronize: false })
|
||||
@Index("IDX_NOTE_VISIBLE_USER_IDS", { synchronize: false })
|
||||
@Index("IDX_note_userId_id", ["userId", "id"])
|
||||
@Index("IDX_note_id_userHost", ["id", "userHost"])
|
||||
export class Note {
|
||||
@PrimaryColumn(id())
|
||||
public id: string;
|
||||
|
Loading…
Reference in New Issue
Block a user