CREATE INDEX Statement |
The CREATE INDEX statement creates an index on a specified column. This index may be used by the Geocoder to resolve an address.
There are two forms for the CREATE INDEX statement, depending on the type of index you want to create:
CREATE INDEX index_name ON table USING BTREE(col_name);
CREATE INDEX index_name ON table USING BKTREE value (col_name);
index_name | The desired name of this index |
table | The source table containing column col_name |
value | Number of errors to allow when finding a match in the index (BKTREE indexes only) |
col_name | The column within table on which to build the index |
SELECT %forest_nam AS name, %forest_size AS size INTO forest FROM "land2"; CREATE INDEX f_size ON forest USING BTree(size);
The following example SELECTs a number of lakes and then builds an index on the lake name. The index is built using a BK (Burkhard-Keller) Tree with a Levenshtein distance of 2.
SELECT %NAME AS name INTO lakes FROM "waterbody"; CREATE INDEX lake_name ON lakes USING BKTREE 2 (name);