我需要跟踪文件的历史记录,并且需要根据所选节点向用户显示历史记录。我正在使用Apache jackrabbit来获取特定版本标签的数据。我使用以下查询:
SELECT versioned.[jcr:uuid]
FROM [nt:frozenNode] AS versioned
INNER JOIN [nt:version] AS version
ON ISCHILDNODE(versioned,version) INNER JOIN [nt:versionLabels] as node
ON node.[20170921114713] = version.[jcr:uuid]
但我的版本DB有133129条记录。查询需要35分钟才能执行。请告诉我如何才能获得最佳性能时间。任何有类似要求并且表现良好的人请告诉我。提前谢谢。
答案 0 :(得分:0)
Found that query is taking too much of time because of huge data in forzen node. Also getting GC over limit .
Used API to fetch the data. now time decreased to 90seconds.
TreeTraverser traverse = new TreeTraverser(node, null, TreeTraverser.InclusionPolicy.LEAVES);
int count = 0;
for (Node r : traverse) {
count++;
Node parent = r.getParent();
String test = parent.getPath();
VersionHistory history1 = session.getWorkspace().getVersionManager().getVersionHistory(test);
HashSet<String> test1 = printHistory1(history1);
map.put(test, test1);
}