Re: [bdbxml] Suggestion: XmlIndexLookup to return the number of referred keys
George Feinberg <[email protected]> Mon, 17 Apr 2006 10:20:08 -0400
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Steve, 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. 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. Regards, George > Hello all, > > Would it possible to create a new API to the have the XmlIndexLookup > class returning the number of its referred nodes ? This would be the > same as calling XmlIndexLookup::execute() then XmlResults::size(), but > without the overhead of creating a XmlResults object, which in a large > dataset could waste too many resources. The solution would be using > the > DBXML_LAZY_DOCS flag (to save resources) on the > XmlIndexLookup::execute() call, but that will not allow the call on > XmlResults::size() to be performed (throwing LAZY_EVALUATION). > > Would this be accomplished internally by calling Db::stat() ? If it > would, there should be no problems in implementing it - or would it ? > > Thanks. > > -- > Best regards, > Steve mailto:[email protected] > > > > ------------------------------------------ > To remove yourself from this list, send an > email to [email protected] > ------------------------------------------ To remove yourself from this list, send an email to [email protected]