That is a horrific idea. Title should be: "Update 2 records by updating everything else with itself". Kudos for thinking outside the box but what made you think this would save time?
The whole idea was to make a single update query instead of 1000. In the end it seems it's better to run 1000 update queries indeed as long as you do them all at once (eventually in a transaction).
Try batching the queries in your driver.. that will essentially reduce the number of requests to the DB to a minimum! Move away from lame PHP and try doing stuff in a real programming language.
Comments
rick replied ago:
Interesting technique, Indy.
kbilsted replied ago:
this hack will destroy any db with a reasonable size. don't do it!
,
legendx replied ago:
That is a horrific idea. Title should be: "Update 2 records by updating everything else with itself". Kudos for thinking outside the box but what made you think this would save time?
indy2kro replied ago:
The whole idea was to make a single update query instead of 1000. In the end it seems it's better to run 1000 update queries indeed as long as you do them all at once (eventually in a transaction).
kbilsted replied ago:
Try batching the queries in your driver.. that will essentially reduce the number of requests to the DB to a minimum! Move away from lame PHP and try doing stuff in a real programming language.
Voters For This Link (9)
Voters Against This Link (8)