Best way to update a large DB ?

Bob Sneidar bobsneidar at iotecdigital.com
Mon Jun 13 12:15:47 EDT 2022


If ID is a unique identifier, you should not need the limit. I agree with Mike, you shouldn't need to do anything fancy. A button and a loop should do it. If the data is critical, you may want to step through a few loops to verify, or backup the database first, always a good idea. Nothing worse than discovering you have bad input data halfway through an update like this. 

Bob S


> On Jun 13, 2022, at 01:30 , jbv via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi list,
> 
> I have a mySQL DB with about 400000 entries, and I need to update
> 190000 of them in the following way :
> update myDB set col1 = "blah blah", col2 = "blah blah" where id = 12345 limit 1
> 
> I have a file with all the requests that weights almost 200 Mb.
> I can't upload it via phpMyadmin, because it's too big and running all the requests
> in one go will end up with a server timeout.
> 
> I was thinking of a cron job that would trigger every minute or so, and run a short
> script that would read successive portions of 100 requests and feed them so mySQL.
> 
> Any better idea ?
> Thanks in advance.
> jbv
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list