Bastien Koert-3 wrote:
> On Jun 2, 2009, at 21:13, "Daevid Vincent" <dae...@daevid.com> wrote:
>> I just noticed a horrible thing.
>> I have a query (report) that can take 15 minutes or more to generate
>> mySQL. We have > 500 Million rows. This used to be done in real time
>> when we
>> had less rows, but recently we got a big dump of data that shot it up.
>> So, noticing via myTop the query taking so long, I closed my web
>> page tab.
>> The query did NOT go away! WTF? So mysqld continued to peg the CPU
>> at 75% to
>> 135% (yes, top shows that if you have quad cpus. *sigh*)
>> Is there some way to force this to work sanely? Some php.ini or
>> my.cnf file
>> that has a setting to abort queries when the web page has gone away?
>> Not sure which mailing list this belongs on so I'll post to both PHP
>> mySQL. Although it feels this is a PHP problem as it should know
>> that the
>> Apache thread went away and therefore close the mySQL connection and
>> the query. Conversely, mysql should know that it's connection (via
>> PHP) went
>> away and should equally abort. So you're both wrong! :)
> Once the query is started, the only way to kill it is to kill the
> process id in the mysql server.
> But I have a question about the db and current size:
> 1. Do you need all that data currently? If you could archive a portion
> away, there may be performance gains
> 2. Can you partition the tables to work with smaller datasets ( could
> be a performance gain here) ?
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
have you tried to optimize the database to ensure that it runs faster?
Also make sure you use best practices when quering the database, only search
for relevant columns and not select * from ....
Hope this helps probably best to search on the mysql website for help /
Let us know what your outcome is if you managed to fix it
View this message in context:
Sent from the PHP - General mailing list archive at Nabble.com.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php