Skip to content
Snippets Groups Projects
Commit 58e0cf2e authored by Alex Reisner's avatar Alex Reisner
Browse files

Add indices for faster queries.

parent b70252e4
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,9 @@ class GeocoderMaxmindGeoliteCity < ActiveRecord::Migration ...@@ -5,7 +5,9 @@ class GeocoderMaxmindGeoliteCity < ActiveRecord::Migration
t.column :end_ip_num, :bigint, null: false t.column :end_ip_num, :bigint, null: false
t.column :loc_id, :bigint, null: false t.column :loc_id, :bigint, null: false
end end
add_index :maxmind_geolite_city_blocks, :loc_id
add_index :maxmind_geolite_city_blocks, :start_ip_num, unique: true add_index :maxmind_geolite_city_blocks, :start_ip_num, unique: true
add_index :maxmind_geolite_city_blocks, [:end_ip_num, :start_ip_num], unique: true, name: 'index_maxmind_geolite_city_blocks_on_end_ip_num_range'
create_table :maxmind_geolite_city_location, id: false do |t| create_table :maxmind_geolite_city_location, id: false do |t|
t.column :loc_id, :bigint, null: false t.column :loc_id, :bigint, null: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment