OK, I've achieved the 1st step to speeding up the commonest query by
creating a Nvra index.
There's at least 2 program hacks with Berkeley DB I've seen, one in
SuSE, the
other's provenance I've forgotten, that look only at the index,
avoiding the 2ndary
headerLoad() and digest/signature check, that are being touted as
Newer! Better! Bestest!
Faster! than the pokey turtle rpmlib. Watch this space ... ;-)
Here is current behavior with the header extension RPMTAG_NVRA when
various patterns are used to query. Note that the "rpm -qa" queries
are pig slow
sequential searches with associated headerLoad() to get at the data.
While the results are exactly as I expect, I'd hate to explain "Why?"
to anyone.
Note that the last example is closest to meeting luser expectations.
$ rpm -qa | grep '^kernel'
kernel-devel-2.6.18-1.2798.fc6.i686
kernel-2.6.18-1.2798.fc6.i686
kernel-headers-2.6.21-1.3194.fc7.i386
$ rpm -q kernel-2.6.18
kernel-2.6.18-1.2798.fc6.i686
$ rpm -qa kernel*
kernel-devel-2.6.18-1.2798.fc6.i686
kernel-2.6.18-1.2798.fc6.i686
kernel-headers-2.6.21-1.3194.fc7.i386
$ rpm -qa kernel-*
kernel-devel-2.6.18-1.2798.fc6.i686
kernel-headers-2.6.21-1.3194.fc7.i386
$ rpm -qa name=kernel version=2.6*
kernel-2.6.18-1.2798.fc6.i686
$ rpm -qa kernel-2.6*
$ rpm -qa nvra=kernel-2.6*
kernel-2.6.18-1.2798.fc6.i686
The next step will be to add a query-through-index step, although I'll
likely add a headerGetExtension() method to return compound values
from header containers, I'm so so so tired of fighting
the dangerously deranged rpmlib/rpmdb methods in order to
preseve the pretense of stable API/ABI.
hth
73 de Jeff
______________________________________________________________________
RPM Package Manager http://rpm5.org
Developer Communication List [email protected]