[TYPO3-dev] Typo3 Performance

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Thu Mar 1 10:56:52 CET 2007


Dmitry Dulepov schrieb:
> John Angel wrote:
> 
>>> Let's begin and remove those pointless indices suggested on the page. 
>>> With
>>> indices it's like RAM, they are not the solution for everything.
>>> Furthermore they must be crafted carefully to be used at all when
>>> required.
>>
>>
>> I agree, we've mentioned that already, let's see what should be 
>> optimized carefully.
>>
>> Some discussion was in bug:
>> http://bugs.typo3.org/view.php?id=4875
> 
> 
> Those indexes are not really correct. Look:
> ---------
> ALTER TABLE `be_groups` ADD INDEX ( `deleted` ( 1 ) ) ;
> ALTER TABLE `be_groups` ADD INDEX ( `hidden` ( 1 ) ) ;
> ---------
> 
> So mysql will use either deleted or hidden index, he will not use both! 
> Much better will be:
> 
> ALTER TABLE `be_groups` ADD INDEX (`deleted`, `hidden`)
> 
> and in the order of the query (mysql is clever sometimes to understand 
> that he can use index with another order but sometimes it still ignores 
> it). Same for others. Indexes, as they defined in the bug, will help but 
> they could be much better.

And the rule when adding indices is: Know your queries and data.

Adding indices just for the sake of it won't help. Have a look at the 
queries, measure how long they take, analyze the query plan, create an 
index, start again and see if things have improved.

And don't forget that the query plan WILL change depending on how much rows 
are in the tables involved!

Masi

PS: Best improvement of course is to reduce the total amount of queries 
used :-)




More information about the TYPO3-dev mailing list