Skip to content

A platform for community discussion. Free, open, simple.

PERF: Add index on group to category_groups (#8231)

Dan Ungureanua7301c86718f
diff --git a/app/models/category_group.rb b/app/models/category_group.rb
index a0cbb3f31e8..a4f5b51ef9d 100644
--- a/app/models/category_group.rb
+++ b/app/models/category_group.rb
@@ -23,3 +23,7 @@ end
# updated_at :datetime not null
# permission_type :integer default(1)
#
+# Indexes
+#
+# index_category_groups_on_group_id (group_id)
+#
diff --git a/db/migrate/20191022161944_add_index_on_group_to_category_groups.rb b/db/migrate/20191022161944_add_index_on_group_to_category_groups.rb
new file mode 100644
index 00000000000..ba3578ca9bf
--- /dev/null
+++ b/db/migrate/20191022161944_add_index_on_group_to_category_groups.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddIndexOnGroupToCategoryGroups < ActiveRecord::Migration[6.0]
+ def change
+ add_index :category_groups, :group_id
+ end
+end