I am trying to reset some values in a large table having around 4 million records.
I just wanted to know which approach is better:
UPDATE TABLENAME SET VAL1=0, VAL2=0, VAL3=0;
or
foreach ( $catIds as $catId )
execUpdate("UPDATE TABLENAME SET VAL1=0, VAL2=0, VAL3=0 WHERE CAT_ID='".$catId."';");
So the actual question is that is it safe to run it all at-once or the update should be broken into chunks?
Regards