RE: [PHP] Long script execution and its implications?
| From: | Mark Cubitt | Date: | Wed, 12 Mar 2003 16:47:51 +0000 |
| Subject: | RE: [PHP] Long script execution and its implications? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139358@lists.php.net to get a copy of this message | ||
a copy of the code you are using might help for suggestions,
and you say each line has upto 5 seprate querys on your db, are you using
seprate tables to hold that data?
> -----Original Message-----
> From: Simon Lusted [mailto:Simon.Lusted@ons.gsi.gov.uk]
> Sent: 12 March 2003 14:57
> To: php-general@lists.php.net
> Subject: [PHP] Long script execution and its implications?
>
>
> Hello,
>
> I hope this question isn't too vague.
>
> I am opening a large csv file (up to 30,000 lines), splitting it out into
> its elements and then making several INSERT, SELECT queries on my DB. It's
> a hack and not very elegant (but as a beginner i will try to work on it in
> the coming weeks)
>
> This process is taking a really long time and I get about 5 or 6 thousand
> lines in and php times out (5 minutes).
>
> Now I could set the max_execution_time to a higher level but in
> the back of
> my mind i think there might be a more correct way to make all
> these selects
> and inserts. Like breaking it up into smaller chunks or something.
>
> My question is multifaceted.
>
> a) i can't echo any status information to the screen while the script is
> executing (because of course it hasn't finished yet). But is
> there a way to
> do this (something like line 3..line 4 etc of csv)?
> b) is there a better way (conceptually) to process such a large file with
> each line having up to 5 separate queries on my db.
> c) what would be the implications of raising the memory limit (i
> am running
> apache/php/mysql on windows xp locally on my laptop)
> d) should i just increase max_execution and live with the blank screen for
> 8 minutes (i'm basically trying to crunch data for later reporting)
>
> Any info, direction to documentation welcome (i did look but as a beginner
> I find its hard to know where to start.)
>
> Thanks
> Simon
>
>
>
> For the latest data on the economy and society
> consult National Statistics at http://www.statistics.gov.uk
>
> **********************************************************************
> Please Note: Incoming and outgoing email messages
> are routinely monitored for compliance with our policy
> on the use of electronic communications
> **********************************************************************
> Legal Disclaimer : Any views expressed by
> the sender of this message are not necessarily
> those of the Office for National Statistics
> **********************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> ******************************************************************
> ************
> This email has been virus checked by the Eclipse Internet
> MAILsafe service
> ******************************************************************
> ************
> www: http://www.eclipse.net.uk/ email:
> eclipse@eclipse.net.uk
> ******************************************************************
> ************
>
>