DB connection through DBI is too slow for large DB

rmarkdown
odbc
dbi

#1

If I try to connect to a large Oracle database using DBI package.

library(DBI)
con <- dbConnect(odbc::odbc(), "ORACLE")

In R terminal, a connection is established instantly. But in RStudio with new “Connections” pane added, it takes several minutes. I guess the reason is that RStudio is trying to download a list of schema from the server, which appears on the “Connections” pane. This is unnecessary and I want to disable it.

Is there a way to close “Connections” pane or to disable the automatic schema downloading at the beginning?


#2

Hi @jmmm, would you mind opening an GitHub issue for this in the odbc package’s repo? This is something that has been reported to us via various sources, and have recently discussed with @jimhester and @nathan. Thanks!


#3

Hi @edgararuiz, thanks for your reply. Unfortunately, I don’t understand the technical details well enough (had no clue that it was caused by odbc package) to open the issue. Hoping that it can be fixed soon because the new SQL markdown is really useful to streamline the interaction between DB and R. Thanks a lot for that!


#4

No problem, I’ll go ahead and open the issue


#5

The way to do this currently is to set connectionObserver option to NULL in your RStudio session. This will disable all connections to the connections pane.

options(connectionObserver = NULL)