1 / 11

MySQL database and SQL-Working with Table Fragmentation

You may already know that a table that only undergoes a whole lot of insert operations doesnu2019t face fragmentation in MySQL database and SQL. Generally, this takes place through an update or a delete operation.

Download Presentation

MySQL database and SQL-Working with Table Fragmentation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MySQL database and SQL: Working with Table Fragmentation

  2. Such tasks leave behind gaps among the information that remains in the table and that is the true cause of table fragmentation. Moreover, the database doesn’t immediately replace these spaces that non- insert DML commands liberate. You may already know that a table that only undergoes a whole lot of insert operations doesn’t face fragmentation in MySQL database and SQL. Generally, this takes place through an update or a delete operation.

  3. MySQL SQL Performance Tuning: Managing Table Fragmentation ∙ In some cases, row storage isn’t contiguous or the rows are divided across multiple blocks. Both of these negatively impact the database, so you will need MySQL SQL performance tuning to reduce the requirement of additional block accesses. ∙ Keep in mind that table fragmentation and file fragmentation are two distinct occurrences. Table fragmentation involves the application of many Data Manipulation Language commands. This is because the resulting free space does not get released by the DML from the table, except if it is under the High-Water Mark (HWM). ∙ High Water Mark is a measure of that DBMSs occupied blocks. Those that lie under the HWM may or may not have data at the moment but they have held it at least once. The database is aware that blocks over this indicator have never contained data.

  4. Why Table Reorganization Can Help MySQL Database and SQL

  5. This particular task helps deal with three major problems with MySQL Database and SQL: Too many chained or migrated rows Sluggish table response time Wasted old space due to non-uniform table growth

  6. There are certain ways to locate a majority of fragmented tables. Look for tables that have a sizable difference in their expected and actual sizes. Such differences usually occur thanks to table fragmentation or old stats that haven’t gone through updates.

  7. If you want to determine and eliminate table fragmentation, you may follow the steps explained briefly below: ∙ Bring together important table stats, such as the actual size and stats size. These will help you calculate the exact difference between the two and help you identify the presence of fragmentation. You will require updated stats in dba_tables for this purpose. To verify whether the stats are new, you can go through the last_analyzed value or try collecting table stats. ∙ Find out the current table size- if it is smaller than its older size, you can tell it has undergone table fragmentation. ∙ Other signs you can look for in the table include the overall size of the table (with fragmentation), what size you may expect in the absence of fragmentation, and the percentage size the DBA may regain once fragmentation is removed. You will require the table and schema names for this.

  8. Final Thoughts

  9. • You can still gain performance-related advantages from a large number of fragmented tables with the help of the steps mentioned above. • These will enable you to collect all the necessary statistics that will inform the optimizer on how to build the most favourable execution plan. The plan will ensure MySQL SQL performance tuning for better results during statement execution.

More Related