WIP: CS-5432

First draft for optimizing backend search.

Please merge takeit's sql_optimize branch first.
yeah you are right, but some ppl may used to use proposal I wrote :) anyway result will be limited so if they search for example something starting by `a` it will display them only some first results