Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl and MySQL update question

by saberworks (Curate)
on Nov 19, 2007 at 04:35 UTC ( [id://651582]=note: print w/replies, xml ) Need Help??


in reply to Perl and MySQL update question

If it is going to take longer than a few minutes, you're going to have a really hard time making it work. Even if the server doesn't time out (which it probably will), browsers have their own timeouts as well. The other thing you have to consider is that even if the browser times out, it's possible that the command will continue to execute on the server even after the browser errors out.

The most reliable way to do this would be to write a regular script and execute that.

As for performance tips - add an index on all the date columns, that will severely speed up the lookups (but also slowdown the inserts -- but I bet it will be faster regardless). I remember there being an option in MySQL to temporarily turn off rebuilding indexes (so updates can happen faster), but I can't find it now.

If you really, really, really need to do this over a cgi script, you can use apache::session or something to keep track of exactly which rows need to be updated, and then do them a few hundred at a time, returning to the browser with a meta-refresh in the <HEAD> section. The old UBB bulletin board we used years ago used to do that. It's not perfect but maybe it will work for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://651582]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found