Page 1 of 1

Long time query

Posted: Tue 19 Jan 2010 19:57
by zeeh2005
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.

Re: Long time query

Posted: Wed 20 Jan 2010 08:26
by Dimon
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.
Please give a more detailed description of the problem.
To solve the problem try to set the TMyQuery.FetchAll property to False.

Posted: Wed 20 Jan 2010 13:23
by zeeh2005
Please give a more detailed description of the problem.
Sorry, what other detail do you need?
To solve the problem try to set the TMyQuery.FetchAll property to False.
Ok, I give it a try.

Posted: Wed 20 Jan 2010 13:45
by zeeh2005
To solve the problem try to set the TMyQuery.FetchAll property to False.
Ok, I give it a try.
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.

Posted: Thu 21 Jan 2010 08:07
by Dimon
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.

Posted: Thu 21 Jan 2010 13:00
by zeeh2005
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.
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.

Posted: Thu 21 Jan 2010 13:50
by Dimon
Yes, you can send us this dump.