>>sys(3054,1) >>select * from lender where short like "A%" && Partial >>set ansi off >>select * from lender where short="A"&& Full
>clear >lcAlpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' >for K = 1 to 5 > close tables all > lnStart = seconds() > for i = 1 to 100 > for j = 1 to 26 > cCity = substr(lcAlpha, j, 1) > select * from customer where upper(city) = ?cCity ; > into cursor crsTemp nofilter > endfor > endfor > lnFinish = seconds() > ? > ? "Equal:", lnFinish - lnStart > close tables all > lnStart = seconds() > for i = 1 to 100 > for j = 1 to 26 > cCity = substr(lcAlpha, j, 1) + "%" > select * from customer where upper(city) like ?cCity ; > into cursor crsTemp nofilter > endfor > endfor > lnFinish = seconds() > ? "Like:", lnFinish - lnStart >endfor >return>For 2600 iterations of the same SQL except for the parameter value, I got the following results in seconds:
>Like Equal
>------ ------
>28.183 27.830
>28.164 27.857
>28.114 27.867
>27.951 27.876
>27.951 27.857
>28.005 27.994
>28.117 27.971
>28.186 28.195
>28.188 27.903
>28.176 27.853
>The Like operation returns partial optimization, while the Equal operation returns full operation. YMMV.