jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Nuescheler" <david.nuesche...@gmail.com>
Subject Re: count of nodes?
Date Thu, 19 Apr 2007 14:32:22 GMT
hi joe,

thanks for the feedback.
i could imagine that there is still quite a bit of room for performance
improvement for queries that are just interested in the number of
nodes that match, so if you run into performance issues please be
sure to let us know.

regards,
david

On 4/19/07, Ottinger, Joseph <jottinger@techtarget.com> wrote:
> Done, and it works - confirmed kill. However...
>
> What I did in the absence of taking the time to learn Xpath well enough
> to get the actual correct query down was walk the tree recursively. For
> a simple tree:
>
> <foo>
>         <bar>
>                 <baz />
>         </bar>
>         <bletch />
> </foo>
>
> ... The recursive method was faster, ever-so-slightly. I don't have a
> dataset large enough to test more complicated trees yet; when I do, I'll
> let you know what I find.
>
> -----Original Message-----
> From: David Nuescheler [mailto:david.nuescheler@gmail.com]
> Sent: Thursday, April 19, 2007 9:03 AM
> To: users@jackrabbit.apache.org
> Subject: Re: count of nodes?
>
> Hi Joe,
>
> > But wouldn't getSize() on the getNodes() call only get the immediate
> > child nodes?
> No. It would include everything that matched your query which would
> include all the nodes in the QueryResult.
> So the node iterator returned from QueryResult.getNodes() will contain
> all the nodes that matched the query.
> In your case:
>
> /jcr:root/foo//*
> ... will return the nodes
>
> /foo/bar
> /foo/bar/baz
>
> ... and the QueryResult.getNodes().getSize() should return 2
>
> > I'll keep investigating - I still find the Xpath rules a problem. :/
> What do you find a problem about it?
> Do you prefer the SQL syntax?
>
> regards,
> david
>

Mime
View raw message