[R] RMySQL performance over RODBC

Malladi, Sukhaswami smalladi at lexgen.com
Fri Jan 24 17:33:03 CET 2003


R-help list,

I ported some R code from MS Windows PC to sun-solaris. Both do queries on
the same 
MySQL database.

PC version of R is 1.6.1 and solaris version is 1.6.0. I use RMySQL_0.5-0
(on solaris)
and RODBC 1.0-1 on PC to connect to MySQL. The PC version took about 65
mins. to run
wheras the Solaris (SunOS 5.7) version took 375 mins. (> 6 hrs). R and
RMySQL are 
resident on the same host (solaris) as the MySQL database.

Can experts on the list please throw some light as how to improve the
speed with which RMySQL queries can be processed ? 

RMySQL database access is done as follows:
-------------------------------------------
library(RMySQL) 				# 1
con <- dbConnect( ... )			# 2
...
rs <- dbSendQuery(con,qry)		# 3
rdat <- fetch(rs,n=10000)		# 4
...
dbDisconnect(con) 			# 5
-------------------------------------------

lines #3 and #4 are repeated about 10000 times in the script.

Thanks in advance for any help.
Sukhaswami Malladi


*************************************************************************** 
 The contents of this communication are intended only for the addressee and
may contain confidential and/or privileged material. If you are not the
intended recipient, please do not read, copy, use or disclose this
communication and notify the sender.  Opinions, conclusions and other
information in this communication that do not relate to the official
business of my company shall be understood as neither given nor endorsed by
it.  
***************************************************************************




More information about the R-help mailing list