Hi Nicklas, not a solution, but I've encountered equal issues at a join with a isdescentdantnode criteria like:
SELECT * FROM [nt:resource] AS Res INNER JOIN [aeb:unstructured] AS Data ON ISDESCENDANTNODE(Res, Data) WHERE CONTAINS(Res.*,'*Gruppen*') AND (Data.Client,'TEST') All res nodes are below the data nodes, the idea was to query only the res nodes of one specific client (which is a property of the data node). This takes some time and ends with an out of memory. Guess there is no such thing as a query optimizer... (didn't had the time to investigate here further) Regards, Robert Von: Nicklas Löf [mailto:[email protected]] Gesendet: Mittwoch, 13. Februar 2013 17:24 An: [email protected] Betreff: Strange search performance Hi, I'm using JCR-SQL2 and have hit a strange performance problem. If I do search for something with a ISDESCENDANTNODE in two different paths with two different queries I get results back quickly. If I now join those two ISDESCENDANTNODE in one query the execution of this query is becoming really really slow. Is there another way to do this or have I found a bug? I'm using jackrabbit 2.4.4 (compiled from SVN-source because I needed the NIOFS/SimpleFS-patch) See this examples: Search in the first path: JCR-SQL2##SELECT * FROM [nt:base] AS document WHERE documentType='xxxxxxxxxxxxxxx' AND CONTAINS(document.name,'hello*') AND ISDESCENDANTNODE(document,'/root/60edd27f-86bc-4f82-8bc0-714ea595823b/libraries/2882ab8e-2d77-4568-adf1-9b0fe3e0b739') Found 3 results Search took 262 ms Search in the second path: JCR-SQL2##SELECT * FROM [nt:base] AS document WHERE documentType='xxxxxxxxxxxxxxx' AND CONTAINS(document.name,'hello*') AND ISDESCENDANTNODE(document,'/root/60edd27f-86bc-4f82-8bc0-714ea595823b/6c6f5fcb-44ae-4407-8da7-d77a2a70c23e') Found 0 results Search took 230 ms Joined query: JCR-SQL2##SELECT * FROM [nt:base] AS document WHERE documentType='xxxxxxxxxxxxxxxxxx' AND CONTAINS(document.name,'hello*') AND (ISDESCENDANTNODE(document,'/root/60edd27f-86bc-4f82-8bc0-714ea595823b/libraries/2882ab8e-2d77-4568-adf1-9b0fe3e0b739') OR ISDESCENDANTNODE(document,'/theTeneoRoot/60edd27f-86bc-4f82-8bc0-714ea595823b/6c6f5fcb-44ae-4407-8da7-d77a2a70c23e')) Found 3 results Search took 161224 ms /Nicklas ________________________________ Treffen Sie AEB vom 19.-21. Februar 2013 auf der LogiMAT in Stuttgart. Halle 5, Stand 261. Vereinbaren Sie jetzt einen Termin und Sie erhalten eine Eintrittskarte. www.aeb.de/logimat
