Hi, Vassilis,

On Jun 30, Vassilis Virvilis via discuss wrote:
> Hi,
> 
> The question: Is uncompressing a myisam table when adding an index the
> expected behavior?

Yes. MyISAM does not support adding indexes inplace, so ALTER creates
a new empty MyISAM table with indexes and copies the data over. The
resulting table is uncompressed.

>   * If yes: why? Expanding the table behind the user's back is surprising...

Technically MyISAM could be able to add indexes inplace, it's just a
feature that was never implemented.

You can try this (disclaimer: I didn't test it). Create an empty table
from your compressed one with CREATE TABLE LIKE. Add an index there.
Compress it. Then copy your big MYD file over the the small MYD file and
run myisamchk as you wanted. Better create a backup of your big table
first, of course, or practice this on something small.

Regards,
Sergei
Chief Architect, MariaDB Server
and [email protected]
_______________________________________________
discuss mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to