wimsymons commented on pull request #24:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/24#issuecomment-732011752


   > @wimsymons
   > The initial thought was changing the query itself.
   > But as the number path will increase, we need to append ISDESCENDANTNODE 
with "OR" keyword.
   > 
   > Sample query:
   > `SELECT [sling:alias] FROM [nt:base] AS page WHERE (ISDESCENDANTNODE(page 
,"/content/") OR ISDESCENDANTNODE(page ,"/apps/")) AND [sling:alias] IS NOT 
NULL`
   > 
   > As we are checking multiple paths, will it not slow down the query 
performance as the path will increase?
   > 
   > Update:
   > As i was not sure about the performance of 'ISDESCENDANTNODE', did not 
follow that path
   
   Performance for ISDESCENDANTNODE is great, even with multiple OR-s. The 
(Lucene) query engine will take care of that.
   You can specify up to a 1000 OR's (this is configurable), but I don't think 
you will have that many aliasPathAllowList entries. That would be limited to 
about 1-10 entries. (Most of the time it should only be looking at `/content`).
   
   When you have 0 entries (and target the whole repository), it could even 
make sense to add an inverted condition not to process `/jcr:system`, like 
`WHERE NOT ISDESCENDANTNODE(page, "/jcr:system") AND [sling:alias] IS NOT NULL`.
   
   Don't know if the ISDESCENDANTNODE will work when the paths have trailing 
`/` though. I'm sure `ISDESCENDANTNODE(page ,"/content")` will work, but not 
sure about `ISDESCENDANTNODE(page ,"/content/")`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to