On Wed, Apr 30, 2008 at 12:08:50PM +1000, Howard Lowndes wrote: > I'm sorry, I should have been more specific on this. > > It's PHP5 and the input is a text file from a data logger which means that > I have to find the data records then decompose each into the individual > data elements to insert into the database, so it's not just a case of a > simple .SQL file as input. > > The process is: > Read a line from the file. > Decompose the line into the data elements. > For each data element, do a select on the database to see whether it ^^^^^^^^^^^^^^^^^^^^^^^^^^^ > already exists, if not then do an insert into the database. > Rinse and repeat... > > It certainly has the smell of being a PHP memory leak, but how I can work > around it I am just not sure.
You do a select before every insert?! Is the table indexed? If not that might explain the slowdown; a select WILL take longer the bigger the table. Matt -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html