Solved

How to shrik or optimize table in mySQL database

Posted on 2014-10-12
4
76 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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