Skip to contents

Create a set of indexes on the tables in a SEND database to optimize performance of extraction of data from the different functions in the package.

Usage

dbCreateIndexes(dbToken, replaceExisting = FALSE)

Arguments

dbToken

Mandatory
Token for the open database connection (see initEnvironment).

replaceExisting

Mandatory, character
Whether an already existing set of indexes in the database may be replaced by a new set of indexes.

Value

No return value, called for side effects

Details

All the indexes are named <domain name>_sendigr_<nn> - .e.g. TS_sendigr_01.
If any additional indexes are manually created in the database, avoid to include 'sendigr' in the name, because all existing indexes with that included in the name will be initially deleted when execution the function with replaceExisting = TRUE.
It's recommended to wait with the creation of the indexes until the major amount of studies to be loaded in to the database are loaded.

Databases supported are SQLite and PostgreSQL, the checkDbType function makes sure one of those types are used

Examples

if (FALSE) { # \dontrun{
createAllIndexes(myDbToken)
} # }