Deleting millions of rows

From: Brian Cox <brian(dot)cox(at)ca(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Deleting millions of rows
Date: 2009-02-02 18:17:36
Message-ID: 498738C0.8000508@ca.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I'm using 8.3.5. Table ts_defects has 48M rows. Through psql: delete
from ts_defects;
Result: out of memory/Can't allocate size: 32
I then did 10 or so deletes to get rid of the rows. Afterwards, inserts
into or queries on this
table performed significantly slower. I tried a vacuum analyze, but this
didn't help. To fix this,
I dumped and restored the database.

1) why can't postgres delete all rows in a table if it has millions of rows?
2) is there any other way to restore performance other than restoring
the database?

Thanks,
Brian

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2009-02-02 18:38:50 Re: Deleting millions of rows
Previous Message Scott Carey 2009-01-31 03:28:42 Re: SSD performance