In the previous chapters, we dealt mostly with table columns. In this chapter, we will learn how to perform some operations that influence tables or databases as a whole. We will cover table attributes and how to modify them, and will also discuss multi-table operations.
Various links that enable table operations have been put together on the Operations page of the Table
view. Here is an overview of this page:
During its lifetime, a table repeatedly gets modified and is, therefore, continually growing and shrinking. Outages may occur on the server, leaving some tables in a damaged state.
Using the Operations page, we can perform various operations, which are listed next. However, not every operation is available for every storage engine.
JOIN
operations to determine the order in which the tables should be joined. This operation should be periodically done (in case data has changed in the table) to improve JOIN
efficiency. MyISAM
and ARCHIVE
engines. Note that a table might be so corrupted that we cannot even go into Table
view for it! In such a case, refer to the Multi-table operations section for the procedure to repair it. InnoDB
table fragment its index. The table should be periodically defragmented for faster data retrieval. This operation causes MySQL to rebuild the table and only applies to InnoDB
. VARCHAR
columns, lost bytes remain in the table. phpMyAdmin warns us in various places (for example, in the Structure
view) if it feels the table should be optimized. This operation reclaims the unused space in the table. In the case of MySQL 5.x, the relevant tables that can be optimized use the MyISAM, InnoDB
, and ARCHIVE
engines.The operations are based on the available underlying MySQL queries—phpMyAdmin only calls those queries. More details are available at http://dev.mysql.com/doc/refman/5.5/en/table-maintenance-sql.html.
18.191.162.51