-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(performance): added missing indexes to
schema_log
table (#6154)
- Loading branch information
1 parent
e0ad05e
commit 7b9aacc
Showing
3 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/migrations/src/actions/2024.12.23T00-00-00.improve-version-index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { type MigrationExecutor } from '../pg-migrator'; | ||
|
||
// See https://github.com/graphql-hive/console/pull/6154 | ||
export default { | ||
name: '2024.12.23T00-00-00.improve-version-index.ts', | ||
noTransaction: true, | ||
run: ({ sql }) => [ | ||
{ | ||
name: `create "schema_log"."action" with "created_at" sort index`, | ||
query: sql`CREATE INDEX CONCURRENTLY idx_schema_log_action_created ON schema_log(action, created_at DESC);`, | ||
}, | ||
{ | ||
name: `create "schema_log"."action" + "service_name" index`, | ||
query: sql`CREATE INDEX CONCURRENTLY idx_schema_log_action_service ON schema_log(action, lower(service_name));`, | ||
}, | ||
], | ||
} satisfies MigrationExecutor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.