I am using MyDAC v. 3.30.0.12, Borland Builder 5 and mySQL v. 4.0.17:
I am using TMyTable component to access an InnoDB database with FetchAll = false
If I have a huge MySQL table then my application dies when setting
MyTable->Active = true;
If I run "SHOW PROCCESSLIST;" in a mySQL promt the following is shown:
SELECT COUNT(*) FROM mytable
Does anybody know what the problem is ?
Has the problem been fixed in later versions of MyDAC ?
Problem with huge InnoDB table
-
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51
Re: Problem with huge InnoDB table
A query SELECT COUNT(*) mustn't take a lot of time and cause hanging the application. How much time does it take to execute SELECT COUNT(*) for this table, if to execute it through a separate component?
-
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51
I have seen "SELECT COUNT(*) from " take 1 hour and 30 minutes for a table of 9,064,394 elements if run in a MySQL prompt.
But the problem only appears for InnoDB databases. For small InnoDB tables or MyISAM tables there is no problem.
I can see in the MySQL manual that one of the restrictions on InnoDB tables is that they don't keep an internal count of rows in tables so "SELECT COUNT(*)" will take some time.
I think that the MyDAC package is working properly - but it is the InnoDB tables that are not usefull if you want to know the number of elements in huge tables.
Regards Hanne
But the problem only appears for InnoDB databases. For small InnoDB tables or MyISAM tables there is no problem.
I can see in the MySQL manual that one of the restrictions on InnoDB tables is that they don't keep an internal count of rows in tables so "SELECT COUNT(*)" will take some time.
I think that the MyDAC package is working properly - but it is the InnoDB tables that are not usefull if you want to know the number of elements in huge tables.
Regards Hanne