frontend
frontend copied to clipboard
Slow file search on large databases
Issue Name
SlowFileSearch
Summary
If you query in the File view by one of the "contains" columns the query can take very long
Steps to Reproduce
Query just by filename in the first column on a large databse (>100 M Files)
Current Behaviour
Query does not return within client timeout
Expected Behaviour
Query returns before timeout
Extra Details
As an intermediate solution all "contain" conditions should be replaced by "startsWith" conditions, because in this case the resulting regexp query can make use of the indices (, e.g. /^sometext/ rather than /sometext/). Queries are usually also much faster, if first a fulltext query is done. For the future asking for at least one condition for one of the current "contains" columns before submitting a search would also mitigate the problem.