From 334a9c019a987586e82c35d633bd3f623361fac0 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 17 Jun 2015 14:20:43 -0700 Subject: [PATCH] Add url hash index for stat_referrers --- migrations/067_add_missing_stat_indexes.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrations/067_add_missing_stat_indexes.rb diff --git a/migrations/067_add_missing_stat_indexes.rb b/migrations/067_add_missing_stat_indexes.rb new file mode 100644 index 00000000..df7ffca9 --- /dev/null +++ b/migrations/067_add_missing_stat_indexes.rb @@ -0,0 +1,13 @@ +Sequel.migration do + up { + DB['create index stat_referrers_hash_multi on stat_referrers (site_id, md5(url))'].first + DB.add_index :stat_locations, :site_id + DB.add_index :stat_paths, :site_id + } + + down { + DB['drop index stat_referrers_hash_multi'].first + DB.drop_index :stat_locations, :site_id + DB.drop_index :stat_paths, :site_id + } +end