-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an issue with the postgres indices as they weren't being used pro…
…perly (#92)
- Loading branch information
Showing
4 changed files
with
17 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
12 changes: 12 additions & 0 deletions
12
postgres-persistence/src/main/resources/db/migration_postgres/V9__indexing_index_fix.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,12 @@ | ||
-- Drop the unused text index on the json_data column | ||
DROP INDEX CONCURRENTLY IF EXISTS workflow_index_json_data_text_idx; | ||
-- Create a new index to enable querying the json by attribute and value | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS workflow_index_json_data_gin_idx ON workflow_index USING GIN (json_data jsonb_path_ops); | ||
|
||
-- Drop the incorrectly created indices on the workflow_index that should be on the task_index table | ||
DROP INDEX CONCURRENTLY IF EXISTS task_index_json_data_json_idx; | ||
DROP INDEX CONCURRENTLY IF EXISTS task_index_json_data_text_idx; | ||
-- Create the full text index on the json_data column of the task_index table | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS task_index_json_data_json_idx ON task_index USING GIN (jsonb_to_tsvector('english', json_data, '["all"]')); | ||
-- Create a new index to enable querying the json by attribute and value | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS task_index_json_data_gin_idx ON task_index USING GIN (json_data jsonb_path_ops); |
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