LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-31-2013, 01:55 AM   #1
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Reducing mysql .MYD and .MYI file size


I have a .MYD file of 33GB in production.
I want to reduce its size.

Can I perform these below activities without any bad result:

1. Delete all rows created before certain date.(As we have backup and dont need much older data)

2. Run the optimize table command.

3. Run the analyze table command.

Last edited by divyashree; 12-31-2013 at 02:12 AM.
 
Old 01-01-2014, 11:39 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,659

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by divyashree View Post
I have a .MYD file of 33GB in production. I want to reduce its size.

Can I perform these below activities without any bad result:

1. Delete all rows created before certain date.(As we have backup and dont need much older data)
2. Run the optimize table command.
3. Run the analyze table command.
  1. We have no way of knowing what deleting old data will do to your system. If you don't need it, it will obviously not hurt anything.
  2. Read the MySQL documentation: http://dev.mysql.com/doc/refman/5.1/...ize-table.html
  3. Read the MySQL documentation: http://dev.mysql.com/doc/refman/5.0/...yze-table.html
There are FAR too many variables for anyone to safely say if anything will be damaged. Make backups first, and get users off the database before performing any kind of maintenance. In other words, basic system administration practices.
 
2 members found this post helpful.
Old 01-01-2014, 06:42 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by divyashree View Post
I have a .MYD file of 33GB in production.
I want to reduce its size.
I wouldn't touch it with a barge pole.
Keyword: production
 
2 members found this post helpful.
Old 01-02-2014, 12:02 AM   #4
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Original Poster
Rep: Reputation: 135Reputation: 135
Hi TBone and habitual. Thanks for the reply.

I was able to reduce the size with the same steps.

Here all SA practices are followed.

But the reason I asked it, as I found a lot of people in problem while running optimize with gigs of .MYD files.

Here in my case I was giving some MySQL optimization solutions to the admins of a client without my direct involvement. So was afraid a little if something might have happened.

Any way it worked fine without any issue but took long hours.
 
Old 01-02-2014, 08:26 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it worked out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MYI and MYD files getting removed qweeak Linux - Newbie 1 09-05-2012 10:58 AM
MYD and MYI files in linux server taking 48GB space arjunk9 Linux - Newbie 2 06-14-2012 07:35 PM
[SOLVED] mysql .MYD .MYI are missing ilvista Linux - Newbie 4 04-06-2011 03:07 AM
mysql MyISAM table doesn't have .MYD and MYI files. celeron Linux - Server 2 02-01-2011 07:35 AM
Application to convert MySQL files MYD, MYI, FRM to SQL text files ? SethShannon Linux - Newbie 1 09-28-2007 06:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration