WIP: CS-5432

First draft for optimizing backend search.

Please merge takeit's sql_optimize branch first.
I guess, right now you cant search for 1 character. I dont know if it makes much difference on a performance level. The reason i set it to 2 is that i think most people will search for more characters and then the first search will be cancelled.