[BioC] RdbiPgSQL: slowness in dbWriteTable

Sean Davis sdavis2 at mail.nih.gov
Wed Sep 5 18:30:03 CEST 2007


Jeff Gentry wrote:
>> Hi, Jeff.  The fastest way to get data into postgresql is to use some
>> version of the copy protocol.  I do not know what RdbiPgSQL uses for
> 
> Yup, your method is essentially what I came across yesterday afternoon,
> with some slight variations.  What you outline is a bit better
> though.  This works for my immediate task, although I'm going to need a
> way to allow this to be automated (hopefully within RdbiPgSQL
> itself).  COPY won't work, and /copy of course needs to be called from
> psql.  One thought was to try and get /copy implemented in R.
> 

This is the best solution for dbWriteTable, I think, which is meant to
be the fastest way to get data into and out of the database, but there
may be good reasons for not doing so if it isn't using the copy
protocol.  Other clients (perl and python that I know of) have so-called
client-side copy in place already.  Of course the underlying C libraries
have PGPutCopyData() and PGGetCopyData() (sp?) for just this purpose.
However, I haven't played in C/C++ for quite some time to be able to
implement something quickly.

Sean



More information about the Bioconductor mailing list