[R] RMySQL query: why result takes so much memory in R ?

From: Christoph Lehmann <christoph.lehmann_at_gmx.ch>
Date: Tue 03 May 2005 - 02:13:16 EST

I just started with RMySQL. I have a database with roughly 12 millions rows/records and 8 columns/fields.

 From all 12 millions of records I want to import 3 fields only. The fields are specified as:id int(11), group char(15), measurement float(4,2).
Why does this take > 1G RAM? I run R on suse linux, with 1G RAM and with the code below it even fills the whole 1G of swap. I just don't understand how 12e6 * 3 can fill such a huge range of RAM? Thanks for
clarification and potential solutions.

## my code

drv <- dbDriver("MySQL")
ch <- dbConnect(drv,dbname="testdb",

testdb <- dbGetQuery(ch,
        "select id, group, measurement from mydata")

## end of my code


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 03 01:11:24 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:31 EST