Jump to content

ANALYZE/ OPTIMISE in MYSQL


natasha_sharma
Go to solution Solved by gizmola,

Recommended Posts

  • Solution

The answer really depends on the engine, but the basic idea is that analyze looks at key distribution in the table and updates some statistics in the data dictionary so that the query optimizer can make informed decisions in regards to when it should use an index or ignore it.

 

Optimize is basically analyze+ some table restructuring, but this again is highly dependent on the storage engine.  Innodb doesn't typically need analyze, as it has statistical updates baked in.  By the same token the way data is stored in innodb vs myisam is completely different, so there's literally nothing common between engines, and that certainly is true of the other engines that have come along in Maria etc.

Link to comment
Share on other sites

Thankyou Gizmola.

 

Here is the details of my XAMPP MysQL:

 

  • Server: 127.0.0.1 via TCP/IP
  • Server type: MariaDB
  • Server version: 10.1.9-MariaDB - mariadb.org binary distribution
  • Protocol version: 10
  • User: root@localhost
  • Server charset: UTF-8 Unicode (utf8)

 

So it looks like its MariaDB, so now doing ANALYZE and OPTIMIZE will be beneficial for MariaDB unlike for innoDB?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.