0.8 secs to return 5,000 records - 8.0 seconds to return 10,000

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

0.8 secs to return 5,000 records - 8.0 seconds to return 10,000

Post by NoComprende » Tue 09 Jan 2007 14:08

I've got a horse racing database programme written in C++ Builder 6 using MySQL 5.0 and I'm currently trialling MyDac 4.40.0.20. In part of the programme you can view all of a jockey's lifetime rides. The query for this extracts those records from the 'Runner' table (these are usually scattered through the table fairly evenly- there is also a secondary index on JockeyID to assist the query) and returns them along with some information from 7 or 8 lookup tables. If I run a "Warm up" procedure at the start of my application to "heat" up the system cache (consists of running "select * from x" for each table x in the database) then TMyQuery returns these records lightning fast most of the time but, it seems to me that if the number of records exceeds a certain amount the wait for the result set becomes disproportionally long (as described in the thread title).

I've no idea if this is a MyDAC problem, a MySQL problem or is associated with my system memory. If I run similar queries within the MySQL Query Browser the queries are all slower but I don't see the same disproportianality so, I'm hoping there's maybe some setting in MyDAC you could point me to that will speed things up.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 09 Jan 2007 15:22

Probably this problem depends on size of some buffer(s) in MySQL Server. Try to check this executing similar queries by other components (ADO, BDE, etc.) or from other tools (e.g. our MySQL Developer Studio that shows time of query execution). Also check the hard drive activity on the server while executing both kinds of queries (fast and slow).

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Tue 09 Jan 2007 16:15

OK Antaeus. Thanks.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Wed 10 Jan 2007 09:42

I managed to resolve this by changing the order of the joins in the query. 10,000 recs now being returned in approx 1.6 secs.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 10 Jan 2007 10:09

It is good to see that this problem has been solved.

Post Reply