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 0 1845 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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) strings. I
would like to compress these so that my disk I/O and memory footprint
is greatly reduced.
Some databases have the ability to provide a compressed
table, compressed column, or provide a user defined function to
compress an indvidual...
|
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 foundation of the relational
model."
I've been thinking about that all night and I think I understand what
you're saying, but I have some questions.
|
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
minutes with Python 3 times a week since, have 14 years of computing
experience, 8 years in mathematical computing and 4 years in unix admin
and perl, i have quickly found the official doc:
http://python.org/doc/2.4.1/lib/module-gzip.html
|
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 backup is directed to
disk and not tape.
Recently, we did data archival by purging some of the records. Now, the
size of the database is 500GB plus. That means, only data purged and we
never resize the tablespace. Therefore, the allocated...
|
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 receive such a miraculous message from God.
Surely, for a 1-byte computer program such as "@" to compile
successfully (in RTPS FORTRAN), a miracle compression algorithm
would be necessary.
Then it dawned on me. Gustav had accidentally stumbled upon
| |
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 with them . Since the data that goes
into model tables are huge (in the order of 30000 records for each table) we
envisaged that we are going to run out of database space if more users start
hitting our application database. To solve this problem i...
|
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."
Source="System.Xml"
The code:
|
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 constructed by the javascript code, so is
explicitly passed in with a large array, e.g.
var data = new Array();
|
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 work involves creating custom packages of our software product for golf
courses that purchase our software. The course data is kept as a back up in
the event the course needs us to replace their custom files. Each course has
a folder of it's own...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |