- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
perf: Skip photos related properties in custom properties #52976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Julius Knorr <jus@bitgrid.net>
614bc8e    to
    24f3b15      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rather not request them in Photos.
| Agreed that photos can avoid, but this one might still be relevant to avoid other cases where anyone requests those properties either through SEARCH but also through a PROPFIND. The Photos PR would still be affected by the N+1 queries when getting the collection | 
| 
 I think we should rather fix those rather than polluting server with 3rd party properties. 
 When getting the collection, the properties will be handled by the photo propfind plugin, so it should not get affected as the  server/apps/dav/lib/DAV/CustomPropertiesBackend.php Lines 150 to 157 in d5be952 
 | 
| 
 The main risk I see is that those queries would still happen if a client behaves badly and requests those even if the app providing them is not handling them or disabled. However maybe we should rethink rather how the filtering is done. The use cases of the custom properties are rather specific, on our instance those are the ones stored: A general allow list does not make much sense there I think, but I was thinking about having one for the owncloud and nextcloud namespaces. For those we should know exactly which ones we want to read from there and can just skip the others. Another topic i remember from the past is that returning null is a common issue in other propfind plugins that then leads to a 404 property that the custom properties backend is still trying to handle (not for photos ones though, those all seem to return proper values). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ugly as hell, and it’s not clear to me why such a list is needed instead of having a list of non-ignored props instead, or something even cleaner.
But the list is already there and ugly, should not harm much to extend it, if it improves perf let’s go, it can be replaced by a proper solution later.
| /backport to stable31 | 
| /backport to stable30 | 
| /backport to stable29 | 
We probably should think about better ways to generally exclude known ones (maybe we can even just skip any in the oc or nc namespace, but this saves 1 query per file in WebDAV search requests that the photos app is doing:
https://blackfire.io/profiles/compare/53aede2e-4560-4dff-8dcc-80e925e2fc4a/graph