jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Search performance issue
Date Fri, 31 Mar 2006 08:12:04 GMT
C├ędric Damioli wrote:
> In my repository, I have a Node named 'content' under which I have an 
> arbitrary number of Node. Under each of these Nodes, I have one Node 
> named 'fr'.
> 
> My exemple query is simple: I want to get all "fr" Nodes.
> 
> 1) I executed the following query : "//content/*/fr". The result is ok 
> but the execution took more than 80s (the whole repository has more than 
> 100 000 Nodes and more than 1 000 000 properties)
 >
> 2) I executed the query "//content/*" followed by a small Java loop for 
> getting the "fr" subNode of each result. The whole thing took only a 
> couple of seconds.

I assume the result set is quite large, therefore you should disable 
document ordering on result nodes in the search configuration. per 
default result nodes are ordered in document order, which is an 
operation that is performed without information from the search index. 
That is, all information must be loaded through the persistence manager 
to arrange the result nodes in document order.

adding the following parameter in SearchIndex tag in workspace.xml will 
do the trick:
   <param name="respectDocumentOrder" value="false"/>

for more details on index configuration see also:
http://svn.apache.org/viewcvs.cgi/jackrabbit/trunk/jackrabbit/src/main/config/repository.xml?view=markup

as a quick workaround you can also append an order by clause to the 
query, this will also avoid document order on the result nodes:
//content/*/fr order by jcr:score

If you already disabled document order then 80 seconds is IMO not 
acceptable. In that case could you please file a jira issue.

> Is it the normal behaviour ? Does the query have to end with "/*" to be 
> correctly handled by Jackrabbit ?

no, the query can also end with a name test that is not *

regards
  marcel

Mime
View raw message