Hi,
How do you retrieve just the primary key from a secondary database,
without actually accessing the data associated with it? I want to
select a range of primary keys whose secondary keys fall in a given
interval, then sort those primary keys to improve locality before
accessing the actual records.
Quote:
From the documentation it looks like the only way to do that would be
to create the secondary database, close it, then reopen it without
|
associating so that BDB doesn't automatically follow the primary key to
the data. That seems like a bad approach, though, since the secondary
database would quickly go stale.
I searched this group and the Internet without any luck. Is BDB smart
enough to stay away from the primary table if I call Dbt::set_dlen(0)
on the data tuple first? I think the same question applies to
index-only scans in general (eg select <primary-key> from <table> where
<secondary-key> in <range>).
Thanks!