From: James F. <jam...@gm...> - 2009-11-27 14:43:43
|
On Fri, Nov 27, 2009 at 3:35 PM, Andrzej Jan Taramina <an...@ch...> wrote: > I'm trying to optimize some of our query code, and have a function that > basically does something like this: > > exists( collection( ...)[ some predicates ] ) would be useful to have some example predicates .... a lot of times exists() can be rewritten to take advantage of 'early exit' ... if eXist is doing this rewriting is another question. > all of the predicates have range indexes, so the lookup should be fast. > > But does eXist load the whole document for the predicate match from the > DB, create the sequence and then apply the exists() function? > > Since we don't care about retrieving the documents, just if they exist > or not, I was wondering what was going on under the covers, since > retrieving many large documents is probably adding a lot of time to our > query, and thus driving 30 second response times in the particular case, > since we will call this function 100 times for a particular user query > scenario. > > Would there be an alternative way to determine the existence of a > document matching our indexed predicates, where it only uses the index > and doesn't ever retrieve the full document? you could retrieve the xml from calling the collection via the RESTful interface (which would be the directory listing) ... if this is smaller then your doc/docs then this maybe 'cheaper' to process. Jim Fuller |