If you have a sql statement that takes HOURS - then you need to spend some time fixing your database! You should be able to do complicated multi-table joins on tables having millions of rows in only a fraction of a second. Maybe you need a better indexing strategy?

But if it can't be fixed - then it sounds like you're trying to "web-ify" an app that just isn't well suited for the web. Consider setting up a batch process system instead. The web app will let users submit a job request. Once a job is created, they can go do something else. Later, they can return to check on the status of their job (pending, running, completed, failed, etc.). This way all the web app has to do is write a line of text into a "todo" list. You can setup a cron job to check the list every 15 minutes or so and begin processing any new jobs that it finds. You can add a "kill job" button the the "check status page", etc.

In other words, it sounds like this isn't the kind of job you do in "real time", even if you're sitting at a mysql prompt - so don't try to make it "real time" via a web interface.


In reply to Re: Perl and Apache… Process keeps running. by scorpio17
in thread Perl and Apache… Process keeps running. by clintonm9

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.