[TYPO3-v4] List module improvements

Jigal van Hemert jigal at xs4all.nl
Mon Mar 7 16:25:07 CET 2011


Hi,

On 7-3-2011 15:35, Dmitry Dulepov wrote:
> Jigal van Hemert wrote:
>> The opposite is actually true: if there are not enough different pids
>> (low cardinality) it is faster to do a full table scan (chances are that
>> you need to retrieve a lot of records anyway) than to use an index.
>
> Why would you do a full table scan if the table has a proper index on a
> sorting column?

That's up to MySQL to decide. The query optimizer decides an execution 
path taking into account the various index statistics and field properties.
If there are two different values in a column it is very likely that 
MySQL needs to retrieve about half of the records. It is only fast to 
use an index if only a small part of the records needs to be retrieved.

The differences between InnoDB (primary index stored in the actual 
records, less files per database) and MyISAM (indexes stored in separate 
files) also need to be taken into account by the MySQL query optimizer.
A book like http://www.highperfmysql.com/ tells a lot about the inner 
working of MySQL and can help to get the most performance out of a database.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh


More information about the TYPO3-project-v4 mailing list