RE: [coldbox:11886] SQL DeadLock

Optimizing isn’t really how you solve deadlocks. Optimizing “helps” because it shrinks the window for the race conditions, but it really boils down to the order in which you lock shared resources.


Brad, I was referring to the fact that the query is running as fast as I can get it, and is as small as I need it. I know I can use pure SQL to do the job as well, but I am no guru when it comes to SQL and this is a complicated query that I wouldn’t know where to begin with then making the updates to update the weights of the rows in the same select statement.

That would be the furtherest I could optimise the query.

As for the code, it runs very fast, it takes a total of about 30ms for the larger query and almost 1ms or less to update the rows. But it is a window none the less that is causing an issue.