Re: Delete Performance - Mailing list pgsql-general

From Tom Lane
Subject Re: Delete Performance
Date
Msg-id 18528.1005963694@sss.pgh.pa.us
Whole thread Raw
In response to Delete Performance  ("P.J. \"Josh\" Rovero" <rovero@sonalysts.com>)
List pgsql-general
"P.J. \"Josh\" Rovero" <rovero@sonalysts.com> writes:
> But even with sequential scan, the catalog entries are
> deleted quickly (30K records in just a couple of seconds),
> vice slow deletes (2 per second) for the toasted text.

> The catalog entries are about 200 bytes (integers, timestamps,
> a couple of short fixed length strings), while the toasted
> text table has one short text field, one timestamp, and one
> long (2K to 20K bytes) toasted text field.

I observed over in pg-hackers that deletion speed seems to be
proportional to total volume of data deleted, but that's not enough
to explain your results.  You're reporting a 10000X speed difference
with only 10-100X difference in data volume, so there's still a large
factor to be accounted for.

Are you sure you don't have any rules, triggers, foreign keys involving
the slower table?

            regards, tom lane

pgsql-general by date:

Previous
From: Grant Table
Date:
Subject: Triggers, functions and column names: a poser
Next
From: "Gurunandan R. Bhat"
Date:
Subject: Re: Triggers, functions and column names: a poser