SQL2 Query with multiple path
I have the below query giving node traversal error. We have index in place for all the properties and using query manager we can see the right index is being picked also.
SELECT * FROM [dam:Asset] AS a WHERE (ISDESCENDANTNODE(a,[/content/dam/test/vendor/external]) OR ISDESCENDANTNODE(a,[/content/dam/test/team]) ) AND a.[jcr:content/notificationSent] = 'false' AND a.[jcr:content/dam:assetState] = 'processed' AND a.[jcr:content/jcr:lastModified] >= CAST('2023-05-21T18:30:00.000Z' AS DATE)
But the same query when ran with individual paths with out OR clause give results.
For eg:
SELECT * FROM [dam:Asset] AS a WHERE (ISDESCENDANTNODE(a,[/content/dam/test/vendor/external]) ) AND a.[jcr:content/notificationSent] = 'false' AND a.[jcr:content/dam:assetState] = 'processed' AND a.[jcr:content/jcr:lastModified] >= CAST('2023-05-21T18:30:00.000Z' AS DATE) ----> gives results
SELECT * FROM [dam:Asset] AS a WHERE ( ISDESCENDANTNODE(a,[/content/dam/test/team]) ) AND a.[jcr:content/notificationSent] = 'false' AND a.[jcr:content/dam:assetState] = 'processed' AND a.[jcr:content/jcr:lastModified] >= CAST('2023-05-21T18:30:00.000Z' AS DATE) -------> gives results
When i add both the paths in the same query with a OR clause, it gives node traversal error
Can someone help on what is causing this issue in the first query above?