SQL Optimizing Tip

Just yesterday I was talking to a friend of mine by the name of “Zero Tolerance” pretty known vBulletin/IPB programmer. He was explaining to me why free forum software shouldn’t go the “noob route”.

UPDATE Clause Locks the sql table

He was telling me how vBulletin works and was explaining to me that when a user views a topic they don’t update the topics table because thousands of users visit the topics A LOT when on a big community specially like vB support forum. They instead of using UPDATE clause they use INSERT clause because its a less priority towards the sql server. So picture 300 members viewing a topic the sql table is Updating Locking the table and unlocking the table constantly just to add +1 to the total views. This could terribly kill your sql server resulting in a db shut down.

So try avoid using the “UPDATE” clause at the wrong times. Everyone don’t edit their post at the same time, but I’m pretty sure a lot will view a topic at the same time on a big topic or announcement.

Leave a comment