加速sqlFetch() [英] Speed up sqlFetch()

查看:310
本文介绍了加速sqlFetch()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Oracle数据库,喜欢获取一个拥有3000万条记录的表。

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")

对于1百万记录,该进程需要1074.58秒。因此,所有3000万条记录需要相当长的时间。是否有可能加快这个过程?

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?

我将不胜感激。谢谢。

推荐答案

您可以尝试通过R终端
系统调用mySQL shell使用系统)命令。从外部处理数据,只加载所需的输出。

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.

这篇关于加速sqlFetch()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆