diff options
| author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2020-08-20 17:17:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-20 17:17:55 +0900 |
| commit | eb70d6f22674bbc3b3b0e03c1b62376c0d5c6f81 (patch) | |
| tree | c789d3d14080e3d2540c67f3893e0c573391bb85 | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-eb70d6f22674bbc3b3b0e03c1b62376c0d5c6f81.tar.gz misskey-eb70d6f22674bbc3b3b0e03c1b62376c0d5c6f81.tar.bz2 misskey-eb70d6f22674bbc3b3b0e03c1b62376c0d5c6f81.zip | |
Fix a slow query on channel timeline (#6663)
| -rw-r--r-- | migration/1597893996136-ChannelNoteIdDescIndex.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/migration/1597893996136-ChannelNoteIdDescIndex.ts b/migration/1597893996136-ChannelNoteIdDescIndex.ts new file mode 100644 index 0000000000..6cbd865fc6 --- /dev/null +++ b/migration/1597893996136-ChannelNoteIdDescIndex.ts @@ -0,0 +1,16 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class ChannelNoteIdDescIndex1597893996136 implements MigrationInterface { + name = 'ChannelNoteIdDescIndex1597893996136' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); + await queryRunner.query(`CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("channelId", "id" desc)`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`DROP INDEX "IDX_note_on_channelId_and_id_desc"`); + await queryRunner.query(`CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `); + } + +} |