jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Popescu" <the.mindstorm.mailingl...@gmail.com>
Subject Re: NodeIterator very slow
Date Mon, 05 Feb 2007 11:28:51 GMT
I must confess that I hit in the past a similar problem and posted
about it. In my environment (Jackrabbit 1.0, 1-2 hundred nodes)
executing an XPath query vs normal navigation + manual ordering +
filtering is 100 slower (not to speak about the CPU utilization).
Finally I moved away from using queries as we haven't been able to
pinpoint the problem and solve it (I have profiled it and the time was
spend mainly in 2 points: access rights verification and some Lucene
internal call - if my memory is not completely lost something like
Document.next()). The code is much more uglier as we need to filter
each node, traverse them all to order according to a property value,
but the speed plus CPU consumptions have greatly improved.

./alex
--
.w( the_mindstorm )p.




On 2/5/07, Sridhar Raman <sridhar.raman@gmail.com> wrote:
> When does the query actually get executed? This is my code:
>       try
>       {
>          qr = query.execute();
>          entiter = qr.getNodes();
>       }
>       catch (Exception e)
>       {
>          logger.error("Executing entity query", e);
>       }
>
> These two statements are done quite quickly. And when I inspect the entiter
> variable, it shows 2000 nodes.
>
> It's when I do either an entiter.hasNext() or an entiter.nextNode() that the
> problem occurs. Will your suggestions of config tweaks help here?
>
> On 2/5/07, Marcel Reutegger <marcel.reutegger@gmx.net> wrote:
> >
> > Sridhar Raman wrote:
> > > I am executing an XPATH query. And I get the NodeIterator iter from the
> > > QueryResult.getNodes(). This iter is the one causing the problem.
> >
> > Then I'd assume it's the query that takes a long time to execute.
> >
> > You can try the following configuration tweaks:
> >
> > - disable document order on the query result
> >    See: http://issues.apache.org/jira/browse/JCR-145
> > - set the paramter 'resultFetchSize' to a lower value if
> >    you don't need all 2000 nodes, but are only interested
> >    in the first few. please note however, that there are
> >    security concerns with this option:
> >    http://article.gmane.org/gmane.comp.apache.jackrabbit.devel/10103
> >
> > > Could you tell me what I need to do to get a thread dump from a java
> > > process?
> >
> > on unix:
> >
> > kill -QUIT <java-process-id>
> >
> > on windows:
> >
> > Ctrl-Break in the console where you started the java process
> >
> > The thread dump is sent to the standard out of the java process.
> >
> > regards
> >   marcel
> >
>

Mime
View raw message