From 09f6fcd49cdbbecddc944753c197cceb912ef988 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 10 Nov 2022 23:49:02 +0000 Subject: Add an index to improve the performance of issue queries involving custom fields (#29171). Contributed by Stephane Evr. git-svn-id: https://svn.redmine.org/redmine/trunk@21955 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- db/migrate/20221012135202_add_index_to_custom_values.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20221012135202_add_index_to_custom_values.rb diff --git a/db/migrate/20221012135202_add_index_to_custom_values.rb b/db/migrate/20221012135202_add_index_to_custom_values.rb new file mode 100644 index 000000000..21f5670aa --- /dev/null +++ b/db/migrate/20221012135202_add_index_to_custom_values.rb @@ -0,0 +1,6 @@ +class AddIndexToCustomValues < ActiveRecord::Migration[6.1] + def change + remove_index :custom_values, column: [:customized_type, :customized_id], name: :custom_values_customized, if_exists: true + add_index :custom_values, [:customized_type, :customized_id, :custom_field_id], name: :custom_values_customized_custom_field + end +end -- cgit v1.2.3