diff --git a/modules/store/src/main/resources/db/migration/h2/V1.38.0__more_indexes.sql b/modules/store/src/main/resources/db/migration/h2/V1.38.0__more_indexes.sql new file mode 100644 index 00000000..39032bad --- /dev/null +++ b/modules/store/src/main/resources/db/migration/h2/V1.38.0__more_indexes.sql @@ -0,0 +1,79 @@ +create index if not exists addon_archive_cid_idx on addon_archive(cid); +create index if not exists addon_archive_file_id_idx on addon_archive(file_id); +create index if not exists addon_run_config_cid_idx on addon_run_config(cid); +create index if not exists addon_run_config_user_id_idx on addon_run_config(user_id); +create index if not exists addon_run_config_addon_addon_id_idx on addon_run_config_addon(addon_id); +create index if not exists addon_run_config_addon_addon_run_config_id_idx on addon_run_config_addon(addon_run_config_id); +create index if not exists addon_run_config_trigger_addon_run_config_id_idx on addon_run_config_trigger(addon_run_config_id); +create index if not exists attachment_filemetaid_idx on attachment(filemetaid); +create index if not exists attachment_itemid_idx on attachment(itemid); +create index if not exists attachment_archive_id_idx on attachment_archive(id); +create index if not exists attachment_archive_file_id_idx on attachment_archive(file_id); +create index if not exists attachment_preview_id_idx on attachment_preview(id); +create index if not exists attachment_preview_file_id_idx on attachment_preview(file_id); +create index if not exists attachment_source_id_idx on attachment_source(id); +create index if not exists attachment_source_file_id_idx on attachment_source(file_id); +create index if not exists attachmentmeta_attachid_idx on attachmentmeta(attachid); +create index if not exists classifier_model_cid_idx on classifier_model(cid); +create index if not exists classifier_model_file_id_idx on classifier_model(file_id); +create index if not exists classifier_setting_cid_idx on classifier_setting(cid); +create index if not exists client_settings_collective_cid_idx on client_settings_collective(cid); +create index if not exists client_settings_user_id_idx on client_settings_user(user_id); +create index if not exists collective_password_cid_idx on collective_password(cid); +create index if not exists contact_oid_idx on contact(oid); +create index if not exists contact_pid_idx on contact(pid); +create index if not exists custom_field_cid_idx on custom_field(cid); +create index if not exists custom_field_value_field_idx on custom_field_value(field); +create index if not exists custom_field_value_item_id_idx on custom_field_value(item_id); +create index if not exists download_query_cid_idx on download_query(cid); +create index if not exists download_query_file_id_idx on download_query(file_id); +create index if not exists empty_trash_setting_cid_idx on empty_trash_setting(cid); +create index if not exists equipment_cid_idx on equipment(cid); +create index if not exists folder_cid_idx on folder(cid); +create index if not exists folder_owner_idx on folder(owner); +create index if not exists folder_member_folder_id_idx on folder_member(folder_id); +create index if not exists folder_member_user_id_idx on folder_member(user_id); +create index if not exists item_cid_idx on item(cid); +create index if not exists item_concequipment_idx on item(concequipment); +create index if not exists item_folder_id_idx on item(folder_id); +create index if not exists item_corrorg_idx on item(corrorg); +create index if not exists item_concperson_idx on item(concperson); +create index if not exists item_corrperson_idx on item(corrperson); +create index if not exists item_link_cid_idx on item_link(cid); +create index if not exists item_link_item1_idx on item_link(item1); +create index if not exists item_link_item2_idx on item_link(item2); +create index if not exists item_proposal_itemid_idx on item_proposal(itemid); +create index if not exists item_share_user_id_idx on item_share(user_id); +create index if not exists joblog_jid_idx on joblog(jid); +create index if not exists notification_channel_gotify_uid_idx on notification_channel_gotify(uid); +create index if not exists notification_channel_http_uid_idx on notification_channel_http(uid); +create index if not exists notification_channel_mail_uid_idx on notification_channel_mail(uid); +create index if not exists notification_channel_mail_conn_id_idx on notification_channel_mail(conn_id); +create index if not exists notification_channel_matrix_uid_idx on notification_channel_matrix(uid); +create index if not exists notification_hook_uid_idx on notification_hook(uid); +create index if not exists notification_hook_channel_channel_gotify_idx on notification_hook_channel(channel_gotify); +create index if not exists notification_hook_channel_channel_http_idx on notification_hook_channel(channel_http); +create index if not exists notification_hook_channel_channel_mail_idx on notification_hook_channel(channel_mail); +create index if not exists notification_hook_channel_channel_matrix_idx on notification_hook_channel(channel_matrix); +create index if not exists notification_hook_channel_hook_id_idx on notification_hook_channel(hook_id); +create index if not exists notification_hook_event_hook_id_idx on notification_hook_event(hook_id); +create index if not exists organization_cid_idx on organization(cid); +create index if not exists person_cid_idx on person(cid); +create index if not exists fk_person_organization on person(oid); +create index if not exists query_bookmark_cid_idx on query_bookmark(cid); +create index if not exists query_bookmark_user_id_idx on query_bookmark(user_id); +create index if not exists rememberme_cid_login_idx on rememberme(cid, login); +create index if not exists sentmail_uid_idx on sentmail(uid); +create index if not exists sentmailitem_item_id_idx on sentmailitem(item_id); +create index if not exists sentmailitem_sentmail_id_idx on sentmailitem(sentmail_id); +create index if not exists source_cid_idx on source(cid); +create index if not exists source_folder_id_idx on source(folder_id); +create index if not exists tag_cid_idx on tag(cid); +create index if not exists tagitem_itemid_idx on tagitem(itemid); +create index if not exists tagitem_tid_idx on tagitem(tid); +create index if not exists tagsource_source_id_idx on tagsource(source_id); +create index if not exists tagsource_tag_id_idx on tagsource(tag_id); +create index if not exists totp_user_id_idx on totp(user_id); +create index if not exists user__cid_idx on user_(cid); +create index if not exists useremail_uid_idx on useremail(uid); +create index if not exists userimap_uid_idx on userimap(uid); diff --git a/modules/store/src/main/resources/db/migration/mariadb/V1.38.0__more_indexes.sql b/modules/store/src/main/resources/db/migration/mariadb/V1.38.0__more_indexes.sql new file mode 100644 index 00000000..39032bad --- /dev/null +++ b/modules/store/src/main/resources/db/migration/mariadb/V1.38.0__more_indexes.sql @@ -0,0 +1,79 @@ +create index if not exists addon_archive_cid_idx on addon_archive(cid); +create index if not exists addon_archive_file_id_idx on addon_archive(file_id); +create index if not exists addon_run_config_cid_idx on addon_run_config(cid); +create index if not exists addon_run_config_user_id_idx on addon_run_config(user_id); +create index if not exists addon_run_config_addon_addon_id_idx on addon_run_config_addon(addon_id); +create index if not exists addon_run_config_addon_addon_run_config_id_idx on addon_run_config_addon(addon_run_config_id); +create index if not exists addon_run_config_trigger_addon_run_config_id_idx on addon_run_config_trigger(addon_run_config_id); +create index if not exists attachment_filemetaid_idx on attachment(filemetaid); +create index if not exists attachment_itemid_idx on attachment(itemid); +create index if not exists attachment_archive_id_idx on attachment_archive(id); +create index if not exists attachment_archive_file_id_idx on attachment_archive(file_id); +create index if not exists attachment_preview_id_idx on attachment_preview(id); +create index if not exists attachment_preview_file_id_idx on attachment_preview(file_id); +create index if not exists attachment_source_id_idx on attachment_source(id); +create index if not exists attachment_source_file_id_idx on attachment_source(file_id); +create index if not exists attachmentmeta_attachid_idx on attachmentmeta(attachid); +create index if not exists classifier_model_cid_idx on classifier_model(cid); +create index if not exists classifier_model_file_id_idx on classifier_model(file_id); +create index if not exists classifier_setting_cid_idx on classifier_setting(cid); +create index if not exists client_settings_collective_cid_idx on client_settings_collective(cid); +create index if not exists client_settings_user_id_idx on client_settings_user(user_id); +create index if not exists collective_password_cid_idx on collective_password(cid); +create index if not exists contact_oid_idx on contact(oid); +create index if not exists contact_pid_idx on contact(pid); +create index if not exists custom_field_cid_idx on custom_field(cid); +create index if not exists custom_field_value_field_idx on custom_field_value(field); +create index if not exists custom_field_value_item_id_idx on custom_field_value(item_id); +create index if not exists download_query_cid_idx on download_query(cid); +create index if not exists download_query_file_id_idx on download_query(file_id); +create index if not exists empty_trash_setting_cid_idx on empty_trash_setting(cid); +create index if not exists equipment_cid_idx on equipment(cid); +create index if not exists folder_cid_idx on folder(cid); +create index if not exists folder_owner_idx on folder(owner); +create index if not exists folder_member_folder_id_idx on folder_member(folder_id); +create index if not exists folder_member_user_id_idx on folder_member(user_id); +create index if not exists item_cid_idx on item(cid); +create index if not exists item_concequipment_idx on item(concequipment); +create index if not exists item_folder_id_idx on item(folder_id); +create index if not exists item_corrorg_idx on item(corrorg); +create index if not exists item_concperson_idx on item(concperson); +create index if not exists item_corrperson_idx on item(corrperson); +create index if not exists item_link_cid_idx on item_link(cid); +create index if not exists item_link_item1_idx on item_link(item1); +create index if not exists item_link_item2_idx on item_link(item2); +create index if not exists item_proposal_itemid_idx on item_proposal(itemid); +create index if not exists item_share_user_id_idx on item_share(user_id); +create index if not exists joblog_jid_idx on joblog(jid); +create index if not exists notification_channel_gotify_uid_idx on notification_channel_gotify(uid); +create index if not exists notification_channel_http_uid_idx on notification_channel_http(uid); +create index if not exists notification_channel_mail_uid_idx on notification_channel_mail(uid); +create index if not exists notification_channel_mail_conn_id_idx on notification_channel_mail(conn_id); +create index if not exists notification_channel_matrix_uid_idx on notification_channel_matrix(uid); +create index if not exists notification_hook_uid_idx on notification_hook(uid); +create index if not exists notification_hook_channel_channel_gotify_idx on notification_hook_channel(channel_gotify); +create index if not exists notification_hook_channel_channel_http_idx on notification_hook_channel(channel_http); +create index if not exists notification_hook_channel_channel_mail_idx on notification_hook_channel(channel_mail); +create index if not exists notification_hook_channel_channel_matrix_idx on notification_hook_channel(channel_matrix); +create index if not exists notification_hook_channel_hook_id_idx on notification_hook_channel(hook_id); +create index if not exists notification_hook_event_hook_id_idx on notification_hook_event(hook_id); +create index if not exists organization_cid_idx on organization(cid); +create index if not exists person_cid_idx on person(cid); +create index if not exists fk_person_organization on person(oid); +create index if not exists query_bookmark_cid_idx on query_bookmark(cid); +create index if not exists query_bookmark_user_id_idx on query_bookmark(user_id); +create index if not exists rememberme_cid_login_idx on rememberme(cid, login); +create index if not exists sentmail_uid_idx on sentmail(uid); +create index if not exists sentmailitem_item_id_idx on sentmailitem(item_id); +create index if not exists sentmailitem_sentmail_id_idx on sentmailitem(sentmail_id); +create index if not exists source_cid_idx on source(cid); +create index if not exists source_folder_id_idx on source(folder_id); +create index if not exists tag_cid_idx on tag(cid); +create index if not exists tagitem_itemid_idx on tagitem(itemid); +create index if not exists tagitem_tid_idx on tagitem(tid); +create index if not exists tagsource_source_id_idx on tagsource(source_id); +create index if not exists tagsource_tag_id_idx on tagsource(tag_id); +create index if not exists totp_user_id_idx on totp(user_id); +create index if not exists user__cid_idx on user_(cid); +create index if not exists useremail_uid_idx on useremail(uid); +create index if not exists userimap_uid_idx on userimap(uid); diff --git a/modules/store/src/main/resources/db/migration/postgresql/V1.38.0__more_indexes.sql b/modules/store/src/main/resources/db/migration/postgresql/V1.38.0__more_indexes.sql new file mode 100644 index 00000000..39032bad --- /dev/null +++ b/modules/store/src/main/resources/db/migration/postgresql/V1.38.0__more_indexes.sql @@ -0,0 +1,79 @@ +create index if not exists addon_archive_cid_idx on addon_archive(cid); +create index if not exists addon_archive_file_id_idx on addon_archive(file_id); +create index if not exists addon_run_config_cid_idx on addon_run_config(cid); +create index if not exists addon_run_config_user_id_idx on addon_run_config(user_id); +create index if not exists addon_run_config_addon_addon_id_idx on addon_run_config_addon(addon_id); +create index if not exists addon_run_config_addon_addon_run_config_id_idx on addon_run_config_addon(addon_run_config_id); +create index if not exists addon_run_config_trigger_addon_run_config_id_idx on addon_run_config_trigger(addon_run_config_id); +create index if not exists attachment_filemetaid_idx on attachment(filemetaid); +create index if not exists attachment_itemid_idx on attachment(itemid); +create index if not exists attachment_archive_id_idx on attachment_archive(id); +create index if not exists attachment_archive_file_id_idx on attachment_archive(file_id); +create index if not exists attachment_preview_id_idx on attachment_preview(id); +create index if not exists attachment_preview_file_id_idx on attachment_preview(file_id); +create index if not exists attachment_source_id_idx on attachment_source(id); +create index if not exists attachment_source_file_id_idx on attachment_source(file_id); +create index if not exists attachmentmeta_attachid_idx on attachmentmeta(attachid); +create index if not exists classifier_model_cid_idx on classifier_model(cid); +create index if not exists classifier_model_file_id_idx on classifier_model(file_id); +create index if not exists classifier_setting_cid_idx on classifier_setting(cid); +create index if not exists client_settings_collective_cid_idx on client_settings_collective(cid); +create index if not exists client_settings_user_id_idx on client_settings_user(user_id); +create index if not exists collective_password_cid_idx on collective_password(cid); +create index if not exists contact_oid_idx on contact(oid); +create index if not exists contact_pid_idx on contact(pid); +create index if not exists custom_field_cid_idx on custom_field(cid); +create index if not exists custom_field_value_field_idx on custom_field_value(field); +create index if not exists custom_field_value_item_id_idx on custom_field_value(item_id); +create index if not exists download_query_cid_idx on download_query(cid); +create index if not exists download_query_file_id_idx on download_query(file_id); +create index if not exists empty_trash_setting_cid_idx on empty_trash_setting(cid); +create index if not exists equipment_cid_idx on equipment(cid); +create index if not exists folder_cid_idx on folder(cid); +create index if not exists folder_owner_idx on folder(owner); +create index if not exists folder_member_folder_id_idx on folder_member(folder_id); +create index if not exists folder_member_user_id_idx on folder_member(user_id); +create index if not exists item_cid_idx on item(cid); +create index if not exists item_concequipment_idx on item(concequipment); +create index if not exists item_folder_id_idx on item(folder_id); +create index if not exists item_corrorg_idx on item(corrorg); +create index if not exists item_concperson_idx on item(concperson); +create index if not exists item_corrperson_idx on item(corrperson); +create index if not exists item_link_cid_idx on item_link(cid); +create index if not exists item_link_item1_idx on item_link(item1); +create index if not exists item_link_item2_idx on item_link(item2); +create index if not exists item_proposal_itemid_idx on item_proposal(itemid); +create index if not exists item_share_user_id_idx on item_share(user_id); +create index if not exists joblog_jid_idx on joblog(jid); +create index if not exists notification_channel_gotify_uid_idx on notification_channel_gotify(uid); +create index if not exists notification_channel_http_uid_idx on notification_channel_http(uid); +create index if not exists notification_channel_mail_uid_idx on notification_channel_mail(uid); +create index if not exists notification_channel_mail_conn_id_idx on notification_channel_mail(conn_id); +create index if not exists notification_channel_matrix_uid_idx on notification_channel_matrix(uid); +create index if not exists notification_hook_uid_idx on notification_hook(uid); +create index if not exists notification_hook_channel_channel_gotify_idx on notification_hook_channel(channel_gotify); +create index if not exists notification_hook_channel_channel_http_idx on notification_hook_channel(channel_http); +create index if not exists notification_hook_channel_channel_mail_idx on notification_hook_channel(channel_mail); +create index if not exists notification_hook_channel_channel_matrix_idx on notification_hook_channel(channel_matrix); +create index if not exists notification_hook_channel_hook_id_idx on notification_hook_channel(hook_id); +create index if not exists notification_hook_event_hook_id_idx on notification_hook_event(hook_id); +create index if not exists organization_cid_idx on organization(cid); +create index if not exists person_cid_idx on person(cid); +create index if not exists fk_person_organization on person(oid); +create index if not exists query_bookmark_cid_idx on query_bookmark(cid); +create index if not exists query_bookmark_user_id_idx on query_bookmark(user_id); +create index if not exists rememberme_cid_login_idx on rememberme(cid, login); +create index if not exists sentmail_uid_idx on sentmail(uid); +create index if not exists sentmailitem_item_id_idx on sentmailitem(item_id); +create index if not exists sentmailitem_sentmail_id_idx on sentmailitem(sentmail_id); +create index if not exists source_cid_idx on source(cid); +create index if not exists source_folder_id_idx on source(folder_id); +create index if not exists tag_cid_idx on tag(cid); +create index if not exists tagitem_itemid_idx on tagitem(itemid); +create index if not exists tagitem_tid_idx on tagitem(tid); +create index if not exists tagsource_source_id_idx on tagsource(source_id); +create index if not exists tagsource_tag_id_idx on tagsource(tag_id); +create index if not exists totp_user_id_idx on totp(user_id); +create index if not exists user__cid_idx on user_(cid); +create index if not exists useremail_uid_idx on useremail(uid); +create index if not exists userimap_uid_idx on userimap(uid);