- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How ANALYZE TABLE statement helps in maintaining the MySQL tables?
MySQL query optimizer is an important element of the MySQL server that makes an best question execution set up for a query. For a particular query, the query optimizer uses the stored key distribution and other factors to decide the order in which tables should be joined when you performing the join, and which index should be used for a specific table.
However, the key distributions can be sometimes inaccurate e.g., after you have done a lot of data changes in the table including insert, delete, or update. IIf the key distribution isn't correct, the question optimizer could pick a nasty query execution arrange that will cause a severe performance issue.
ANALYZE TABLE statement can solve the above problem. We need to run the ANALYZE TABLE statement as follows −
ANALYZE TABLE table_name
Here, table_name is the name of the table.
Example
We are running this statement for the table Student_info as follows −
mysql> Analyze table student_info\G; *************************** 1. row *************************** Table: query.student_info Op: analyze Msg_type: status Msg_text: OK 1 row in set (0.22 sec)
- Related Articles
- What is the use of OPTIMIZE TABLE statement in maintaining the MySQL tables?
- What is the use of CHECK TABLE statement in maintaining the MySQL tables?
- How to Analyze Comparative Financial Statement?
- Using CREATE TABLE AS statement with UNION of two tables in MySQL
- How can we analyze the tables of a particular database from MySQL Server command line?
- IC role to create physical tables, analyze data in SAP HANA
- How can I describe all tables in the database through a single statement in MySQL?
- How to check table status of the tables in a particular MySQL database?
- MySQL show tables sort by table name?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- ‘Grouping of objects helps the shopkeeper.’ Justify the statement.
- Maintaining order in MySQL “IN” query?
- How we have multiple stored GENERATED COLUMNS in MySQL table with CREATE TABLE statement?
- Grouping of books helps a librarian. Justify the statement
- Get table names using SELECT statement in MySQL?
