Re: Chunk Delete - Mailing list pgsql-general

From Csaba Nagy
Subject Re: Chunk Delete
Date
Msg-id 1195395503.11052.6.camel@PCD12478
Whole thread Raw
In response to Re: Chunk Delete  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
On Thu, 2007-11-15 at 17:13 +0000, Gregory Stark wrote:
> DELETE
>   FROM atable AS x
>  USING (SELECT ctid FROM atable LIMIT 50000) AS y
>  WHERE x.ctid = y.ctid;

Have you tried to EXPLAIN this one ? Last time I tried to do something
similar it was going for a sequential scan on atable with a filter on
ctid. The other form using "where ctid = any (array(select ctid
from ..." (see my previous post forwarding Tom's suggestion) was going
for a ctid scan, which should be orders of magnitudes faster than the
sequential scan for big tables and small chunks.

Cheers,
Csaba.



pgsql-general by date:

Previous
From: "Mag Gam"
Date:
Subject: tsearch2 best practices
Next
From: MaXX
Date:
Subject: Re: Compressed Backup too big