コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

QueryResult.getRows() returning very slowly

Avatar

以前のコミュニティメンバー

I'm doing a very simple query to find tags that match a given search term: 

ex) select * from [cq:Tag] as item where  contains(*,'queryTerm')  and  isdescendantnode(item, '/etc/tags/TagNamespace')

I am not using QueryBuilder. I'm using the JCR Query API directly. The query is executing very quickly never taking more than 44ms. However, when I try to retrieve the results from the query with QueryResult.getRows() or QueryResult.getNodes() my application consistently hangs for anywhere from 10,000 - 20,000 ms. Even more odd, I see these same slow times when there are no query results. 

I'm seeing this on AEM 6.0. 

Any thoughts would be most appreciated. 

1 受け入れられたソリューション

Avatar

正解者
Employee Advisor

Hi,

In the jackrabbit implementation a JCR query is split into 2 parts: the execution and then fetching of the results. The result is returned lazy, therefor the decision was made to deliver the first results fast and accept a delay when displaying further results. This is different to common SQL databases, where you get your result set all at once (after a potential slow execution). So to judge the performance of a query, you always have to consider the execution and the time to fetch.

kind regards,
Jörg

元の投稿で解決策を見る

2 返信

Avatar

正解者
Employee Advisor

Hi,

In the jackrabbit implementation a JCR query is split into 2 parts: the execution and then fetching of the results. The result is returned lazy, therefor the decision was made to deliver the first results fast and accept a delay when displaying further results. This is different to common SQL databases, where you get your result set all at once (after a potential slow execution). So to judge the performance of a query, you always have to consider the execution and the time to fetch.

kind regards,
Jörg

Avatar

Level 10

Generally the JCR API will be faster as its a lower level API.  See this article:

http://www.cqtutorial.com/courses/cq-admin/cq-admin-lessons/cq-performance-tuning/cq-search-performa...