Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 798115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:55:07+00:00 2026-05-14T22:55:07+00:00

i am doing this: delete calibration_2009 from calibration_2009 join batchinfo_2009 on calibration_2009.rowid = batchinfo_2009.rowid

  • 0

i am doing this:

delete calibration_2009 from
calibration_2009 join batchinfo_2009
on calibration_2009.rowid = batchinfo_2009.rowid
where batchinfo_2009.reporttime like '%2010%';

both tables have about 500k lines of data
i suspect that 250k match the criteria to be deleted

so far it has been running for 2 hours!!! is there something wrong?

dev.mysql.com says i should do this:

If you are deleting many rows from a large table, you may exceed the lock table size for an InnoDB table. To avoid this problem, or simply to minimize the time that the table remains locked, the following strategy (which does not use DELETE at all) might be helpful:

Select the rows not to be deleted into an empty table that has the same structure as the original table:

INSERT INTO t_copy SELECT * FROM t WHERE ... ;
Use RENAME TABLE to atomically move the original table out of the way and rename the copy to the original name:

RENAME TABLE t TO t_old, t_copy TO t;
Drop the original table:

DROP TABLE t_old;

how do i do this with my current statement?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:55:08+00:00Added an answer on May 14, 2026 at 10:55 pm

    Some things to think about and try:

    • Are you sure that rowid is your primary key?
    • Are they the same data types?
    • Do you have an index build on it?
    • Wrap the delete in a transaction
    • Confirm you don’t have any active triggers from the delete.

    • Can you post the table schema?

    • Also, run the query through the Query Analyser to confirm the joins are happening properly

    SCRIPT TO COPY TABLE:

    INSERT INTO calibration_2009_copy
    SELECT calibration_2009.* 
    FROM calibration_2009 
     JOIN batchinfo_2009 
       ON calibration_2009.rowid = batchinfo_2009.rowid
    WHERE batchinfo_2009.reporttime not like '%2010%';
    
    RENAME TABLE calibration_2009 TO calibration_2009_old;
    RENAME TABLE calibration_2009_copy TO calibration_2009;
    
    DROP TABLE calibration_2009_old;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am doing this: delete from calibration_2009 where rowid in (SELECT rowid FROM `qcvalues`.`batchinfo_2009`
how to delete/remove call log from application. I am doing like this this.getContentResolver().delete(CallLog.Calls.CONTENT_URI,null,null); it
I have statements like this that are timing out: DELETE FROM [table] WHERE [COL]
I have a SQL like this; select B.LoweredUserName from USER_BAYI A, aspnet_Users B, aspnet_Membership
Am I doing this right? I'm trying to delete an entity from the index
I'm doing this interface where I have a lot of buttons that are just
So I am doing this query from PHP, and here listerally the exact query
Think about doing this: import matplotlib.pyplot as plt plt.plot(x_A,y_A,'g--') plt.plot(x_B,y_B,'r-o') plt.show() How would you
I'm not sure if I'm doing this the right way. I have table which
I have tried doing this via Chello (a .NET wrapper for the Trello API)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.