Re: Re[2]: [bdbxml] Suggestion: XmlIndexLookup to return the number of referred keys

George Feinberg <[email protected]> Mon, 17 Apr 2006 13:48:31 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Steve,

> Hello George,
>
> Monday, April 17, 2006, 11:20:08 AM, you wrote:
>
>> Thanks for the idea.  What you are asking is pretty much available.
>> One way is to do what you are saying:
>> 1.  Use XmlIndexLookup() using LAZY_EVALUATION and DBXML_LAZY_DOCS
>> 2.  iterate the results, counting.  Lazy evaluation never creates a
>> large
>> result set.
>
>> Granted, the overhead of creating XmlValue objects exists, as does
>> walking the index, but that's the most reliable way to get the
>> information.
> Yes, I wanted precisely to avoid that iteration overhead - in a large
> resultset, it could be very wasteful.

I understand.  On the other hand, too much tracking of
index information can create a concurrency hotspot
and bottleneck of its own, so we have to be careful.

>
>> There does exist the interface, XmlContainer::lookupStatistics(),  
>> which
>> returns an object that has information about the index passed.
>> One piece of information is the number of entries in the index.
>> So, you could use that interface as well, if you'd find it useful.
> That seems to be it, although it is a bit hidden and I could not  
> find it
> on the first sight :). Too bad it won't work with the XmlIndexLookup
> object, and I will have to pass the index specification to the
> XmlContainer. Is tehre a fast way to retrieve that information only by
> using only the XmlIndexLookup object ?

Not at this time.  The statistics interface needs to be used
carefully, so it's not highly advertised.

Regards,

George




------------------------------------------
To remove yourself from this list, send an
email to [email protected]