Delete million of rows by ID in SQL

1145555 pts.
Tags:
Big Data
SQL
We're trying to delete roughly 2 million rows from our PG database. We already have a list of IDs that need to be deleted but it's turning into a slow process. This is what I tried:
DELETE FROM tbl WHERE id IN (select * from ids)
So basically, this is taking about 2 days to finish. Is there a better way to do this?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

What’s your hardware and server set-up ?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: