I need to track the history of files and need to show history to a user based on the selected node. I am using Apache jackrabbit to get the data for a particular version label. I am using the following query:
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]
But my version DB has 133129 records. Query is taking 35 minutes to execute. Please let me know how can I achieve best performance time. Anybody having similar requirement and implemented with good performance, please let me know. Thanks in advance.
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);
}