Skip to content

Commit

Permalink
feat(performance): added missing indexes to schema_log table (#6154)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored Dec 23, 2024
1 parent e0ad05e commit 7b9aacc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
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;
1 change: 1 addition & 0 deletions packages/migrations/src/run-pg-migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,6 @@ export const runPGMigrations = async (args: { slonik: DatabasePool; runTo?: stri
await import('./actions/2024.11.12T00-00-00.supertokens-9.1'),
await import('./actions/2024.11.12T00-00-00.supertokens-9.2'),
await import('./actions/2024.11.12T00-00-00.supertokens-9.3'),
await import('./actions/2024.12.23T00-00-00.improve-version-index'),
],
});
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b9aacc

Please sign in to comment.