mysqlinnodbmariadbxtradb

Does XtraDB in MariaDB craate large files the way InnoDB does in MySQL?


I have been using MySQL but, as many people have painfully found out, the InnoDB engine is creating large and unshrinkable ibdata1 files. Activating innodb_file_per_table helps but does not solve the problem.

I was thinking of moving to MariaDB and using the XtraDB engine. I known that this is an improved version of InnoDB but I was wondering if it still carries this important flow. I have not seen it anywhere mentioned, so I am guessing this is not a problem with MariaDB but I want to be sure.

Does anyone have any definite information about that? Thanks in advance.


Solution

  • Of course, using innodb_file_per_table is the standard recommended configuration, and naturally, it can only provide maximum benefit if you have it enabled before you generate a massive system tablespace file, ibdata1.

    Assuming you did all of that correctly, if you still see it growing significantly, you're doing something to make it grow.

    See https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/

    The redo log (!), the data dictionary, and the kitchen sink are all still stored there so it isn't as if MySQL (InnoDB) is just allocating more and more disk space and then just forgetting about it, then asking for more. Your workload largely determines this growth.

    XtraDB is InnoDB from the perspective of the disk data structures. Take a MySQL Server, stop it, extract the MariaDB or Percona Server binaries, and start them up... and XtraDB uses your ibdata1 and log files and .ibd files like a boss, just as they are. Presumably it goes the other way, too, but nobody's ever tried it. (Joke. But seriously, in my network of dozens of MySQL-esque servers, I've never migrated a machine to MariaDB or Percona Server and later thought, "wow, I sure wish I could go back to Oracle's version of MySQL." The part about XtraDB using the existing ibdata1 and .ibd files is not a joke, that's all true. I've even taken the raw binary data files from MySQL on Solaris, and copied them to a Linux machine, and started up MariaDB with them -- no problem.)

    Present it with the same workload, and you should expect similar growth... though not necessarily identical growth. But XtraDB is not InnoDB in how it accomplishes the same things with the same files as InnoDB does. It's smarter and faster in many ways, and to a limited extent can be configured to constrain its growth, but it's not going to work extreme magic on your disk space constraints, because it's going to need the same space to do the same work. Fundamentally, in the sense of its in-disk presence, it's still InnoDB.