views:

31

answers:

1

In MySQL, I sometimes type "show innodb status" to see that a long-running query is doing something. The bottom has, under "ROW OPERATIONS", a line:

2000.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 2000.00 reads/s

What are the units for these? Records? InnoDB pages? OS disk pages? (Are they the same thing?)

A: 

This is logical row reads* averaged over whatever the top of SHOW INNODB STATUS says it's running the report for.

So it's not the same as the pages section (which contains physical page operations).

It's a good performance metric to model, since it can show the general demands on your database from your application. If the demands don't increase, but your performance gets worse, look at if your data set has increased, etc. Maybe this is causing more physical IO?

[*] A logical row read may have to still read many pages, for example if it has to find an older version (MVCC) from undo.

Morgan Tocker
Thanks! I guess one thing I'm interested in is knowing if I can use this to determine how long something is going to run. Suppose I know my program is going to insert 2,000,000 new records, and `show innodb status` says `2000.00 inserts/s` (on average) -- does this suggest that it'll take about 2,000,000/2000 = 1000 seconds (17 minutes) total? If it's "logical row reads", that suggests it is, which is nice.
Ken
I guess you could use this to model progress. Because building unique indexes can not use the insert buffer note that there may be some skew from which index pages need to do physical IO. Tables also get slower to insert into the larger they become - so just because something is 50% complete, doesn't mean it will take as long as it has so far to complete.
Morgan Tocker