Since it was mentioned in another thread, I decided to run a very simplistic benchmark on DT’s search with and without wildcards.
Here’s the JavaScript code
(() => {
const app = Application("DEVONthink 3");
const searchTerms = ['text:auszug datum', 'text:auszug* datum*', 'text:*auszug* *datum*'];
const runs = 100;
searchTerms.forEach(term => {
const start = Date.now();
var result;
for ( i = 0; i < runs; i++) {
result = app.search(term);
}
const end = Date.now();
console.log(`"${term}" search ${(end - start)/runs} ms per run ${result.length} matches`);
})
})()
And here are the results for a set of search terms. The “key learning” is (not surprisingly) that more wildcards slow down the search. Especially so if you search for more than one word (see the last three lines of the results):
With no wildcards, the search is very fast. Prepending wildcards to every word causes a 12-fold slowdown (while the number of matches increases only by 3.3). Appending wildcards to every word increases search time tenfold. And fencing every word with wildcards nearly doubles the search time again.
"text:auszug datum" search 24.02 ms per run 143 matches
"text:*auszug *datum" search 293.65 ms per run 484 matches
"text:auszug* datum*" search 245.8 ms per run 189 matches
"text:*auszug* *datum*" search 401.7 ms per run 509 matches
All this for 9 databases with a total of 4.6GB and less than 20000 files. As one can see, search time for two wildcard-fenced words is nearly half a second. For three words, the differences get bigger:
"text:auszug datum herrn" search 23.41 ms per run 62 matches
"text:*auszug *datum *herrn" search 384.79 ms per run 269 matches
"text:auszug* datum* herrn*" search 220.25 ms per run 103 matches
"text:*auszug* *datum* *herrn*" search 675.54 ms per run 282 matches
Now, search time for wildcard-fenced words is nearly 30 times longer than for words without wildcards.
All that seems to indicate that it’s not a very good idea performance-wise to systematically fence all words with wildcards.