=?ISO-8859-1?Q?Miguel_Gonz=E1lez?= fragmentation in innodb tables
May 21, 2013; 23:03
=?ISO-8859-1?Q?Miguel_Gonz=E1lez?=
fragmentation in innodb tables
Dear all,
I'm a newbie in MySQL so bare my questions.
I have run mysqltuner.pl and It says I have fragmentation in my tables. Searching around I found this script which reports the fragmentation in my tables:
mysql -u $username -p"$password" -NBe "SHOW DATABASES;" | grep -v 'lost+found' | while read database ; do mysql -u $username -p"$password" -NBe "SHOW TABLE STATUS;" $database | while read name engine version rowformat rows avgrowlength datalength maxdatalength indexlength datafree autoincrement createtime updatetime checktime collation checksum createoptions comment ; do if [ "$datafree" -gt 0 ] ; then fragmentation=$(($datafree * 100 / $datalength)) echo "$database.$name is $fragmentation% fragmented." mysql -u "$username" -p"$password" -NBe "OPTIMIZE TABLE $name;" "$database" fi done done ===================== I have run it and reports that several of my innodb tables are fragmented
I have read several articles and I'm a bit confused. I have enabled innodb_file_per_table from the very beginning
I have run either optimize table and alter table mytable engine=INNODB and both commands don't end up shrinking the space in the idb files. The script above reports the same fragmentation.
Regards,
Miguel
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql
May 21
Rick James RE: fragmentation in innodb tables
May 21, 2013; 23:06
Rick James
RE: fragmentation in innodb tables
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!