473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re[2]: Is it necessary to compress tables?

Jim,
Does MySQL automatically handle deleted row cleanup, or is it necessary to
periodically do this manually for tables with a lot of deletions? If it's
manual, what are the SQL commands to do this?
Depends on which storage engine you are using. If you are using InnoDB
tables, there's no need to "vacuum" tables that way, as InnoDB will do
that automatically. If you use MyISAM tables, however, you might be
able to speed up things quite a bit by using the OPTIMIZE TABLE
command at regular intervals. That SQL command will reclaim unused
space that results from deleting rows, and it will speed up table
lookups:

http://www.mysql.com/doc/en/OPTIMIZE_TABLE.html
Also, what happens when changes are made to a field definition? From, say,

int
to smallint, or tinyint to int, or varchar(255) to varchar(10)? Do temporary
tables get created and the data copied over, or does unused space end up in

the
data files, to be collected later?


This sentence from the manual should make that clear: "ALTER TABLE
works by making a temporary copy of the original table." You can find
details here:

http://www.mysql.com/doc/en/ALTER_TABLE.html

Regards,
--
Stefan Hinz <hi**@iConnect.de>
iConnect GmbH <http://iConnect.de>
Heesestr. 6, 12169 Berlin (Germany)
Telefon: +49 30 7970948-0 Fax: +49 30 7970948-3

[filter fodder: sql, mysql, query]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1827

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Junkmail | last post by:
I have an application with highly compressable strings (gzip encoding usually does somewhere between 20-50X reduction.) My base 350MB database is mostly made up of these slowly (or even static)...
18
by: Guinness Mann | last post by:
Greetings, I think I saw an article yesterday in which you told someone not to make an Identity column a primary key. I seem to remember you saying something like "It undermines the entire...
25
by: Xah Lee | last post by:
Python Doc Problem Example: gzip Xah Lee, 20050831 Today i need to use Python to compress/decompress gzip files. Since i've read the official Python tutorial 8 months ago, have spent 30...
4
by: uthuras | last post by:
Hi all, I have DB2ESE version 8.1 with FP 4 on AIX 5.2. My database used to be 1.1TB. When the DB size is 1.1TB, it takes approximately 7 hours to backup the entire database (online backup). The...
17
by: dunric | last post by:
After writing the computing urban legend "The Helsinki Code", I spent several nights thinking up how in the world Gustav Larsson, the Finnish PDP-8 computer programmer, could have managed to...
4
by: Bala Nagarajan | last post by:
Hello, We are developing an application (Windows forms) that allows users to take a snapshot of the some database tables and save them another set set of tables (called Model tables)and work...
10
by: Asaf | last post by:
Hi, I am trying to Compress & Decompress a DataSet. When running this code I am receiving the error: System.Xml.XmlException was unhandled Message="Root element is missing."...
3
by: kpmassey | last post by:
I'm using javascript to construct large tables from an array of data, using ideas from: http://www.oreillynet.com/pub/a/javascript/2003/05/06/dannygoodman.html The data itself cannot be...
46
by: Bruce W. Darby | last post by:
This will be my very first VB.Net application and it's pretty simple. But I've got a snag in my syntax somewhere. Was hoping that someone could point me in the right direction. The history: My...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.