InnoDB : MySQL's ACID-compliant Storage Engine

learn more… | top users | synonyms

8
votes
3answers
8k views

Is innodb_file_per_table advisable?

We have an application where just one of the table will be growing into million of lines but the rest will just below a million. So what is the advice should we go with innodb_file_per_table or leave ...
9
votes
4answers
9k views

Mysql int vs varchar as primary key (InnoDB Storage Engine?

I am build a web application (project management system) and I have been wondering about this when it come to performance. I have an Issues table an inside it there are 12 foreign keys linking to ...
4
votes
2answers
11k views

InnoDB row locking - how to implement

I've been looking around now, reading the mysql site and I still can't see exactly how it works. I want to select and row lock the result for writing, write the change and release the lock. ...
1
vote
1answer
515 views

InnoDB - How to get top locked tables and rows which are locked

I was searching for a tool OR query which can give me top locked tables and which particular row is locked, Is it possible to get ?
4
votes
1answer
865 views

Does the order of columns has a significant effect on INSERT?

Do we experience a noticeable difference in performance for these two queries? INSERT INTO table (col1, col2, col3, col4, col5) ... and INSERT INTO table (col5, col3, col1, col2, col4) ... Do we ...
3
votes
1answer
3k views

When are InnoDB table index statistics updated?

In a vanilla build of MySQL 5.5.20, when are InnoDB table index statistics updated? What events trigger such updates? I've seen comments suggesting that the following might trigger it: table is ...
8
votes
2answers
5k views

Percona vs MySQL

What is Percona? How does it differ from MySQL? When should we consider switching (or upgrading) from stock MySQL to Percona? To add some specifics in our situation we almost exclusively use ...
1
vote
1answer
4k views

How to use ON DUPLICATE KEY for UPDATE

Consider a table of CREATE TABLE test ( id int(11) unsigned NOT NULL AUTO_INCREMENT, external_id int(11), number smallint(5), value varchar(255), UNIQUE INDEX (external_id, number), PRIMARY KEY(id) ...
3
votes
1answer
199 views

Is UNIQUE(), INDEX() different from UNIQUE INDEX()?

Is there any different how mysql treats UNIQUE (column1, column2), INDEX (column1) and UNIQUE INDEX (column1, column2) and UNIQUE (column1, column2) In the latter, I think mysql will ...
22
votes
3answers
29k views

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 ...
6
votes
2answers
1k views

Why does MySQL choose this execution plan?

I have two queries, select some_other_column from `table` order by primary_index_column asc limit 4000000, 10; and select some_other_column from `table` order by secondary_index_column asc ...
6
votes
2answers
2k views

Is one-to-one relationship normalized?

Consider we have a large set of statistical data for a record; e.g. 20-30 INT columns. Is it better to keep the entire set in one table as they all belong to a record OR creating a another table ...
2
votes
1answer
2k views

Sort buffers and tables on disk, MySQL/InnoDB

I have the following type of query frequently running: # Time: 120322 13:03:29 # User@Host: root[root] @ localhost [127.0.0.1] # Query_time: 17.039286 Lock_time: 0.000141 Rows_sent: 24 ...
2
votes
1answer
1k views

Are many NULL columns harmful in mysql InnoDB?

As I explored the clustered B-tree index system of InnoDB, I think that the presence of many NULL (or small) columns has no significant effect on InnoDB performance. Does the presence of excess ...
1
vote
1answer
2k views

How to recover the innodb when mysql data dir moved from one system to another system?

I have transfer the mysql data dir from one linux box to another box. When i start the mysql server. I can find that the innodb based DB are corrupted. So, may i know how to recover the corrupted ...
3
votes
2answers
2k views

“freeing items” taking forever on inserts, updates and deletes

Recently I migrated all my MySQL database tables from MyISAM engine to InnoDB. I'm using the DotCloud MySQL service as my server (http://docs.dotcloud.com/services/mysql/). After the migration, ...
4
votes
2answers
8k views

Using multiple cores for single MySQL queries on Debian

I am running a MySQL server for tests on a VM (VMWare) with Debian as guest OS. The guest has four emulated CPU cores, so I set thread_concurrency to four. I am doing expensive joins on large tables, ...
0
votes
1answer
876 views

Problem with Error: InnoDB: page … log sequence … number is in the future!

i know this question was asked before, but i am at a point where i am really stuck and do not know how to continue with this problem and i would really like to know, what causes this error to come up. ...
1
vote
1answer
4k views

How to set a specific directory location for individual MySQL database?

Is it possible to set each database in MySQL to use a separate datadir? I'm running a userdir development (sandbox) server and would like to put the MySQL data files for the database(s) for that user ...
3
votes
1answer
131 views

What are some key configuration settings for using an InnoDb table for session storage?

I want to start clustering my PHP app servers but don't want to go for a sticky-sessions load balancing setup at this point. However, I want sessions that are persisted to disk and implement proper ...
5
votes
4answers
2k views

MySQL subquery slows down drastically, but they work fine independently

Query 1: select distinct email from mybigtable where account_id=345 takes 0.1s Query 2: Select count(*) as total from mybigtable where account_id=123 and email IN (<include all from above ...
2
votes
1answer
857 views

ACID-compliance of MySQL master-master replication?

I've created two MySQL 5.1 servers, replicating off each other (log-bin) in a low latency environment (different AZs within an EC2 region). All tables that are being replicated are using the InnoDB ...
7
votes
3answers
6k views

InnoDB table SELECT returns ERROR 2006 (HY000): MySQL server has gone away (after power outage)

This server is a virtual machine running CentOS 6.0, MySQL 5.5.21 There is a database named devSystem. There are InnoDB tables within. Running the following commands causes error ERROR 2006 ...
3
votes
1answer
3k views

How can I find who holds the lock based on the hex-dumped?

I've been reading the Diagnosing MySQL InnoDB Locks article. Karl E. Jørgensen writes on 2008 so I'm consfusing it is in effect. I would like to supply a snippet of the SHOW ENGINE INNODB STATUS: ...
2
votes
1answer
2k views

Why can't I get a lock on an InnoDB table?

I have problem with lock table command: LOCK TABLE v3_cam_date WRITE; the command always running with state: "Waiting for table metadata lock". Try to find out which thread was hold the lock on ...
9
votes
2answers
6k views

innodb_file_format Barracuda

I have a couple questions for those more familiar. Most of my instances have been running Antelope despite having support for Barracuda. I was looking to play around with some compresses innodb ...
3
votes
1answer
1k views

Getting duplicate primary key for auto increment coloumn

I have a MySQL Innodb table with 'id' as auto increment primary key coloumn. My Scripts are doing following operations: insert ignore into tablename set x='a', y='b' update ignore tablename set ...
1
vote
2answers
6k views

How to use RESTRICT for Foreign Key in mysql?

In the database structure of CREATE TABLE Country ( name varchar(40) NOT NULL, PRIMARY KEY (name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE City ( name varchar(40) NOT NULL, ...
2
votes
1answer
634 views

Number of locks exceeded when adding foreign key constraint

I'm adding a foreign key constraint to table a (17mil rows) that references table b (15mil rows): >ALTER TABLE a ADD FOREIGN KEY (b_id) REFERENCES b (id); ERROR 1206: The total number of locks ...
1
vote
2answers
4k views

Innodb UPDATE performance

We recently switched one of our tables to innodb and now we are experiencing very slow UPDATE execution times. An update which used to take 0.010-0.030 seconds can now take over 70 seconds. Some ...
4
votes
1answer
1k views

Can SHOW TABLE STATUS query performance on MySQL be improved - Amazon RDS

I have a fairly large database on the Amazon Relational Database Service (RDS) running on MySQL 5.1.57. There are 900+ tables, so that running the "SHOW TABLE STATUS" query can take up to 30 seconds. ...
6
votes
1answer
1k views

Tuning dedicated Percona Server with XtraDB for OLTP

Hardware specs for an OLTP DB dual quad core xeon with hyperthreading 24GB ram Hardware RAID10 BBU Software specs Standard install of Ubuntu 10.04LTS with default LVM partitioning Installed ...
2
votes
1answer
3k views

MariaDB XtraDB Performance Tuning

I believe that innodb has a single read thread. However, with MariaDB you can set multiple read threads. I'm unsure what the recommended value would be. Questions Does anyone have any experience ...
6
votes
2answers
4k views

Ibdata usage and Recommendations?

I have a Production server On November 5,2011 the ibdata size was 100G. In Approximate 3 months it is increased to 200G.So it has just doubled its size.So it is a Huge Data.Currently lvm is 251G. I ...
1
vote
2answers
2k views

Usage of RESTRICT or No ACTION in FOREIGN KEY Constraints

Sorry if this question is naive, but I was unable to understand possible usage of RESTRICT or No ACTION. Consider a simple database of CREATE TABLE column1 ( first_id int(11) NOT NULL AUTO_INCREMENT, ...
1
vote
2answers
253 views

How to recover previous values in Mysql Table?

I have MySQL Innodb table of 14M rows. There was a coloumn called is_disabled which had different values. By mistake I ran the query without the where clause: update url_queue set is_disabled=1 ...
1
vote
1answer
2k views

How to update mysql my.cnf without getting error?

I updated the MySQL my.conf file and and restarted my server without a problem. As soon as I tried to access a table I received the error mysql #1033 - Incorrect information in file: I reverted ...
1
vote
2answers
5k views

What would be the fastest approach to bulk update this mysql table (Innodb)?

I have a table with 100M rows. I am able update my table like 850 updates / minute. How to speed this up? I am using following approach: mysql -uroot < query_file where query_file contains 1M ...
15
votes
3answers
17k views

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?
1
vote
0answers
802 views

Why can I not start mysql server on ubuntu after change the innodb_flush_log_at_trx_commit value to be 2?

Why can I not start mysql server on ubuntu after change the innodb_flush_log_at_trx_commit value to be 2 ? updated to answer the 3 questions: mysql> show variables like 'version%'; ...
5
votes
2answers
263 views

Recommended structure? %70 write %30 read. 10M row. 200 query/sec. Select, update, insert, search

Followings are what I need to do on my project: 1- If a search term is new and unique, then add the search term 2- Show lastest searched 1000 search terms (I don't need to store dates of all search ...
2
votes
1answer
3k views

How to recover a crashed innodb table…?

I Have a Innodb table i got the error as mysql> check table City; +-------------------+-------+----------+----------------------------------------------------------+ | Table | Op | ...
5
votes
1answer
2k views

Find out MySQL index size for a concrete index

In MySQL, for InnoDB engine, how do I find out the size of one of the indexes I have in the same table ? I know I can select the index_length from information_schema.tables, but this gives the total ...
3
votes
2answers
3k views

LOAD DATA (400k rows) INFILE takes about 7 minutes, cannot kill the “logging slow query” process?

MySQL version: 5.5.13 The query that I'm using: SET AUTOCOMMIT=0; LOAD DATA INFILE '/data10/select_into.outfile/v3_zone_date.out' INTO TABLE v3_zone_date FIELDS TERMINATED BY ','; COMMIT; ...
3
votes
1answer
275 views

Xen snapshots and live Innodb tables?

I am wondering if I can trust my host doing it's nightly snapshots with live Innodb tables. From what I have read: "Innodb is ACID-compliant, so you can "safely" use fs snapshot with Innodb tables." ...
2
votes
1answer
87 views

Moving the binary location of MySQL for replication

Is it possible to move the contents of /var/lib/mysql when setting up replication instead of doing mysqldump > for export and mysql < for insert on the slave, because in our current setup it takes ...
1
vote
1answer
392 views

Why is Mysqlcheck on 5.1.41 still showing as Innodb table corrupted after a table dump and restore?

I had a very large corrupt innodb table. mysqld would crash whenever I did a check table on it. I did a innodb-force-recovery=1 and did a dump of the table. No errors showed up. I dropped the table ...
4
votes
3answers
1k views

MySQL tables/databases into different disks

I am aware that there is a possibility to have a single database server with many tables/databases, and you can separate some of those tables/databases into separate disks. Lets say you have 5 ...
2
votes
1answer
690 views

How do you verify that all InnoDB tables are in good shape?

Without using a script, Is there a way to get mysql to check all the tables at once to make sure they're not corrupted?
3
votes
2answers
4k views

Scheduled optimization of tables in MySQL InnoDB

What is the best way to schedule automatic optimization of tables in a MySQL InnoDB database? Can I use events for example? I have recently had a big performance issue (when querying) with one of the ...