Hi!

>>>>> "Sinisa" == Sinisa Milivojevic <[EMAIL PROTECTED]> writes:

Sinisa> Carsten H. Pedersen writes:
>> 
>> ...
>> 
>> > Having 27 indexes and using queries with LIKE "%...%" is a nice
>> > recepee for slowness.
>> 
>> Why should having 27 indexes slow down a SELECT?
>> 
>> / Carsten
>> --
>> Carsten H. Pedersen
>> keeper and maintainer of the bitbybit.dk MySQL FAQ
>> http://www.bitbybit.dk/mysqlfaq

Sinisa> It would slow down directly all commands that change tables.

Sinisa> Indirectly it will slow down SELECT's as key buffer would not be used
Sinisa> effectively. 

Sinisa> Also, as all 27 indices are in the same .MYI file, blocks from the
Sinisa> same index will definitely be very fragmented.

Of the data is mostly read-only, it's ok to have many indexes. You
should however try to ensure that you don't have indexes that can be
reduced.

For example if you have index on (date, user) and (date), then you can
remove the index on (date) as the first index can be used to resolve
queries on date.

You should also run OPTIMIZE TABLE once in a while, as this sorts the
index nicely on disk.

(If the mysqld server is down, you can also use myisamchk --sort-index
*.MYI to do this a little faster).

Regards,
Monty

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to