LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 02:55 AM   #1
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,356

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 03:12 AM.
 
Old 01-01-2014, 12:39 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,091

Rep: Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718Reputation: 2718
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.
 
1 members found this post helpful.
Old 01-01-2014, 07:42 PM   #3
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,622
Blog Entries: 1

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, 01:02 AM   #4
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,356

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, 09:26 AM   #5
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,622
Blog Entries: 1

Rep: Reputation: Disabled
Glad it worked out.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:58 AM
MYD and MYI files in linux server taking 48GB space arjunk9 Linux - Newbie 2 06-14-2012 08:35 PM
[SOLVED] mysql .MYD .MYI are missing ilvista Linux - Newbie 4 04-06-2011 04:07 AM
mysql MyISAM table doesn't have .MYD and MYI files. celeron Linux - Server 2 02-01-2011 08:35 AM
Application to convert MySQL files MYD, MYI, FRM to SQL text files ? SethShannon Linux - Newbie 1 09-28-2007 07:03 PM


All times are GMT -5. The time now is 11:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration