add trigram indexes for artists and pools

This commit is contained in:
r888888888
2016-02-18 17:30:26 -08:00
parent 40957e04fd
commit b98226fab2
5 changed files with 144 additions and 102 deletions

View File

@@ -0,0 +1,11 @@
class AddTrigramIndexToPools < ActiveRecord::Migration
def up
execute "create extension pg_trgm"
execute "create index index_pools_on_name_trgm on pools using gin (name gin_trgm_ops)"
end
def down
execute "drop index index_pools_on_name_trgm"
execute "drop extension pg_trgm"
end
end

View File

@@ -0,0 +1,13 @@
class AddTrigramIndexesToArtists < ActiveRecord::Migration
def up
execute "create index index_artists_on_name_trgm on artists using gin (name gin_trgm_ops)"
execute "create index index_artists_on_group_name_trgm on artists using gin (group_name gin_trgm_ops)"
execute "create index index_artists_on_other_names_trgm on artists using gin (other_names gin_trgm_ops)"
end
def down
execute "drop index index_artists_on_other_names_trgm"
execute "drop index index_artists_on_group_name_trgm"
execute "drop index index_artists_on_name_trgm"
end
end