Knowledgebase

How to optimize a MySQL database

One of the most important requirements to achieve optimal performance from the MySQL database is indexing. Indexing is an internal MySQL feature that allows rapid data collection.

We see an example of a common term called "sample" with only two rows - "number" and "employee". If you execute a simple query like:

SELECT * FROM example WHERE number = 4;

MySQL will check all records and only return the one that has its value given number to 4 If you have 1 million entries, for example, this will be a slow query. In this case we have a single field - "number". Therefore, we can create an index for it. Indexing will create an internal record that is saved in the MySQL service. This can be done with the following query:

ALTER TABLE example Add INDEX (number);

Once Once this index is established, the next time you want to obtain information for employee number 4, the service will go directly to it using the index and will return the information much faster.

This is just one example very basic. For larger databases, the difference in load time can be significant. Database indexing can significantly reduce the loading time of Web applications.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

For Joomla 1.5 optimization

Joomla uses a configuration to optimize your website, this is in the "Global Configuration"...

For Joomla 1.0.x optimization

These are some tips on how to improve the performance of your Joomla 1.0.x website:* Enable cache...

For Moodle Cache optimization

To optimize Moodle, it is working from version 1.7 or earlier.We can configure the Cache Type on...

For Drupal optimization

There is an option in the drupal panel, which is called Performance and is found in the...

For Wordpress Cache optimization

WP SUPER CACHE a brief description of this plugin.This plugin, as you can see in the attached...