LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 11-01-2011, 11:50 AM   #1
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 314
Blog Entries: 1

Rep: Reputation: 31
Freeing DATA_FREE mysql HEAP tables?


I run an application which uses several Memory tables (heap).
Sometimes a script deletes a lot of data from them. But if I do "SHOW TABLE STATUS" Data_free field still has a lot of bytes (in order of 200Mb indeed).

Is there any way to free that memory space without dropping and recreating those heap tables?
Because of the proprietary application I run in those server I had to stick with old mysql version 3.23 !

Thanks!
 
Old 11-10-2011, 02:00 PM   #2
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 314
Blog Entries: 1

Original Poster
Rep: Reputation: 31
I Finally found the answer to this "problem":

Code:
ALTER TABLE my_table ENGINE=MEMORY;
or if mysql server is 3.23:

Code:
ALTER TABLE my_table TYPE=HEAP;
These sentence force the memory table my_table to be recreated, and then data_free in show table status goes to zero. Memory allocated is freed.
Similar to OPTIMIZE TABLE for ordinary tables.

Last edited by matiasar; 11-10-2011 at 02:03 PM. Reason: add info
 
  


Reply

Tags
free, heap, mysql


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
[SOLVED] mysql join three tables secretlydead Programming 1 09-21-2011 06:35 PM
mysql reinstallation distorted by previous tables in /var/mysql mad4linux Linux - Software 0 10-04-2005 01:39 PM
MySQL tables from 4.0 to 3.0 michaelbhahn Linux - Software 0 08-31-2004 10:23 AM
mysql tables with a - pk21 Linux - Software 7 05-23-2003 06:27 AM
mysql tables noord28 Linux - Newbie 0 02-20-2003 02:56 AM


All times are GMT -5. The time now is 01:51 AM.

Main Menu
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