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 > Delete big amount of data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-23-06, 13:34
avihai avihai is offline
Registered User
 
Join Date: Jul 2003
Posts: 24
Delete big amount of data

Hey,

I need to delete big amount of data (around 300K).
I don’t want that the delete process will disturb to the main process (event record) to run.

So i wonder:
1. Is there an option to delete in chunks?
2. Is there a way to delete in background?
Can I check if the process or the db is busy and in case it is to wait with the delete?

Do you have any tips for this?

Thank you.
Reply With Quote
  #2 (permalink)  
Old 07-29-06, 17:38
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
If you are looking to looking to delete all the rows in the table the most efficient way to do this is to use "TRUNCATE TABLE table_name".

Or perhaps you are looking to use a WHERE clause? To my knowledge, MySQL does not provide such a backgroud process option but you could do it if you have access to cron, executing a SQL command via a script, which perhaps uses the MySQL "LIMIT" option.

We generally don't call a function to ask if the database is busy or not.

For more replies, you might share how long the 300k row delete query takes to run on your system, how may users, etc.
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