fix(server): index hot Postgres query paths (#2218)
This commit is contained in:
@@ -80,7 +80,10 @@ export const account = pgTable(
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
},
|
||||
table => [index('account_userId_idx').on(table.userId)],
|
||||
table => [
|
||||
index('account_userId_idx').on(table.userId),
|
||||
index('account_account_id_provider_id_idx').on(table.accountId, table.providerId),
|
||||
],
|
||||
)
|
||||
|
||||
export const verification = pgTable(
|
||||
|
||||
@@ -95,6 +95,7 @@ export const messages = pgTable(
|
||||
deletedAt: timestamp('deleted_at'),
|
||||
},
|
||||
table => [
|
||||
index('messages_chat_id_seq_idx').on(table.chatId, table.seq),
|
||||
index('messages_chat_id_seq_active_idx')
|
||||
.on(table.chatId, table.seq)
|
||||
.where(sql`${table.deletedAt} IS NULL`),
|
||||
|
||||
Reference in New Issue
Block a user