Subfolder Search
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
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?

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading lib/private/files/view.php and cache.php, focusing on how recursive subfolder searches build and execute SQL queries. Reproduce the search with depth set to -1 and compare query counts before and after any investigation. Done means the intended query reduction and subfolder-search behavior are clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, databases, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100