After changing engine from myisam to innodb tables are larger in size, is this an expected behaviour? I updated a WordPress database from myisam to innodb on a server using apache and mysql, and I noticed that some tables, such as wp-posts grew in size after running the ALTER TABLE wp_posts ENGINE=InnoDB; command, about 20MB. So, this is the first time I've done this, and I'm wondering if this is an expected behaviour?
Thanks,
This is a known issue (not a bug) all the days of Storage Engine technology
Someone asked a similar question in a Percona Forum in November 2014: The table size between InnoDB and MyISAM engines differs in 7 times.
This may have something to do with the granularity of storage between MyISAM and InnoDB.
MyISAM
According to MyISAM Dynamic Data File Layout

Variable length records are contained in &quot;frames&quot;. A record can be put in one or more frames, also called the record &quot;parts&quot; or &quot;blocks&quot;. The sense of the frames is to allow reusage of the space of deleted records. Starting with an empty data file, records are put in a single frame each, unless a record is bigger than the maximum frame size (16MB - 4). When a record is deleted, its frame is marked deleted. When a record is inserted after this, it reuses the old frame. If the new record is smaller, the frame is split. The unused part is marked deleted. If a new record is bigger than the old frame, the frame is filled with the record as much as fits. The rest is inserted in other old frames, or, if non is available, in a new frame at end of file.

InnoDB
The size of an InnoDB Page is 16K by default : See innodb_page_size
COMPARISON
Since InnoDB stores in a fixed 16K &quot;frame&quot; whereas MyISAM stores in frames that can vary in size up 16777212 (16M - 4), one should always expect InnoDB tables to be larger due to page splits that are required to fit data into fixed 16K &quot;frames&quot;.