Re: Slow Performance / Index not used
Posted by:
Rick James
Date: August 28, 2008 11:12PM
In InnoDB (not MyISAM), the data is stored on disk in PRIMARY KEY order. There is no separate "index". So, in order to walk thru the PK, it has to do a table scan.
In InnoDB (not MyISAM), COUNT(*) requires transaction-safe [or something] use of the primary key. It seems in other cases that it would pick some secondary key to do the job. Secondary keys usually are much smaller than the data.
Suggest
* Avoid needing to do COUNT(*)
* Keep a count by other means
* Other kludge
Subject
Views
Written By
Posted
2802
August 28, 2008 08:46AM
Re: Slow Performance / Index not used
1759
August 28, 2008 11:12PM
1816
August 29, 2008 03:43AM
1722
August 29, 2008 05:00AM
1657
August 30, 2008 12:31AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.