mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
PERF: add an index on slug to make sure that slug lookups are quick
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class AddSlugIndexOnTopic < ActiveRecord::Migration
|
||||
def up
|
||||
execute 'CREATE INDEX idxTopicSlug ON topics(slug) WHERE deleted_at IS NULL AND slug IS NOT NULL'
|
||||
end
|
||||
|
||||
def down
|
||||
execute 'DROP INDEX idxTopicSlug'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user