DavidYahalom.com is an IT knowledgebase dedicated to the world of databses and RDBMS systems by David Yahalom. Here you'll find articles, views, news, tips and in-depth analysis about Oracle, DB2 LUW, Sql Server and MySql. I hope you'll enjoy your stay.
2nd
APR
MySQL InnoDB statistics gathering (analyze table)
Posted by David Yahalom under MySQL
I’ve seen many MySQL DBAs completely unaware of the fact that like most modern RDBMS systems, MySQL also relies on using statistics for keeping track of data distribution in tables and for optimizing join statements.
The syntax for analyzing a table for statistics is very simple:
ANALYZE [LOCAL | NO_WRITE_TO_BINLOG] TABLE <em class="replaceable"><code>tbl_name</code></em> [, <em class="replaceable"><code>tbl_name</code></em>] ...
- You must hold insert and select privileges on the table you want to analyze.
- On MyISM tables this will result in a READ LOCK on the table.
- On InnoDB tables this will result in a WRITE LOCK on the table.
Analyzing data distribution in tables is relevant to both MyISM and InnoDB tables.
The equivalent to the above command is using:
myisamchk --analyze
…on MyISM tables and
mysqlcheck -Aa -uroot -p
or
mysqlcheck --analyze --all-databases<strong>
..on InnoDB tables.
One more thing, keep in mind that unlike myisamchk, mysqlcheck can run online while the database is open.
Category Cloud
ASM DB2 LUW ETL General IT Grid Control Hardware ITIL Linux Monitoring MySQL Oracle RAC Security Solaris SQL Server Storage Uncategorized Unix Windows
Recent Posts
- What will happen to ASM when the disk path changes in Linux?
- The relation between an Oracle instance and memory in Windows
- Blog has been renamed!
- Cloud Oracle Storage: how to make ASM even better, the NAS way.
- ORA-600: Oracle process has no purpose in life!
Active polls
Categories
- ASM (2)
- DB2 LUW (11)
- ETL (2)
- General IT (7)
- Grid Control (1)
- Hardware (4)
- ITIL (1)
- Linux (3)
- Monitoring (1)
- MySQL (1)
- Oracle (32)
- RAC (5)
- Security (3)
- Solaris (3)
- SQL Server (1)
- Storage (1)
- Uncategorized (1)
- Unix (2)
- Windows (2)
Archives
- September 2009
- February 2009
- January 2009
- November 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- October 2007
- September 2007
- July 2007
- June 2007
- April 2007
- March 2007
- February 2007
- January 2007
- March 2006
Blogroll
DavidYahalom.com - Oracle, Databases, SQL, news, views, articles and in-depth analysis is powered by Wordpress. Designed by Free WordPress Themes.
