Create index in database
Arguments
- con
database connection object from
DBI::dbConnect(), e.g. fromcc_db_connect()- tbl
table name as character
- flds
character vector of fields in table used for index
- is_geom
logical (default: FALSE) whether geometry field, so create GIST() index
- is_unique
logical (default: FALSE) whether to impose a unique constraint, to prevent duplicates; default: FALSE
- overwrite
logical (default: FALSE) whether to overwrite existing index
- show
logical (default: FALSE) whether to show SQL statement
- exec
logical (default: TRUE) whether to execute SQL statement
Examples
if (FALSE) { # \dontrun{
con <- cc_db_connect()
create_index(con, "ctd_casts", "geom", is_geom=T)
create_index(con, "ctd_casts", "cast_count", is_unique=T)
} # }