ai tags: replace tag_id index with (tag_id, score) index.
Index on (tag_id, score) instead of (tag_id) to allow tags to be filtered and sorted by confidence more efficiently. This index takes up about the same amount of space as an index on tag_id alone, so including the score in the index is essentially free.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddTagIdAndScoreIndexToAITags < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_index :ai_tags, [:tag_id, :score], if_not_exists: true
|
||||
remove_index :ai_tags, :tag_id
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user