-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize queries: add indexes and help older query planners.
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/codehelp/migrations/20240716--codehelp--add-indexes.sql
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 @@ | ||
-- SPDX-FileCopyrightText: 2024 Mark Liffiton <[email protected]> | ||
-- | ||
-- SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
BEGIN; | ||
|
||
DROP INDEX IF EXISTS queries_by_user; | ||
CREATE INDEX queries_by_user ON queries(user_id); | ||
DROP INDEX IF EXISTS queries_by_role; | ||
CREATE INDEX queries_by_role ON queries(role_id); | ||
|
||
DROP INDEX IF EXISTS tutor_chats_by_user; | ||
CREATE INDEX tutor_chats_by_user ON tutor_chats(user_id); | ||
DROP INDEX IF EXISTS tutor_chats_by_role; | ||
CREATE INDEX tutor_chats_by_role ON tutor_chats(role_id); | ||
|
||
COMMIT; |
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
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