Skip to content

Commit

Permalink
add index for content_tags learning_outcome_id
Browse files Browse the repository at this point in the history
This is a common query in learning outcomes code, and was totally unindexed

Change-Id: I37b96cbaf62235a08a51ba6abce3ee1d7c17a271
Reviewed-on: https://gerrit.instructure.com/18401
Reviewed-by: Cody Cutrer <[email protected]>
Tested-by: Jenkins <[email protected]>
QA-Review: Brian Palmer <[email protected]>
  • Loading branch information
codekitchen committed Mar 8, 2013
1 parent 7e10d61 commit a8df381
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class AddIndexToContentTagsLearningOutcomeId < ActiveRecord::Migration
tag :predeploy
self.transactional = false

def self.up
add_index :content_tags, :learning_outcome_id, :concurrently => true, :conditions => "learning_outcome_id IS NOT NULL"
end

def self.down
remove_index :content_tags, :column => :learning_outcome_id
end
end

0 comments on commit a8df381

Please sign in to comment.