Questions tagged [innodb]

InnoDB : MySQL's ACID-compliant Storage Engine

InnoDB is the ACID-compliant Storage Engine used in MySQL. InnoDB also features the use for MVCC (Multiversion Concurrency Control) to support Transaction Isolation Levels for InnoDB. InnoDB is not a standalone database product. It has been distributed as a part of the MySQL database during its early years of InnoBase Oy as a partner with MySQL AB.

In the early days of MySQL, InnoDB was made available to MySQL as an additional transactional storage along with BDB. The company that developed InnoDB, InnoBase Oy, was purchased by Oracle in October 2005. Percona has contributed great improvements to its own Open Source version of InnoDB (XtraDB). Oracle, who eventually became the owner of MySQL via purchasing Sun, has incorporated most of those changes into InnoDB, as well adding improvements of their own. As a result, InnoDB has transformed into a more mature storage engine that handles mulitprocessing and multithreading more robustly. As of December 2010, InnoDB has become the default storage engine for MySQL 5.5.

MySQL 5.5 also has enhancements to facilitate InnoDB in engaging multiple CPUs. Those enhancements were introduced in MySQL 5.1.38 in the InnoDB Plugin only. Those enhancements have now been included with MySQL 5.5.

MySQL 5.5 also comes with new features such as Semisynchronous Replication, Multiple InnoDB Buffers Pools, plugins for user-defined authentication, performance metrics instrumentation, and more !!!

In a recent Oracle press release, one of the new features for MySQL 5.6 is to have InnoDB with FULLTEXT searching. This will be a major step forward for this storage engine as this was one of the most requested and sought after features.

The basic infrastructure of InnoDB centers around three major files

  • ibdata1, or System Tablespace (See InnoDB Architecture)
  • ib_logfile0 (See InnoDB Architecture)
  • ib_logfile1 (See InnoDB Architecture)

In conjunction with memory structures, ibdata1 processes info for 6 basic data structures

  • Table Data Pages
  • Table Index Pages
  • Table MetaData (List of Tablespace IDs + Misc Info)
  • MVCC Records
    • Rollback Segments
    • Undo Space
  • Double Write Buffer (Allows Background Page Writes)
  • Insert Buffer (For Collecting/Processing Changes to Secondary Indexes)

InnoDB Architecture

InnoDB Architecture

InnoDB Configurations can accommodate the following

  • Separating Table Data and Index Pages from the System Tablespace
  • Storing the System Tablespace in a Raw Disk Partition
  • Creating Multiple System Tablespace Files
  • Creating Multiple Log Files
  • and more...

There is important cache known as the InnoDB Buffer Pool. As of MySQL 5.5, you can configure multiple buffer pool instances. Prior to MySQL 5.5, there is only one buffer pool instance.

2208 questions
278
votes
10 answers

What are the main differences between InnoDB and MyISAM?

What are the main differences between InnoDB and MyISAM?
ilhan
  • 3,009
  • 5
  • 19
  • 13
245
votes
5 answers

How large should be mysql innodb_buffer_pool_size?

I have a busy database with solely InnoDB tables which is about 5GB in size. The database runs on a Debian server using SSD disks and I've set max connections = 800 which sometimes saturate and grind the server to halt. The average query per second…
alfish
  • 2,844
  • 6
  • 19
  • 18
203
votes
7 answers

How can I optimize a mysqldump of a large database?

I have a symfony application with an InnoDB database that is ~2GB with 57 tables. The majority of the size of the database resides in a single table (~1.2GB). I am currently using mysqldump to backup the database nightly. Due to my comcast…
Patrick
  • 4,179
  • 7
  • 27
  • 27
142
votes
5 answers

Possible to make MySQL use more than one core?

I've been presented with some dedicated MySQL servers that never use more than a single core. I'm more developer than DBA for MySQL so need some help Setup The servers are quite hefty with an OLAP/DataWarehouse (DW) type load: Primary: 96GB RAM, 8…
gbn
  • 69,343
  • 8
  • 160
  • 240
119
votes
5 answers

MySQL any way to import a huge (32 GB) sql dump faster?

I have this huge 32 GB SQL dump that I need to import into MySQL. I haven't had to import such a huge SQL dump before. I did the usual: mysql -uroot dbname < dbname.sql It is taking too long. There is a table with around 300 million rows, it's…
SBhojani
  • 1,293
  • 2
  • 9
  • 4
117
votes
5 answers

How to safely change MySQL innodb variable 'innodb_log_file_size'?

So I'm fairly new to tuning InnoDB. I'm slowly changing tables (where necessary) from MyIsam to InnoDB. I've got about 100MB in innodb, so I increased the innodb_buffer_pool_size variable to 128MB: mysql> show variables like…
Derek Downey
  • 23,190
  • 11
  • 77
  • 104
94
votes
3 answers

Difference between On Delete Cascade & On Update Cascade in mysql

I have two tables in MySQL database- parent, child. I'm trying to add foreign key references to my child table based on the parent table. Is there any significant difference between ON UPDATE CASCADE and ON DELETE CASCADE My Parent Table CREATE…
Smokey
  • 1,051
  • 1
  • 8
  • 8
69
votes
1 answer

What is the best way to reduce the size of ibdata in mysql?

I have some Production servers whose ibdata files increase in size day by day. It has already consumed 290GB of space. The tables in the servers are mostly InnoDB and there are high read and write requests. The log file size also increasing. There…
Abdul Manaf
  • 9,419
  • 16
  • 69
  • 83
67
votes
5 answers

Is it safe to use innodb_flush_log_at_trx_commit = 2

I turned innodb_flush_log_at_trx_commit = 2 and get a very fast write speed. But is it safe be used in production web site?
Bruce Dou
  • 815
  • 1
  • 9
  • 8
66
votes
3 answers

What is the performance impact of using CHAR vs VARCHAR on a fixed-size field?

I have an indexed column that stores an MD5 hash. Thus, the column will always store a 32-character value. For whatever reason, this was created as a varchar rather than a char. Is it worth the trouble of migrating the database to convert it to a…
Jason Baker
  • 761
  • 1
  • 5
  • 6
62
votes
4 answers

Which is faster, InnoDB or MyISAM?

How can MyISAM be "faster" than InnoDB if MyISAM needs to do disk reads for the data? InnoDB uses the buffer pool for indexes and data, and MyISAM just for the index?
jcho360
  • 1,979
  • 7
  • 23
  • 31
55
votes
3 answers

Why does InnoDB store all databases in one file?

It was convenient that MyISAM used to store each table in a corresponding file. InnoDB has made advancements in many aspects, but I wonder why InnoDB stores all databases in one file (ibdata1 by default). I understand that InnoDB will map the…
Googlebot
  • 4,377
  • 22
  • 64
  • 87
51
votes
1 answer

What is the meaning of filtered in MySQL explain?

As described here in the MySQL docs: The filtered column indicates an estimated percentage of table rows that will be filtered by the table condition. That is, rows shows the estimated number of rows examined and rows × filtered / 100 shows the…
Iman Tumorang
  • 555
  • 1
  • 5
  • 12
48
votes
10 answers

restore table from .frm and .ibd file?

I have previously saved a copy of /var/lib/mysql/ddms directory ("ddms" is the schema name). Now I installed a new MySQL on a freshly installed Ubuntu 10.04.3 LTS by running apt-get install mysql-server, I believe version 5.1 was installed. After I…
Tong Wang
  • 583
  • 1
  • 5
  • 5
46
votes
5 answers

How to estimate/predict data size and index size of a table in MySQL

I am finding what is the best way to estimate size of a table for that I have studied lot of blogs and forums but unable to find any accurate answer For example, we have a table City with InnoDB engine,lets say in future (in next 1 year) it will…
Abdul Manaf
  • 9,419
  • 16
  • 69
  • 83
1
2 3
99 100