]> granicus.if.org Git - postgis/commitdiff
put in some missing indexes
authorRegina Obe <lr@pcorp.us>
Wed, 11 May 2011 13:50:05 +0000 (13:50 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 11 May 2011 13:50:05 +0000 (13:50 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7130 b70326c6-7e19-0410-871a-916f4a2858ee

extras/tiger_geocoder/tiger_2010/tables/lookup_tables_2010.sql
extras/tiger_geocoder/tiger_2010/tiger_loader.sql
extras/tiger_geocoder/tiger_2010/upgrade_geocode.sql

index 35ef0251427346de73ae6730140c6f0667ab4e22..6c4e46d5922b95252ebb28f7a00bf90c5b5a8c3d 100644 (file)
@@ -937,7 +937,7 @@ CREATE TABLE county
   CONSTRAINT enforce_geotype_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
   CONSTRAINT enforce_srid_geom CHECK (st_srid(the_geom) = 4269)
 );
-CREATE INDEX idx_tiger_data_edges ON edges USING btree (countyfp);
+CREATE INDEX idx_tiger_county ON county USING btree (countyfp);
 
 DROP TABLE IF EXISTS state;
 CREATE TABLE state
@@ -991,6 +991,7 @@ CREATE TABLE place
   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
   CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4269)
 );
+CREATE INDEX tiger_place_the_geom_gist ON place USING gist(the_geom);
 
 DROP TABLE IF EXISTS zip_state;
 CREATE TABLE zip_state
index f10f1372bc53a79aa2ca570f6a857951dfb9378e..7d7ed793b05a51eb0d590a163500b7c7b2775f0c 100644 (file)
@@ -111,6 +111,7 @@ VALUES(3, 'place', 'place10', true, false, true,false, 'c',
        '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${table_name} PRIMARY KEY (plcidfp) ) INHERITS(place);" ',
        '${psql} -c "ALTER TABLE ${staging_schema}.${state_abbrev}_${table_name} RENAME geoid10 TO plcidfp;SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}'')); ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT uidx_${state_abbrev}_${lookup_name}_gid UNIQUE (gid);"
 ${psql} -c "CREATE INDEX idx_${state_abbrev}_${lookup_name}_soundex_name ON ${data_schema}.${state_abbrev}_${lookup_name} USING btree (soundex(name));" 
+${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${lookup_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
 ${psql} -c "ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT chk_statefp CHECK (statefp = ''${state_fips}'');"'  
        );
 
@@ -129,8 +130,8 @@ VALUES(5, 'zcta5', 'zcta5', false, false, true,false, 'a',
 
 INSERT INTO loader_lookuptables(process_order, lookup_name, table_name, load, level_county, level_state, single_geom_mode, insert_mode, pre_load_process, post_load_process )
 VALUES(6, 'faces', 'faces', true, true, false,false, 'c', 
-       '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (gid)) INHERITS(${lookup_name});" ',
-       '${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${lookup_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
+       '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${table_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (gid)) INHERITS(${lookup_name});" ',
+       '${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${table_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
        ${psql} -c "CREATE INDEX idx_${data_schema}_${state_abbrev}_${lookup_name}_tfid ON ${data_schema}.${state_abbrev}_${lookup_name} USING btree (tfid);"
        ${psql} -c "CREATE INDEX idx_${data_schema}_${state_abbrev}_${table_name}_countyfp ON ${data_schema}.${state_abbrev}_${table_name} USING btree (countyfp);"
        ${psql} -c "ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT chk_statefp CHECK (statefp = ''${state_fips}'');"
index 16f2e8fb2247d56149119fd8109bb10f0bcb5ea4..acad1fc084c323fc784223ea99745a0fa19d5bb0 100644 (file)
@@ -8,6 +8,7 @@ UPDATE state_lookup SET statefp = lpad(st_code::text,2,'0') WHERE statefp IS NUL
 ALTER TABLE state_lookup ADD CONSTRAINT state_lookup_statefp_key UNIQUE(statefp);
 CREATE INDEX idx_tiger_edges_countyfp ON edges USING btree(countyfp);
 CREATE INDEX idx_tiger_faces_countyfp ON faces USING btree(countyfp);
+CREATE INDEX tiger_place_the_geom_gist ON place USING gist(the_geom);
 
 BEGIN;
 -- Type used to pass around a normalized address between functions