Subject slow execution of LIKE
Author Ben Johnson
Hi,

The following SP takes 00:00:00:0831 seconds to
execute.

If I change LIKE :sString to LIKE 'GLAX%', it takes
only 00:00:00:0050 seconds to execute!

Can somebody tell me any other alternative.

create procedure PHARMA_MASTER_LOOKUP (
SSTRING varchar(50))
returns (
PHARMA_NM varchar(40),
ID decimal(5, 0))
as
BEGIN
FOR SELECT pharma_nm, id
FROM pharma
WHERE pharma_nm LIKE :sString
ORDER BY pharma_nm
INTO :pharma_nm, :id
DO
SUSPEND;
END


Thank you

Ben

_________________________________________________________
There is always a better job for you at Monsterindia.com.
Go now http://monsterindia.rediff.com/jobs