22 ms·
Got 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
by atsaloli 11y ago
Got 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.