nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.24k stars 4.05k forks source link

Subfolder Search #37434

Open zenith0212 opened 1 year ago

zenith0212 commented 1 year ago

Hello, everyone. I am using nextcloud server, and I need some features, such as sub folder search. So I decided to modify nextcloud server code, and found depth variable of nextcloud. So I set this variable -1 and it seems to behavior right. But I found that number of sql queries increased very highly. Through some research, I know nextcloud uses recursive search and every search runs some queries in subfolder search. This is too heavy. Why doesn't nextcloud reduce the number of queries? Please see lib/private/files/view.php and cache.php. Here, nextcloud request and build some sql queries. I modified cache.php. So the number of queries is reduced. But one question. Why doesn't nextcloud use this method? Annotation 2023-03-27 164410

XueSheng-GIT commented 1 year ago

I saw that @artonge is working on some optimizations in regards to search (e.g. https://github.com/nextcloud/server/pull/36701). Thus maybe related.

joshtrichards commented 1 year ago

I suspect because someone simply needs to get around to submitting a PR. Why don't you submit your initial changes as a PR and see where it evolves from there? :)