I am using extremely large tables that are very actively used by members of my site. I do have a few indexes on my table. I know that indexes cut down on how long it takes to retrieve information, but they also slow down the process of UPDATING or INSERTING into that same table. I want to update a particular member's account which would require that I UPDATE about 12 fields in the table at once. I find that every now and then my table is locking up. My question is, which is more efficient to do an UPDATE ? Would I make 12 individaul UPDATES that change one field each (below) or would I make one UPDATE with 12 field changes (below). I know that the latter is probably more efficient and and quicker by itself. But in av ery busy environment, which is the most effcient with a VERY busy site and least likely to lock up the table?
mysql_query("UPDATE profile SET sex='$sex' WHERE username='$username'");
mysql_query("UPDATE profile SET country='$Zcountry' WHERE username='$username'");
mysql_query("UPDATE profile SET state='$state' WHERE username='$username'");
mysql_query("UPDATE profile SET age='$age' WHERE username='$username'");
mysql_query("UPDATE profile SET height='$height' WHERE username='$username'");
mysql_query("UPDATE profile SET sex='$sex', country='$Zcountry', state='$state', age='$age', height='$height', age='$age', estimatedworth='$estimatedworth', yearlyincome='$yearlyincome', occupation='$occupation' WHERE username='$username'");