Long time query
Posted: Tue 19 Jan 2010 19:57
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.
# 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.