-->

Speed up sqlFetch()

2020-08-17 18:19发布

问题:

I am working with an Oracle database and like to fetch a table with 30 million records.

library(RODBC)
ch <- odbcConnect("test", uid="test_user", 
                  pwd="test_pwd", 
                  believeNRows=FALSE, readOnly=TRUE)
db <- sqlFetch(ch, "test_table")

For 1 million records the process needs 1074.58 sec. Thus, it takes quite a while for all 30 million records. Is there any possiblity to speed up the process?

I would appreciate any help. Thanks.

回答1:

You could try making a system call through the R terminal to a mySQL shell using the system() command. Process your data externally and only load what you need as output.



标签: database r