I recently had to convert one of a table column definition to nvarcharfrom varchar. Since then, I feel like finding data on a table has become slower.
I have 4,200,000+ rows in a table and growing.
My web application does not currently use stored procedures to retrieve data from the database. If I use a stored procedure, will that improve search performance a bit?
Or is there any other advice you would give for improvement?
Here is the query currently in use:
SELECT TOP 100 id, callerID, dateTime, activity, senderNum, msgSent, smsgRespond, msgIn
FROM tbl_activitylog
WHERE callerID = @callerID
ORDER BY id DESC
A column msgSentis one that has been converted to nvarchar.
Below is the table structure:
id (int, Primary Key, Auto Increment)
callerID (bigint)
dateTime (datetime)
activity (varchar(50)
senderNum (int)
msgSent (nvarchar(160))
smsgRespond (varchar(50))
msgIn (varchar(160))
I do not understand part of the index.