Alexander Klimetschek wrote: > > On Fri, Oct 15, 2010 at 12:18, hwellmann <[email protected]> > wrote: >> I've started with a simple example, creating a repository with 50000 >> nodes > > Are these nodes directly under one node in a flat hierarchy? Note that > you should not have more than ~10k nodes per child node (search the > mailing list for "flat hierarchy" for more info). >
It's a flat hierarchy currently, but even so there should be no need to scan all the nodes....? >> select * from 'nt:unstructured' where myProp = 'myValue' > > This is JCR-SQL from the JCR 1.0 spec, right? > It's supposed to be Query.JCR_SQL2. > Could you try an Xpath query and compare the execution times? > > //element(*, nt:unstructured)[...@myprop='myValue'] > > I did, and this is extremely fast. I also tried a Query.SQL with slightly modified syntax: select * from nt:unstructured where myProp = 'myValue' The XPath and SQL queries return almost instantly. I started with SQL2 since the other query languages are marked as deprecated. Is there a problem with the SQL2 query engine? Should I use XPath instead? Best regards, Harald -- View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-avoid-sequential-scans-in-queries-tp2996800p2996825.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
