How To Optimize A Table In MySQL Or MariaDB

http://stackoverflow.com/questions/5474662/mysql-optimize-all-tables

$ mysqlcheck -u root -p -o dbname

In MariaDB you will see:

...
note : Table does not support optimize, doing recreate + analyze instead
status : OK

information for the result above is below. Basically, InnoDB (the storage engine used my MariaDB) is doing a different set of tasks to accomplish the same thing as MyISAM.

http://stackoverflow.com/questions/30635603/what-does-table-does-not-support-optimize-doing-recreate-analyze-instead-me

http://stackoverflow.com/questions/30692812/mysql-user-db-does-not-have-password-columns-installing-mysql-on-osx

Setting the query_cache_type

https://www.percona.com/blog/2009/11/16/table_cache-negative-scalability/

https://blogs.n1zyy.com/n1zyy/tutorials/enabling-mysqls-query-cache/

http://www.techpaste.com/2013/01/query-cache-mysql-server/

https://mariadb.com/kb/en/mariadb/optimizing-table_open_cache/

setting the query_cache_type to 1 (per mysqltuner recommendations):

$ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

change the query_cache_type to 1 in the [mysqld] section so it looks like this:

...
[mysqld]
...
query_cache_type        = 1
query_cache_limit       = 1M
query_cache_size        = 16M
...

restart mysqld

/etc/init.d/mysql restart

ALSO SEE:

https://mariadb.com/resources/blog/starting-mysql-low-memory-virtual-machines

in the my.cnf file (/etc/mysql/my.cnf), disable Performance Schema by putting this under the [mysqld] section configuration:

performance_schema = off

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.