Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deleted related MySQL application index #5102

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pkg/datastore/mysql/ensurer/indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ CREATE INDEX application_disabled_updated_at_desc ON Application (Disabled, Upda
ALTER TABLE Application ADD COLUMN Name VARCHAR(50) GENERATED ALWAYS AS (data->>"$.name") VIRTUAL NOT NULL;
CREATE INDEX application_name_updated_at_desc ON Application (Name, UpdatedAt DESC);

-- index on `Deleted` and `CreatedAt` ASC
-- TODO: Reconsider make this Deleted column as STORED GENERATED COLUMN
ALTER TABLE Application ADD COLUMN Deleted BOOL GENERATED ALWAYS AS (IF(data->>"$.deleted" = 'true', True, False)) VIRTUAL NOT NULL;
CREATE INDEX application_deleted_created_at_asc ON Application (Deleted, CreatedAt);

-- index on `Kind` ASC and `UpdatedAt` DESC
ALTER TABLE Application ADD COLUMN Kind INT GENERATED ALWAYS AS (IFNULL(data->>"$.kind", 0)) VIRTUAL NOT NULL;
CREATE INDEX application_kind_updated_at_desc ON Application (Kind, UpdatedAt DESC);
Expand All @@ -32,6 +27,9 @@ CREATE INDEX application_piped_id_updated_at_desc ON Application (PipedId, Updat
-- TODO: Should remove this statement after few releases.
DROP INDEX application_piped_id ON Application;

-- TODO: Should remove this statement after few releases.
DROP INDEX application_deleted_created_at_asc ON Application;

--
-- Command table indexes
--
Expand Down
Loading