[TYPO3-dev] list module hangs at 1 million records

Franz Holzinger franz at fholzinger.com
Wed Jul 23 12:46:11 CEST 2008


Hello,

Dmitry Dulepov [typo3] a écrit :
> Franz Holzinger wrote:
>> Votre requête SQL a été exécutée avec succès (traitement: 149.1525 sec.)
>> requête SQL:
>> ALTER TABLE `tx_myext_table` ADD KEY comp1( pid, deleted( 1 ) , sorting )
>>
>> What is the '(1)' after 'deleted' for? Does this have an advantage?
> 
> Yes. It makes index smaller. deleted field is only 0 or 1 but it can be
> as long as 11 bits in the dastabase. Setting (1) uses only 1 significant
> bit in the index. This is important if table is long: the smaller the
> index, the more chanmces that MySQL will use it instead of doing full
> table scan.

Unfortunately this does not work on my local machine:

 ALTER TABLE `tx_myext_table` ADD KEY comp2( pid, deleted( 1 ) , crdate)

MySQL a répondu:Documentation
#1089 - Incorrect sub part key; the used key part isn't a string, the
used length is longer than the key part, or the storage engine doesn't
support unique sub keys

The local machine has MYSQL version 5.0.51a
php-mysql-5.2.5.

see:
http://bugs.mysql.com/bug.php?id=36080

So would it be better to remove the '(1)' again from the field 'deleted'
inside of this key?


 ALTER TABLE `tx_onix_products` ADD KEY comp2( pid, deleted, crdate )

This works also in MYSQL 5.0.

Franz




More information about the TYPO3-dev mailing list