I have a query that takes a lot of time to get solved, here are the details:
# Time: 100119 11:00:42
# User@Host: xxxxxxx @ xxxxxxxxx
# Query_time: 1348 Lock_time: 0 Rows_sent: 16 Rows_examined: 9612188
select subwholesaler_id as id, sum(amount) as amount from subwholesaler_commission_movements where subwholesaler_id1 and operation_date >= "2009-12-01" and operation_date< "2010-01-01" group by subwholesaler_id;
I do use a TMyQuery to query it, but when the server gets the query solved I have no responce from the TMyQuery.
Trying to figure out what it's happening, I've started to kill the query at differents times, and I discovered that if I kill the query before the 300 seconds I get a exception "Lost connection to MySQL server during query", but if I do kill the query after 300 seconds, no exception is raised and the program keeps running.
Any idea in how to solve this?
I'm using MyDac 5.9 Trial with Delphi 2007.
pd: sorry by my english.
Long time query
Re: Long time query
Please give a more detailed description of the problem.zeeh2005 wrote:I do use a TMyQuery to query it, but when the server gets the query solved I have no responce from the TMyQuery.
To solve the problem try to set the TMyQuery.FetchAll property to False.
No change at all, the TMyQuery remain bloqued after the server solves the query and sends the result. Same behavior as before, if I do kill the query thread in server before 300 seconds, the exception is raised, but if I kill it after that I got no exception, and the program keeps running indefinitely.Ok, I give it a try.To solve the problem try to set the TMyQuery.FetchAll property to False.
That's gonna be a little hard, if you pay atention on my opening post, the resulting set is a 16 rows set but after examining 9612188 rows, maybe I can send you a dump for the table.Dimon wrote:I can not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill table.