Re: berkeley DB, bulk data retrieval problem...

From: Bob M. Lee <rboblee_at_aol.com>
Date: Wed, 18 Sep 2002 02:38:18 -0700
Message-ID: <3D88498A.4040505_at_aol.com>


To Robert Mycek:

The question must be referring to "Sleepycat Software" and their implementation of the "Berkeley DB". See: www.sleepycat.com

So "dbc" should refer to a pointer to a "DB_cursor" - and "c_get" is a "cursor get" method or function invocation.

So, per: http://www.sleepycat.com/docs/api_c/dbc_get.html#DB_SET

  • 8< Begin Quote >8---- DB_MULTIPLE_KEY Return multiple key and data pairs. The buffer to which the data argument refers is filled with key and data pairs. If the first key and data pair cannot fit into the buffer, the size field of the data argument is set to the length needed to retrieve them, and the error ENOMEM is returned.

     The buffer to which the data argument refers should be large relative to the page size of the underlying database, aligned for unsigned integer access, and be a multiple of 1024 bytes in size.

The DB_MULTIPLE_KEY flag may only be used with the DB_CURRENT, DB_FIRST, 
DB_GET_BOTH, DB_NEXT, DB_NEXT_NODUP, DB_SET, DB_SET_RANGE, and 
DB_SET_RECNO options. The DB_MULTIPLE_KEY flag may not be used when 
accessing databases made into secondary indices using the DB->associate method.
  • 8< End Quote >8 ---- Note: comp.database.rdb is used primarily for discussions of "Oracle Rdb" the OpenVMS database engine that is ANSI SQL-95 compliant.

Hope this helps,

        -bob lee-

mailto:rbobleenospamataoldotcom

Robert Mycek wrote:
> Hi,
>
> I have a set of keys, and I want retrieve
> all data related to these keys.
> Is it possible to get all this data by call
> dbc->c_get function only once?
>
> Should I use DB_MULTIPLE_KEY flag?
> Any idea?
>
> thx for help
> rm.
>
>
>
Received on Wed Sep 18 2002 - 11:38:18 CEST

Original text of this message