OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
add index on notification settings columns expected to have be distributed unevenly
ulfertsaabe286e4b44
diff --git a/db/migrate/20210802114054_add_notification_setting_options.rb b/db/migrate/20210802114054_add_notification_setting_options.rbindex 84ae52751da..fe7e05ee21b 100644--- a/db/migrate/20210802114054_add_notification_setting_options.rb+++ b/db/migrate/20210802114054_add_notification_setting_options.rb@@ -2,16 +2,19 @@ class AddNotificationSettingOptions < ActiveRecord::Migration[6.1]def changeadd_notification_settings_optionsupdate_notified_events-- # TODO: add index to all boolean fieldsenddef add_notification_settings_optionschange_table :notification_settings, bulk: true do |t|- t.boolean :work_package_commented, default: false- t.boolean :work_package_created, default: false- t.boolean :work_package_processed, default: false- t.boolean :work_package_prioritized, default: false+ # Adding indices here is probably useful as most of those are expected to be false+ # and we are searching for those that are true.+ # The columns watched, involved and mentioned will probably be true most of the time+ # so having an index there should not improve speed.+ t.boolean :work_package_commented, default: false, index: true+ t.boolean :work_package_created, default: false, index: true+ t.boolean :work_package_processed, default: false, index: true+ t.boolean :work_package_prioritized, default: false, index: true+ t.index :allendend