From: Marie G. Tuite <marie.tuite@edisonaffiliates.com>
To: Kuhn, Dylan K (4520500D) <Dylan.Kuhn@navy.mil>
To: pgsql-admin@postgresql.org
Subject: Re: bulk DELETE speed
Date: Fri, 16 May 2003 13:15:54 -0500
Message-ID: <IGELKLINGDMODABPOOFEEEGKECAA.marie.tuite@edisonaffiliates.com> (raw)
In-Reply-To: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576D4@NAWECHLKEX01VA.nadsuswe.nads.navy.mil>
bulk DELETE speedIf you can delete all records, try truncating the table:
truncate table your_table;
This is more efficient and also has the affect of resetting the table.
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Kuhn, Dylan K
(4520500D)
Sent: Friday, May 16, 2003 12:15 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] bulk DELETE speed
I'm trying to figure out why deletes are slow on a particular table.
I have a few tables with millions of rows, and have noticed that deleting
rows is many times slower on one of them. It does have PL/PGSQL before and
after delete triggers. I've tried disabling the triggers in pg_trigger,
dropping them, doing the deletes in transactions, with exclusive locks --
nothing seems to work. Maybe it isn't the triggers at all, and I need to do
some sort of analysis on my table to figure out why it is slow?
Does anyone have any other tricks for speeding up bulk deletes?
Thanks,
Dylan Kuhn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: marie.tuite@edisonaffiliates.com, Dylan.Kuhn@navy.mil
Subject: Re: bulk DELETE speed
In-Reply-To: <IGELKLINGDMODABPOOFEEEGKECAA.marie.tuite@edisonaffiliates.com>
References: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576D4@NAWECHLKEX01VA.nadsuswe.nads.navy.mil> <IGELKLINGDMODABPOOFEEEGKECAA.marie.tuite@edisonaffiliates.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox