Subject Re: [firebird-support] INDEXes for a Query
Author Dimitry Sibiryakov
On 18 Mar 2004 at 15:38, James wrote:

>> WHERE UPPER(W.WPName) LIKE UPPER('%oeder%')
>> AND
>> UPPER(W.WPDescription) LIKE UPPER('%kwe%')
>> AND
>> W.CityVBSQ IN (200) ORDER BY 2 , 1
>>
>IMHO putting indexes on WPName, WPDescription, CityVBSQ, CITYNAME and
>WPOrder is good.

No. LIKEs above can't use indices at all. Indices on WPOrder and
CityName can't speed ordering too. CityVBSQ is already indexed
because it is a part of FOREIGN KEY.
If Uwe could transform comparsions into STARTING WITH, then, using
pre-uppercased indexed "shadow columns", this query might became
faster.

SY, Dimitry Sibiryakov.