# deleting millions of rows

**URL:** <https://forums.percona.com/t/deleting-millions-of-rows/1117>\
**Category:** Other MySQL® Questions\
**Created:** [March 16, 2009, 4:54pm UTC](https://forums.percona.com/t/deleting-millions-of-rows/1117 "2009-03-16T16:54:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![desau](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/desau/32/806_2.png) [@desau](https://forums.percona.com/u/desau)\
**Post date:** [March 16, 2009, 4:54pm UTC](https://forums.percona.com/t/deleting-millions-of-rows/1117/1 "2009-03-16T16:54:19Z")

</div>

I have a MyASM table with 70 million rows.

I want to delete most of those rows using an index column.

I’m running a DELETE QUICK command at the moment:

DELETE QUICK FROM table\_name WHERE colum\_id IN (SELECT DISTINCT column\_id FROM another\_table WHERE blah = 1)

after the deletion is finished, I plan running OPTIMIZE TABLE

So – I’ve really got two questions:

1. Is there any way to see how many rows it’s already deleted?
2. Is there any faster way to do this? Should I CTRL-C the current command, then run OPTIMIZE TABLE, then run another delete?

---

<div class="post-metadata">

**Author:** ![MarkRose](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@MarkRose](https://forums.percona.com/u/MarkRose)\
**Post date:** [March 21, 2009, 1:00pm UTC](https://forums.percona.com/t/deleting-millions-of-rows/1117/2 "2009-03-21T13:00:04Z")

</div>

It might be quicker to save the rows you want to keep in a new table, then do a TRUNCATE TABLE on the old table, then copy the saved rows back to it.
