Search code examples
mysqlinnodb

In which case would MySQL's InnoDB's COMPACT row_format would be faster/better than REDUNDANT?


I saw many comparisons on Stackoverflow, DBA and Server Fault, but it's never actually clear when it comes to performance with specific situations, whether using COMPACT or REDUNDANT row format with InnoDB

Are there any cases in which some simple tables would have a definitive performance boost? For example in a simple relational table user_roles that would map a users table with a roles table, using two integers that will always make a row the same size on disk?

If that's not a good example, are there good examples that would make a clear difference?

Thanks!


Solution

  • COMPACT format is slightly better with storing field lengths. REDUNDANT stores length for every field even if it's a fixed size INT. COMPACT however stores only lengths of variable length fields.

    IMO that will contribute to performance difference so little that it doesn't make sense to bother with formats.

    REDUNDANT format COMPACT format