I have a table that stores userid, sessionid, and logintime. I have indexes (neither clustered) on userid and sessionid.
The query I'm running is to clear out expired sessions (through a loop in a program):
update logins set sessionid = null, logintime = null where userid = 9999
The query times out. I took the query and ran it in SQL Analyzer and let it run for 6 minutes before killing it.
Do you think the issue is that I'm updating an index field, and that's why it's taking so long? It is a very dynamic field - constantly beign updated throughout the day.
Any suggestions would be helpful, thanks!
The query I'm running is to clear out expired sessions (through a loop in a program):
update logins set sessionid = null, logintime = null where userid = 9999
The query times out. I took the query and ran it in SQL Analyzer and let it run for 6 minutes before killing it.
Do you think the issue is that I'm updating an index field, and that's why it's taking so long? It is a very dynamic field - constantly beign updated throughout the day.
Any suggestions would be helpful, thanks!