I keep many work-related SQL convenience scripts. For a while I've been using a convention of having several AND clauses in the where statement that I can activate by providing a value or values to search on. For example,
where color like '%&color' and size like '%&size'
When I run such SQL in my preferred client (Golden6) it pops up a dialog box where I can provide values for color, size or both. Very convenient, but the performance of LIKE '%string' is often terrible, often resulting in a full table scan, or so I have read.
Is there some alternative technique for writing and managing these scripts that maintains the convenience of being able to fill in only the arguments I want to use, yet avoids the performance issues around LIKE '%string'? I don't want to have to edit the script each time I use it, because I keep them in git and I don't want to manage having a bunch of locally modified files to sort out all the time.