jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@day.com>
Subject Re: Query Performance and Optimization
Date Wed, 14 Mar 2007 15:44:34 GMT
Hi Christoph,

Christoph Kiehl wrote:
>> I've created a jira issue: http://issues.apache.org/jira/browse/JCR-791
> Are you working on this issue? Or should I try to implement something?

I just started working on it ;)

> Actually it's /foo/*[@foo:bar!='john']

ah, yes. that makes sense.

>> @foo:bar='john' should be translated into a term query.
> You are right. "="-comparisons translate into term queries whereas 
> "!="-comparisons gets translated into MatchAllQueries.
> It seems like if I rewrite the following query from
> /foo/*[@foo:bar!='john' and @foo:bar!='doe']
> to
> /foo/*[not(@foo:bar='john' or @foo:bar='doe')]
> I get a better performance. Can you confirm this?

Yes, I can. Basically because any != comparison is translated into: get all 
nodes with the given property, then exclude the ones that match the literal. 
Which is obviously much more expensive than just: get all nodes that match a 
given literal.


View raw message