The search itself is to give a difference close to zero. Of course, a more character analysis can make the search a little slower, but this is almost theoretical, because the bulk of the search work is not the comparison of the characters. I’d say the difference must be less than 0.1%.
Only that looking for a single letter should generate an immense amount of results, and will have to transmit (on several levels) all this, obvious that transmitting more information will take longer. So for indirect reasons looking for a character can be a little, or even a lot slower in the end result, unless you don’t find something, which is unlikely.
The biggest problem is being able to search anywhere. This prevents the use of a normal index. Then it doesn’t make much difference whether you’re looking for one or a bunch of characters together. But don’t think it’ll be a tragedy to do so.
Actually fits the usual recommendation: test in your case.
If you think it’s not right maybe it’s a case of using one inverted index, also called full text index. The Postgresql has this feature, but I can’t guarantee that it will be useful for your case. Not always the win is great.
If you’re using a web client or something like that, it’s possible that network latency and intermediate processing affects more than access to the database. Especially if the accesses are interactive to the database (each character typed makes a search). There it works best locally, if possible in application embedded databases.
You say search for in
a
anywhere ora
only at the beginning?– Maniero
@bigown anywhere, any record that has the character
a
– Paulo
Yes the search for the second letter only starts after the first found.
– mau humor