-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize GetRefs, correct and add indexes on ref table (#1284)
* Correct index on ref table, add path index for get refs optimization * Fix gorm tags on ref table * Fix typo * fix goose migration tags * add pg_trgm extension
- Loading branch information
1 parent
e005129
commit f028050
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
|
||
## Content negotiation | ||
|
||
|
||
### URI Schemes | ||
* http | ||
* https | ||
|
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,20 @@ | ||
-- +goose Up | ||
|
||
-- Enable pg_trgm extension | ||
CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
|
||
-- Dropping incorrect index on the 'name' column | ||
DROP INDEX IF EXISTS "idx_name_gin:gin"; | ||
|
||
-- Creating a new GIN index for full-text search on the 'name' column | ||
CREATE INDEX idx_name_gin ON public.reference_objects | ||
USING gin(to_tsvector('english', name)); | ||
|
||
-- Creating a new GIN index for trigram matching on the 'path' column | ||
CREATE INDEX idx_path_gin_trgm ON public.reference_objects USING gin(path gin_trgm_ops); | ||
|
||
-- +goose Down | ||
|
||
DROP INDEX IF EXISTS idx_path_gin_trgm; | ||
DROP INDEX IF EXISTS idx_name_gin; | ||
CREATE INDEX IF NOT EXISTS "idx_name_gin:gin" ON public.reference_objects USING btree (name); |