473,799 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Optimizing tables

Hi,
I have big problem with mysql 4.0.18 . Because my database is growing
up, every night records that are older than some date are deleted. But
size of database on disk isn`t smaller after this operation. There are
some solutions to free space by OPTIMIZE TABLE command, but this
command when executes, does temporary copy of database. How can I free
memory and avoid doing temporary copy of database ( because I don`t
enough free space for this ).

Best Regards

Mar 24 '06 #1
1 1496
"coyote2002 " <co********@int eria.pl> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .
How can I free
memory and avoid doing temporary copy of database ( because I don`t
enough free space for this ).


This is a common complaint about MySQL. See the comments in this bug:
http://bugs.mysql.com/bug.php?id=1341

The bug is unresolved at this time. The recommendation is to use ALTER
TABLE (even one that changes nothing like ALTER TABLE myTable TYPE=InnoDB
when the table is already InnoDB) to rebuild the table. But this still
doesn't shrink the file, it just defragments the space so subsequent updates
to the table can utilize the free space more efficiently.

AFAIK, the only way to shrink the files is to back up your tables (or entire
database), DROP them, and then restore them from the backups.

In the case of InnoDB, you may have to back up _all_ databases, manually
remove the "<datadir>/ibdata1" file, and then restore the databases. This
is because InnoDB stores all tables and indexes in that one file.

In the case of MyISAM, you can do this on a table-by-table basis, since each
table is stored in a separate file on disk. InnoDB has an option
"innodb_file_pe r_table" that you can enable to make it store tables
similarly.

This is a big inconvenience when using MySQL, but several other RDBMS brands
suffer from similar limitations. It's hard to shrink a database file as an
online task. Depending on the quantity of data, it could take a long time
to do that, and it interrupts other clients' access to the database.

Regards,
Bill K.
Mar 24 '06 #2

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

Similar topics

0
2368
by: Soefara | last post by:
Dear Sirs, I am experiencing strange results when trying to optimize a LEFT JOIN on 3 tables using MySQL. Given 3 tables A, B, C such as the following: create table A ( uniqueId int not null default 0 auto_increment, a1 varchar(64) not null default '',
0
509
by: Eric B. | last post by:
Hi, I'm somewhat new to MySql. I've been using it for a while, but pretty much out of the box setup, and am starting to suffer heavily with my larger tables. I have a table with 5,000,000+ rows that I have to search and do joins on. Although I have an index set up for it, the joined select will still take some 400+ seconds to return, which is obviously unacceptable. This is due to enormous HD access. Perhaps someone can help me...
0
1077
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql server 2000, Deployed on a windows 2003 box. Reporting is done using Crystal reports 10 A third party component grid from DevExpress has been used on all the forms
2
1662
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql server 2000, Deployed on a windows 2003 box. Reporting is done using Crystal reports 10 A third party component grid from DevExpress has been used on all the forms
35
8360
by: Thomas Matthews | last post by:
Hi, My son is writing a program to move a character. He is using the numbers on the keypad to indicate the direction of movement: 7 8 9 4 5 6 1 2 3 Each number has a direction except for '5'. So in his switch statement, he omits a case for '5':
0
1036
by: sameer | last post by:
Hi All, We had developed a .Net application which has the following environment Uses the No touch deployment concept Uses framework 1.1 on client and server machine, Visual studio 2003, Sql server 2000, Deployed on a windows 2003 box. Reporting is done using Crystal reports 10 A third party component grid from DevExpress has been used on all the forms
18
1396
by: amywolfie | last post by:
I have a very busy input form that has about 6 graphical buttons and 6 embedded subforms. The database backend is located on a local network; the front ends will be on each user's C:\ drive. It is taking a long, long time for this to load: I did go in and reindex the tables, which speeded things up tremendously. Is there anything else I can do to optimize performance? As of now,
1
1428
by: xpcer | last post by:
hi, friends, i have an problem, like this, i have tables, when i want to use "select" statement that include "join" sintaxt, my query will execute about 1 hour, so long. can u tell me how to optimizing my query, may be using index, or another?
2
1692
by: suneelid2000 | last post by:
Actually i am really confused regarding paging activity I want to implement paging in asp.net but i am not able to take out the idea regarding how to implement the concept for large databases where the tables r containing 1000s of records Problem is:I cannot save the dataset in session as it will b too costly and all the time i cannot access the database as database transasction require costly operations
5
2881
by: John Rivers | last post by:
Hello has anybody else noticed I have queries that SQL 2000 optimizes correctly and they run very fast Yet SQL 2005 keeps using a dumb query plan and queries run very slow The problem seems to stem from the assumption that data in a derived
0
9687
marktang
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...
0
9541
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,...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
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,...
0
10027
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 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...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.