>>>>> "Benjamin" == Benjamin Pflugmann <philemon@stripped> writes:
Benjamin> Hi.
Benjamin> IMHO, it has nothing to do with the index being a binary tree, but
Benjamin> that MySQL saves any string (VARCHAR as CHAR) in an index with its
Benjamin> whole width. Just think of it as if indexes only know about CHAR.
Benjamin> This means, although you can get your table smaller by changing CHAR
Benjamin> to VARCHAR, you cannot get your indexes smaller.
Benjamin> You might want to use something like
Benjamin> KEY( field1(20) )
Benjamin> which will only use 20 bytes for the field index (and is quite fast,
Benjamin> too, as long as the values of field1 are different enough in the
Benjamin> leftmost 20 bytes), but this will obviously not work for UNIQUE.
Benjamin> Bye,
Benjamin> Benjamin.
Hi!
The above is not strictly true; When using keys on strings, MySQL
will strip the string of all end space.
Jules, could you please mail me the output of the following commands:
isamchk -dvv table_name
isamchk -evi table_name
(The last one is not that important (as it may take a long time...))
Regards,
Monty
| Thread |
|---|
| • Huge index file, why? | Jules Bean | 26 Aug |
| • Huge index file, why? | sinisa | 26 Aug |
| • Re: Huge index file, why? | Jules Bean | 26 Aug |
| • Re: Huge index file, why? | Benjamin Pflugmann | 26 Aug |
| • Re: Huge index file, why? | Michael Widenius | 27 Aug |
| • Re: Huge index file, why? | Michael Widenius | 27 Aug |
| • Re: Huge index file, why? | Jules Bean | 27 Aug |
| • Re: Huge index file, why? | Michael Widenius | 27 Aug |
| • Re: Huge index file, why? | Scott Hess | 27 Aug |
| • Re: Huge index file, why? | Benjamin Pflugmann | 27 Aug |
| • Re: Huge index file, why? | Michael Widenius | 27 Aug |
| • Re: Huge index file, why? | Benjamin Pflugmann | 28 Aug |
| • Re: Huge index file, why? | Jules Bean | 27 Aug |
| • Re: Huge index file, why? | Scott Hess | 27 Aug |
| • Re: Huge index file, why? | Michael Widenius | 29 Aug |
| • Re: Huge index file, why? | V Yau | 30 Aug |
| • Re: Huge index file, why? | Michael Widenius | 30 Aug |