RODBC vs. SQL Developer

I know it’s a small example, but — I ran the same query in SQL Developer and RStudio with RODBC… and R won out. Surprising.

RODBC:


system.time(
fil1<-sqlQuery(channel, paste("SELECT BUNDLE_TYPE_CD,COUNT(SUBMISSION_NO)",
"FROM PROD.SUB_DBG",
"GROUP BY BUNDLE_TYPE_CD"
)))

SQL:


SELECT BUNDLE_TYPE_CD,COUNT(SUBMISSION_NO)
FROM PROD.SUB_DBG
GROUP BY BUNDLE_TYPE_CD

Results (SQL developer on left, R Studio on right):

RvSQL

Interesting note: R’s “user” time, which is a proxy for how much time the CPU is active, is near 0. That means R/ my local machine are doing virtually none of the calculation. This makes sense; the query is being pushed to an Oracle database on a remote server, but I was surprised that it was 0.

Leave a comment