If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > shift /split or rename tables ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-03-04, 09:31
OpenT OpenT is offline
Registered User
 
Join Date: May 2004
Posts: 1
shift /split or rename tables ?

We have a set of INODB tables (auto-increment-columns) that grow at rapid rates. The tables are filled by a java aplication that does massive inserts. After a certain amount of time these tables contain 4 million rows and are 1 GIG big. I conducted substantial testing and noticed that things started to slow down after these 4 million rows had built up.

What I would like to do, is to shift /split or rename these tables and create new empty tables, so that the java aplication can continue to insert with as little as possible delay.

Does anyone knows a way of doing this?

Thanks

OpenT
Reply With Quote
  #2 (permalink)  
Old 05-06-04, 08:00
hurmavi hurmavi is offline
Registered User
 
Join Date: Jan 2004
Location: Europe, Finland, Helsinki
Posts: 60
Create and Rename will do it.

First create a new table. Check that everything is fine.

Then (when there are no users) do a rename:

RENAME TABLE old_table TO history_table, new_table TO old_table;

As this operation is atomic, this operation will be a success, or it'll leave everything as it was before.

Cheers, Bill
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On