Hi Sergei, On 7/1/24 9:06 PM, Sergei Golubchik wrote:
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.
Thanks for the confirmation. I think that this behavior should be documented though...
Technically MyISAM could be able to add indexes inplace, it's just a feature that was never implemented.
A very interesting fun project indeed :-)
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.
Sneaky!!!! It has the potential to shave 3.5-4h from my build time but it requires the double space. Hm.... can't decide right now if I want to try it. Thanks. Vassilis