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
>> with
>> 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
>> and
>> 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
>> kill
>> 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) ?
>
> Bastien
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Hi,
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 /
research material
Let us know what your outcome is if you managed to fix it
http://www.Elemental.co.za http://www.Elemental.co.za
http://www.wapit.co.za http://www.wapit.co.za
--
View this message in context:
http://www.nabble.com/Why-doesn%27t-mySQL-stop-a-query-when-the-browser-tab-is-closedL-tp23843810p23857439.html
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