» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2006, 08:01 AM
Jaelyn Jaelyn is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Jaelyn is on a distinguished road
Default Deletion causes problems!

hello guys,
here is the issue!
I have a transaction table. Records are added regularly. When I decided to purge the 500,000 oldest. I ran this simple command:

DELETE FROM am_log WHERE id<500000

It ran for 40 minutes, caused timeouts for other operations calling the database. When it was done, the table was no longer functional as am_log.myi was corrupted. After a long rebuild, it was back.

how best to approach keeping this table a managable size and in good shape? I could run a cron every night and knock off 50K records or so. If I do one of those, how often do I need to optimize the table? How long will the optimize process take? What happens when the table is called by some function while it is being optimized? -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-08-2006, 08:05 AM
Jan Jan is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Jan is on a distinguished road
Default

you could try deleting in smaller chunks. If you're getting a lot of records you probably do want to cron somethig to delete records you don't want.
Or instead of sticking tons of records into one table, have a script to create a new table for each day so you only get a moderate amount of records in a single table each day.

Optimizing the table depends on the length, it'll help a lot after you delete a lot of records for certain. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
i m facing ranking problems jig123 Yahoo 5 07-22-2008 10:10 AM
problems with Google Toolbar recently? hunter Google 3 09-18-2006 03:19 PM
new host problems? Janae Web Hosting Industry 1 08-12-2006 09:37 AM
PHP/MySql problems splendor PHP Programming and Tips 1 07-30-2006 12:08 PM
Problems connecting to mysqld from mysql carri MySQL Forums 1 12-08-2005 05:01 AM


All times are GMT. The time now is 09:45 AM.