Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003

    Unanswered: Delete big amount of data


    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.

  2. #2
    Join Date
    Jul 2004
    Dundee, Scotland
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts