LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MYD and MYI files in linux server taking 48GB space (https://www.linuxquestions.org/questions/linux-newbie-8/myd-and-myi-files-in-linux-server-taking-48gb-space-4175411271/)

arjunk9 06-13-2012 02:29 PM

MYD and MYI files in linux server taking 48GB space
 
Hi Everyone...

I am new to Linux environment. In my linux server I have 48GB data of MYD and MYI formate file. I am aware of this files belongs to mysql tables. I don't why this files took this much space(48GB). I have took my database backup its only 168MB.. help me please

chrism01 06-14-2012 07:25 PM

There are (at least) 3 options & it may be a combination thereof

1. a lot of data has been deleted from the DB.
DBs do NOT auto-shrink, but they often auto-extend

2. the DB was heavily fragmented;
given the numbers above, may be part of the problem

3. if you are using fixed length fields eg CHAR instead of VARCHAR, I think the DB always creates them as full length inside the DB, due to the matching algorithms used, but its possible that mysqldump only extracts the actual data ie without the trailing spaces/blanks.

The easiest way to test is to grab a spare system from somewhere and reload the dump.
If DB stays small, its options 1 & possibly 2
If DB inflates again, its option 3.

You should have a good read over at MySQL http://dev.mysql.com/doc/refman/5.1/en/

frankbell 06-14-2012 07:35 PM

I am assuming that there's just the one database.

This is just a shot in the dark and I am not a DBA by any means, but you have done a database check, repair, and optimize? If so, what was the result.


All times are GMT -5. The time now is 12:36 PM.