Solved

How to shrik or optimize table in mySQL database

Posted on 2014-10-12
4
70 Views
Last Modified: 2016-06-15
Hi All,

I want shrink table in MYSQL database, Please let me know the steps and requirements.

1.Query for Shrink
2.Is there any space requirement  for table Shrink
3.how to calculate required space for table shrink.

Please some help me with script and calculations.


Regards,
0
Comment
Question by:GK GK
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 40376445
1: optimize table
http://dev.mysql.com/doc/refman/5.0/en/optimize-table.html
followed by this statement:
FLUSH TABLES;

2 & 3: yes, the space needed for the resulting table size (as the table is rebuild side-by-side) and then the old one is replaced/deleted. so, if you table has 1MB size, you will need max 1 more MB free space for this
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 40376446
There is the OPTIMIZE TABLE command but I don't think there is any way to calculate the results.
http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html
0
 

Author Comment

by:GK GK
ID: 40379982
Thanks for update
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question