Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What ROW_FORMAT is my table?

Tags:

mysql

I've discovered that MySQL has multiple row formats, and it's possible to specify this or change it. Also, the default ROW_FORMAT has apparently changed over time with MySQL versions, which is understandable.

However, I can't find anywhere that says how to find out what the ROW_FORMAT of an existing table is! My database has been around for years, from older versions of MySQL, and I want to make sure I'm not using a poorly performing ancient disk format.

How do I find out the ROW_FORMAT of a table in MySQL?

like image 736
Ken Avatar asked Apr 11 '11 23:04

Ken


1 Answers

Information schema offers a wealth of information.

SELECT row_format FROM information_schema.tables
    WHERE table_schema="YOUR DB" AND table_name="YOUR TABLE" LIMIT 1;

2014.06.19 - Mild Update

The following query will give you the row format of all tables in the current database:

SELECT `table_name`, `row_format`
FROM `information_schema`.`tables`
WHERE `table_schema`=DATABASE();
like image 117
Khez Avatar answered Sep 29 '22 18:09

Khez