saroopchand
asked on
Tunning of SQL query
I have a table which have more than 4m (4,000,000) records.
When i query as
SELECT * FROM TBL_RECORD WHERE NAME = 'test', it takes 2 seconds.
When i use like it takes 4 seconds.
SELECT * FROM TBL_RECORD WHERE NAME like '%test%'
I want to use the like condition in a stored procedure, but can anyone please let me what other statement can i add to faster the query.
When i query as
SELECT * FROM TBL_RECORD WHERE NAME = 'test', it takes 2 seconds.
When i use like it takes 4 seconds.
SELECT * FROM TBL_RECORD WHERE NAME like '%test%'
I want to use the like condition in a stored procedure, but can anyone please let me what other statement can i add to faster the query.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
create index on NAME field - if you have not yet