[R] RMySQL fetch defaults to N=500?

David James dj at research.bell-labs.com
Fri Aug 9 14:02:06 CEST 2002


Jens Nieschulze wrote:
> On Thu, 8 Aug 2002, Jay Pfaffman wrote:
> 
> %It appears that fetch() gets only the first 500 rows by default.  I
> %don't see this in the documentation, but 
> 
> it is not in ?fetch

but it is (for sure on 0.4-6).

> but 
> > describe(manager)
> MySQLManager id = (5649) 
>   Driver name:  MySQL 
>   Max  connections: 10 
>   Conn. processed: 1 
>   Default records per fetch: 500 
>   Open connections: 1 
> 
> where manager is your the output of dbManager("MySQL")
> reveals some info
> 
> 
> %    timeinfo <- fetch(rs)
> %
> %gets only 500 rows where
> %
> %    timeinfo <- fetch(rs,n=-1)
> %
> %gets (correctly) 736 for the same query.  Is this an undocumented
> %feature?  I played with this data for an alarming amount of time
> %before I realized that I was missing a third of the data.  I appear to
> %be using version 0.4-5.  I'll upgrade to 0.4-6 Real Soon Now.  My
> %first attempt failed for some reason.
> 
> undocumented? err, you can always look up the sources and in 
> RMySQL.R (version 04-6)  this feature is documented 
> 
> line 647 
> "MySQLManager" <- 
> function(max.con=10, fetch.default.rec = 500, force.reload=F)
> 
> line 1400
> "fetch.MySQLResultSet" <- 
> function(res, n=0)   
> ## Fetch at most n records from the opened resultSet (n = -1 means
> ## all records, n=0 means extract as many as "default_fetch_rec",
> ## as defined by MySQLManager (see describe(mgr, T)).
> 
> regards,
> 	JN
> 
> 
> %
> %-- 
> %Jay Pfaffman                           pfaffman at relaxpc.com
> %+1-415-821-7507 (H)                    +1-415-810-2238 (M)
> %
> %-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> %r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> %Send "info", "help", or "[un]subscribe"
> %(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> %_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> %
> 
> ***********************************************************************
> Jens Nieschulze
> 
> Institute for Forest Biometrics &	Phone: ++49-551-39-12107
> Applied Computer Science		Fax  : ++49-551-39-3465
> Buesgenweg 4
> 37077 Goettingen		E-mail: jniesch at uni-forst.gwdg.de
> GERMANY				http://www.uni-forst.gwdg.de/~jniesch
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
David A. James
Statistics Research, Room 2C-253            Phone:  (908) 582-3082       
Bell Labs, Lucent Technologies              Fax:    (908) 582-3340
Murray Hill, NJ 09794-0636
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list