Jump to content


Photo

Script is slowwww.


  • Please log in to reply
2 replies to this topic

#1 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 24 November 2005 - 08:29 PM

I am doing a simple query that deletes all record with a date less than 2003-12-30...

There are about 1.6 million records, and the query will expunge about 950,000 of them.

The script seems to run forever, eventually, by computer says the query browser is no longer responding...

Is it normal for a script like that to take over an hour? or do I have something configured wrong maybe?

BTW, why doesn't this work?
delete from test.labor where `DateNew` =< 1997-01-01;

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 25 November 2005 - 06:00 PM

950000 records. if records are deleted per microsecond, it still takes 950 seconds to complete the deletion. php scripts defaults to run for a max of 30 seconds, so the browser no longer responds.

you should quote the date value, and it's <=, not =<
dateNew <= '1997-01-01'

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 binime

binime
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 25 November 2005 - 07:37 PM

also, you could try a limit function to limit the amount the script deletes and just run it several times.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users