Skip to content

Instantly share code, notes, and snippets.

@walkermatt
Created May 12, 2015 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walkermatt/66a675a423acc28d0637 to your computer and use it in GitHub Desktop.
Save walkermatt/66a675a423acc28d0637 to your computer and use it in GitHub Desktop.
CREATE INDEX
SELECT 'CREATE INDEX ' || quote_ident(f_table_name || '_geom_idx') || ' ON ' || quote_ident(f_table_schema) || '.' || quote_ident(f_table_name) || ' USING GIST (' || quote_ident(f_geometry_column) || ');' AS SQL
FROM geometry_columns
WHERE f_table_name IN ('topographicarea',
'topographicline');
sql
------------------------------------------------------------------------------------------------
CREATE INDEX topographicarea_geom_idx ON osmm_topo2.topographicarea USING GIST (wkb_geometry);
CREATE INDEX topographicline_geom_idx ON osmm_topo2.topographicline USING GIST (wkb_geometry);
CREATE INDEX topographicline_geom_idx ON osmm_topo.topographicline USING GIST (wkb_geometry);
CREATE INDEX topographicarea_geom_idx ON osmm_topo.topographicarea USING GIST (wkb_geometry);
@dragons8mycat
Copy link

Awesome!! This worked perfectly, thanks!!
(Mental note: brush up on SQL skills.....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment