Quote:
Originally Posted by Rik Brown
ps: I forgot to mention about the "AND post.title <> thread.title". I believe its quite necessary. Otherwise all posts (we have 1.2 million) would be updated each time the query is run and that would be a real drag on the server. Instead, with this limiting line of code it just updates those posts that do not match and thus limits the load on the server and the time to run the query.
|
SQL performance can be a funny thing. It really depends. If it cannot make use of an index on the post and thread titles, then it might actually be less expensive to do a blind update. You'd have run an EXPLAIN on this to see how it is building the query.