{"action":"opened","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/14173","labels_url":"https://api.github.com/repos/owncloud/core/issues/14173/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/14173/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/14173/events","html_url":"https://github.com/owncloud/core/issues/14173","id":57505593,"number":14173,"title":"Optimize reading quota/free space on PROPFIND","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-12T19:14:44Z","updated_at":"2015-02-12T19:14:44Z","closed_at":null,"body":"@icewind1991 I did some debugging and I noticed that when you do a PROPFIND it will return the quota/free space for every subfolder too.\r\n\r\nThe problem is that getFileInfo() is likely to be called multiple times on the same node and so far we don't cache it. This means that this will cause additional DB queries, one for every file for which we want to get the quota/size in `OC_Helper::getStorageInfo()`:\r\n```\r\n0  OC\\Files\\View->getFileInfo() /srv/www/htdocs/owncloud/lib/private/files/view.php:936\r\n1  OCA\\Files_Encryption\\Proxy->postFileSize() /srv/www/htdocs/owncloud/apps/files_encryption/lib/proxy.php:341\r\n2  OCA\\Files_Encryption\\Proxy->postGetFileInfo() /srv/www/htdocs/owncloud/apps/files_encryption/lib/proxy.php:309\r\n3  OC_FileProxy::runPostProxies() /srv/www/htdocs/owncloud/lib/private/fileproxy.php:124\r\n4  OC\\Files\\View->getFileInfo() /srv/www/htdocs/owncloud/lib/private/files/view.php:984\r\n5  OC\\Files\\Filesystem::getFileInfo() /srv/www/htdocs/owncloud/lib/private/files/filesystem.php:793\r\n6  OC_Helper::getStorageInfo() /srv/www/htdocs/owncloud/lib/private/helper.php:909\r\n7  OC\\Connector\\Sabre\\Directory->getQuotaInfo() /srv/www/htdocs/owncloud/lib/private/connector/sabre/directory.php:236\r\n8  Sabre\\DAV\\CorePlugin->Sabre\\DAV\\{closure}() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php:792\r\n9  Sabre\\DAV\\PropFind->handle() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/PropFind.php:98\r\n10 Sabre\\DAV\\CorePlugin->propFind() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php:794\r\n11 call_user_func_array:{/srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105}() /srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105\r\n12 Sabre\\Event\\EventEmitter->emit() /srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105\r\n13 Sabre\\DAV\\Server->getPropertiesByNode() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php:1016\r\n14 Sabre\\DAV\\Server->getPropertiesForPath() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php:936\r\n15 Sabre\\DAV\\CorePlugin->httpPropfind() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php:327\r\n16 call_user_func_array:{/srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105}() /srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105\r\n17 Sabre\\Event\\EventEmitter->emit() /srv/www/htdocs/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php:105\r\n18 Sabre\\DAV\\Server->invokeMethod() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php:469\r\n19 Sabre\\DAV\\Server->exec() /srv/www/htdocs/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php:254\r\n20 require_once()  /srv/www/htdocs/owncloud/apps/files/appinfo/remote.php:62\r\n21 {main}          /srv/www/htdocs/owncloud/remote.php:54\r\n```\r\n\r\nThere must be a way to either cache the file info or simply shortcut the free-space querying when coming from a PROPFIND operation.\r\n\r\nWhat do you think ?"}}