Alex Lukin wrote:
My test results below.
About repository content. It is quite simple. Repository contains small
articles (topics) in category hierarchy. Topic itself is node with properties
and few subnodes. Hierarchy of categories has 3-5 levels. My tests was
conducted on appr. 1000 topic nodes in appr. 40 categories. Categories are
created by user so I can not know how much levels hierarchy has.
Queries and execution times:
1. "/jcr:root/myContent/en/topics//*/my:topic" - 110 seconds.
> 2. "//topics/*/my:topic" - 43 seconds
performance for queries 1 and 2 should be better with the recent changes from
JCR-1365.
> 3. "//element(my:topic)" - 12 seconds.
how many results are returned? is the time measured executing the query or does
it include iterating over the result set? did you set respectDocumentOrder to
false in workspace.xml? how much time does it take to execute the following
query: //element(my:topic) order by @jcr:score
If query contains some parameters times do not go much worse. There's almost
no disk activity and processor load is 100% during query execution. Must be
mentioned that repository reading by webdav browser is quite fast even in
time of query execution.
My quick and dirty function that just traverses all tree from
/jcr:root/myContent/en/topics without any caching gives result in 120 ms
first time and 30 ms next times.
I tested SQL queries and performance approximately is between query #2 and
#3. Should be said that SQL is quite buggy and cannot be used.
if you find bugs in SQL please report them as jira issues. thank you.
regards
marcel