3 ms·
Yes, this was one of the first things I tried. It cut down on the extremely long queries, but on average was about the same time if not longer. The cached outpu
by brbsix 11y ago
Yes, this was one of the first things I tried. It cut down on the extremely long queries, but on average was about the same time if not longer. The cached output from find was hundreds of mB in total. Despite it's drawbacks, `mlocate` is a speedier alternative. Just interested in finding out what sort of better tools are out there. If only I could get access to Bitbucket source and see how they managed. :)
- atsaloli 11y agoGot it. Do you search based on pattern in the filename only, or on the pattern in the full path to the file? I ask because my next suggestion would be to put the output of find into a database so you can have the benefit of modern indexing technologies instead of just having a linear index. (If that works out, you might want to go the whole hog and put the objects into the database too.)
- brbsix 11y agoI only search based on pattern in the filename. So I was using find: -name '*something*' locate: --basename Or to search the cached find output: grep -P '(?<=/)[^/]*something[^/]*$' find_output.txt Using modern indexing technologies sounds like a great suggestion. Any idea where to start with this? I don't have much in the way db experience.
- atsaloli 11y agoI would recommend storing the data in Postgres (advanced open source database). See how searching the table compared to using find. You can optimize further by adding indexes. Postgres supports indexing based on regular expressions so that if there are particular regular expressions that you often search for, you can index on that.