A user has a large table (3+ billion rows). To speed up queries for the next few months, an index on the remote database must be created.
Assuming there is a connection called conn
- what is the best way to create an index and make it persist after disconnection from the database.
e.g.,
library(DBI)
sql<-'CREATE INDEX idx_pmid ON medcit (pmid ASC);'
dbExecute(conn,sql)
dbDisconnect(conn)
The code above seem to work but how can the index be somehow verified (make sure it truly exist and speeds up future queries)? In other words - how can a user check the existence of the index? Also, do I need to issue COMMIT command somehow?