Re: DELETE and efficiency - Mailing list pgsql-general

From Neil Conway
Subject Re: DELETE and efficiency
Date
Msg-id 20010306170526.A307@klamath.dyndns.org
Whole thread Raw
In response to DELETE and efficiency  (gateley@jriver.com)
Responses Re: DELETE and efficiency
List pgsql-general
On Tue, Mar 06, 2001 at 03:21:19PM -0600, gateley@jriver.com wrote:
> I am working on an application with
> very dynamic data: it gets added and
> deleted often. How effecient are the
> searches in this situation?
[...]
> Is using DELETE going to kill my performance?

In short, no.

I don't think so, at any rate. A DELETE is just like any query, so
you'll need to fine tune the queries, make indexes, look at the output
of EXPLAIN, etc. But I can't see why a DELETE would be any slower than
most other queries.

But as I understand it, a DELETE just marks the row as deleted -- the
data is not actually removed from disk. This means they should be
fast, but it also means that doing a VACUUM [ANALYZE] fairly regularly
is probably a good idea.

HTH,

Neil

--
Neil Conway <neilconway@home.com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

You can use facts to prove anything that's even remotely true.
        -- Homer J. Simpson

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: max(field) vs select field .. order by desc limit 1
Next
From: Michelle Murrain
Date:
Subject: Re: DELETE and efficiency