Solved

How to shrik or optimize table in mySQL database

Posted on 2014-10-12
4
47 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 142

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 82

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MySQL - Limit or Top Records 15 36
Issue to mail 11 39
Selecting specific rows 3 35
AWS CLI issues with Tags 3 28
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é.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now