PERF: add an index on slug to make sure that slug lookups are quick
This commit is contained in:
parent
bcbee91f0c
commit
237968b1b7
|
@ -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
|
Loading…
Reference in New Issue