forked from appsmithorg/appsmith
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improvements in codebase - index, migrations for postgres (app…
…smithorg#34235) ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes appsmithorg#34042 Fixes appsmithorg#34064 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
- Loading branch information
Showing
5 changed files
with
24 additions
and
17 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
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
27 changes: 13 additions & 14 deletions
27
appsmith-server/src/main/java/com/appsmith/server/migrations/ce/V003__createIndexes.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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
create unique index if not exists u_name_config on config(name); | ||
create unique index if not exists u_email_pass_reset_token on password_reset_token(email); | ||
create unique index if not exists u_email_user on "user"(email); | ||
create unique index if not exists u_name_sequence on sequence(name); | ||
create unique index if not exists plugin_name_package_name_version_index on plugin(plugin_name, package_name, version); | ||
create unique index if not exists u_user_id on user_data(user_id); | ||
create unique index if not exists u_workspace_datasource_deleted on datasource(workspace_id, name, deleted_at); | ||
CREATE UNIQUE INDEX if not exists u_workspace_datasource ON datasource (workspace_id, name) WHERE deleted_at IS NULL; | ||
create unique index if not exists u_workspace_app_deleted on application(workspace_id, name, deleted_at) where git_application_metadata is null; | ||
create unique index if not exists u_workspace_app on application(workspace_id, name) where deleted_at is null and git_application_metadata is null; | ||
create unique index if not exists u_workspace_app_deleted_git_application_metadata on application(workspace_id, name, deleted_at, (git_application_metadata ->> 'remoteUrl'), (git_application_metadata ->>'branchName')); | ||
create unique index if not exists u_workspace_app_git_application_metadata on application(workspace_id, name, (git_application_metadata ->> 'remoteUrl'), (git_application_metadata ->>'branchName')) WHERE deleted_at is NULL; | ||
create unique index if not exists u_dsConfigStructure_dsId_envId on datasource_storage_structure(datasource_id, environment_id); | ||
create unique index if not exists u_applicationId_chunkOrder on application_snapshot(application_id, chunk_order); | ||
-- index naming convention: (pkey reserved for primary keys) | ||
-- unique constraint index - table_name_column_name_key | ||
-- performance improvement index - table_name_column_name_idx | ||
create unique index if not exists config_name_key on config(name) ; | ||
create unique index if not exists prt_email_key on password_reset_token(email); | ||
create unique index if not exists user_email_key on "user"(email); | ||
create unique index if not exists sequence_name_key on sequence(name); | ||
create unique index if not exists plugin_name_package_name_version_key on plugin(plugin_name, package_name, version) NULLS NOT DISTINCT; | ||
create unique index if not exists user_id_key on user_data(user_id); | ||
create unique index if not exists datasource_workspace_name_deleted_key on datasource(workspace_id, name, deleted_at) NULLS NOT DISTINCT; | ||
create unique index if not exists application_workspace_name_deleted_git_application_metadata_key on application(workspace_id, name, deleted_at, (git_application_metadata ->> 'remoteUrl'), (git_application_metadata ->>'branchName')) NULLS NOT DISTINCT; | ||
create unique index if not exists dss_datasource_env_key on datasource_storage_structure(datasource_id, environment_id) NULLS NOT DISTINCT; | ||
create unique index if not exists application_snapshot_application_chunkOrder_key on application_snapshot(application_id, chunk_order) NULLS NOT DISTINCT; |
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