Re: Poor Delete performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bill Huff <bhuff(at)colltech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Poor Delete performance
Date: 2001-03-12 15:10:57
Message-ID: 27546.984409857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bill Huff <bhuff(at)colltech(dot)com> writes:
> It appears that in deleting records from a table with a significant
> number or rows ( in this case 1.3 million ) it takes about 1 hour per
> 100K rows deleted if deleting more then 400K at a time. This sounds
> way to slow to me.

Me too. What PG version is this? What's the query exactly, and what
does EXPLAIN show for it? What is the full table definition ("pg_dump
-s -t tablename dbname" is the most reliable way to present the table)?

> I have searched the on-line archives for all the postgres lists and
> checked the FAQ and I can't find anything that gives any insight into
> increasing delete performance.

DELETE (and UPDATE) are pretty much like SELECT as far as performance
considerations go. Selecting the tuples to delete/update is the primary
performance issue. So the docs about performance generally just talk
about SELECT to keep things simple.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karel Zak 2001-03-12 15:15:01 Re: Delete Cascade
Previous Message Marcelo Pereira 2001-03-12 15:07:13 Delete Cascade