List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 27 1999 12:28pm
Subject:Re: Huge index file, why?
View as plain text  
>>>>> "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 Bean26 Aug
  • Huge index file, why?sinisa26 Aug
  • Re: Huge index file, why?Jules Bean26 Aug
    • Re: Huge index file, why?Benjamin Pflugmann26 Aug
      • Re: Huge index file, why?Michael Widenius27 Aug
    • Re: Huge index file, why?Michael Widenius27 Aug
  • Re: Huge index file, why?Jules Bean27 Aug
    • Re: Huge index file, why?Michael Widenius27 Aug
  • Re: Huge index file, why?Scott Hess27 Aug
    • Re: Huge index file, why?Benjamin Pflugmann27 Aug
      • Re: Huge index file, why?Michael Widenius27 Aug
        • Re: Huge index file, why?Benjamin Pflugmann28 Aug
  • Re: Huge index file, why?Jules Bean27 Aug
  • Re: Huge index file, why?Scott Hess27 Aug
    • Re: Huge index file, why?Michael Widenius29 Aug
Re: Huge index file, why?V Yau30 Aug
  • Re: Huge index file, why?Michael Widenius30 Aug