Hi all,
I have a test repository with 1000000 of nodes of type [wr:document].
These nodes are contained in a hierarchy of [wr:folders] constructed like
following:
100 first level [wr:folder];
In each first level [wr:folder] there are 100 second level [wr:folder];
In each second level [wr:folder] there are 100 [wr:document] for a total of
1000000 [wr:document]
NodeType [wr:document] has a string property called [wrprop:name].
I then perform a query searching for a single document using both XPATH and
JCR_SQL2.
The problem is that with XPATH the query executes in few ms, while using
JCR_SQL2 the repository starts retrieving nodes and hangs.
Attached are the logs of the execution.
This is the code I use to perform the query:
...
QueryManager qm = session.getWorkspace().getQueryManager();
// Query JCR_SQL2
Query query = qm.createQuery("SELECT * FROM [wr:document] WHERE
[wrprop:name] = 'document-0123456'", Query.JCR_SQL2);
// Query XPATH
//Query query = qm.createQuery("//element(*, wr:document)[...@wrprop:name =
'document-0123456']", Query.XPATH);
NodeIterator documents = query.execute().getNodes();
int i = 0;
while(documents.hasNext()){
documents.next();
i++;
}
System.out.println("Found " + i + " documents");
I think that this is a bug.
Before I fill a bug in Jira, can anyone confirm this behaviour?
BR
Luca Tagliani
http://jackrabbit.510166.n4.nabble.com/file/n2250602/QueryInSQL2.txt
QueryInSQL2.txt
http://jackrabbit.510166.n4.nabble.com/file/n2250602/QueryInXPATH.txt
QueryInXPATH.txt
--
View this message in context:
http://jackrabbit.510166.n4.nabble.com/Serious-problem-on-JCR-SQL2-query-tp2250602p2250602.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.