[fdo-dev] rdbi_fetch() and its count parameter

Gavin Cramer gavin.cramer at autodesk.com
Fri Aug 25 12:17:43 EDT 2006


Hello, Mateusz.  The various RDBMS interfaces vary in how much they
offer in transparent buffering.  I.e. there may or may not be an
advantage to using a datastore's API's array fetching capability.  I
haven't experimented with MySQL in this regard myself, but feel free to
use the 'count' for PostGIS if it helps.  The binds and defines have to
be set up the same way (as if array fetching might happen) as far as an
RDBI driver is concerned -- it may return as many rows as requested, or
not.  You could start with a 1-row implementation and then improve it
later.  The resultant count is just as important -- and of course it
must be no more than the requested count.

Note that the ODBC driver for RDBI does use the 'count' when making the
relevant ODBC API calls, leaving it up to the underlying 3rd-party ODBC
driver to possibly make use of it.

Gavin
 

-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Friday, August 25, 2006 12:01 PM
To: dev at fdo.osgeo.org
Subject: [fdo-dev] rdbi_fetch() and its count parameter

Hi,

I'd like to ask about fetching records from query results, in RDBI.
>From MySQL driver perspective, there is rdbi_fetch() functions
that takes - among other - count parameter:

int rdbi_fetch(rdbi_context_def *context,
               int  sqlid,   /* index into cursor globals */
               int  count,   /* # rows to fetch */
               int *rows_processed);

This function delegates fetch operation to provider specific RDBI
driver, for example MySQL: mysql_fetch().

The 'count' parameter is passed to rdbi_fetch() and forwarded
to mysql_fetch() function, but it's never used.

Is my understanding correct that MySQL Rdbi driver supports
only 1-row per fetch operation and the 'count' is ignored here?

I'm following this concept, 1-row per fetch, in PostGIS provider.

Does anyone have comments/suggestions to this idea?

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at fdo.osgeo.org
For additional commands, e-mail: dev-help at fdo.osgeo.org






More information about the Fdo_dev mailing list