Merge branch 'master' of github.com:CartoDB/data-services

This commit is contained in:
Carla 2015-06-16 17:32:00 +02:00
commit d31acf8148
2 changed files with 10 additions and 1 deletions

View File

@ -16,7 +16,7 @@ DELETE FROM global_cities_points_limited;
-- it assumes that the source is called "allcountries" -- it assumes that the source is called "allcountries"
INSERT INTO global_cities_points_limited (the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geoname_id, gtopo30, iso2, lowername, name, population) INSERT INTO global_cities_points_limited (the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geoname_id, gtopo30, iso2, lowername, name, population)
SELECT the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geonameid::int, gtopo30, country, lower(name) as lowername, name, population SELECT the_geom, admin1, admin2, admin3, admin4, altnames, asciiname, cc2, featclass, featcode, geonameid::int, gtopo30, country, lower(name) as lowername, name, population
FROM points_cities FROM allcountries
WHERE featcode = ''; WHERE featcode = '';
-- insert data from source table (allcountries) to the table -- insert data from source table (allcountries) to the table

View File

@ -13,3 +13,12 @@ CREATE UNIQUE INDEX idx_ne_admin0_v3_adm0_a3 ON ne_admin0_v3 (adm0_a3);
-- create indexes on postal code polygon table -- create indexes on postal code polygon table
CREATE UNIQUE INDEX idx_postal_code_polygons_a3_code ON postal_code_polygons (adm0_a3, postal_code) CREATE UNIQUE INDEX idx_postal_code_polygons_a3_code ON postal_code_polygons (adm0_a3, postal_code)
-- create indexes on named places table
CREATE INDEX idx_global_cities_points_limited_a ON global_cities_points_limited (lowername, iso2)
CREATE INDEX idx_global_cities_points_limited_admin1 ON global_cities_points_limited (admin1)
CREATE INDEX idx_global_cities_points_limited_geoname_id ON global_cities_points_limited (geoname_id)
CREATE INDEX idx_global_cities_alternates_limited_admin1 ON global_cities_alternates_limited (admin1)
CREATE INDEX idx_global_cities_alternates_limited_admin1_geonameid ON global_cities_alternates_limited (admin1_geonameid)
CREATE INDEX idx_global_cities_alternates_limited_lowername ON global_cities_alternates_limited (lowername)