perf: replace recursive spawn-per-folder search with O(1) ltree queries

- Add search_files_in_subtree() to FileReadPort with ltree-based SQL
- Add list_descendant_folders() to FolderRepository with ltree GiST index
- Implement both in PG repositories (single query per entity type)
- Remove search_parallel() fan-out (O(N) tokio::spawn → 0 spawns)
- Remove passes_file_filter/passes_folder_filter (filtering now in SQL)
- Fix SearchCriteriaDto cache key: JSON serialization → u64 hash (15x faster)
- Fix escaped quote literals in webdav_handler.rs handle_put function
This commit is contained in:
Diocrafts
2026-02-23 00:17:40 +01:00
parent 92e0364a60
commit b501c4052b
7 changed files with 379 additions and 277 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
* to filter files and folders in the system. It supports various filter types
* including name matching, file types, date ranges, and size constraints.
*/
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Hash, Serialize, Deserialize)]
pub struct SearchCriteriaDto {
/// Optional text to search in file/folder names
#[serde(skip_serializing_if = "Option::is_none")]