Re: having indexes when clearing tables - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: having indexes when clearing tables
Date
Msg-id 20060712034605.GA29122@wolff.to
Whole thread Raw
In response to having indexes when clearing tables  ("nuno" <wegein@gmail.com>)
List pgsql-general
On Sun, Jul 09, 2006 at 20:35:39 -0700,
  nuno <wegein@gmail.com> wrote:
> hi there.
>
> i'm trying to clear data in a table but somehow it takes way too much
> time than i once expected (i'm using the formal 'delete from xxx' type
> of query.).
>
> this table's got several foreign keys and i suspect that is why it
> takes longer than expected.

If there are foreign keys referencing the table you are deleting from, then
it can be very benificial to have indexes on those tables. Having an index
on the table you are deleting from isn't useful when deleting all of the rows
in the table.

>
> my question is that
> would having indexes increase query performance when clearing tables?
> or could anyone suggest me any ways to increase performance of the
> query in such cases?
>
> thanks very much.
>
> regards, nuno
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: doesn't recognize "!=-" (not equal to a negative value)
Next
From: Ken Johanson
Date:
Subject: 8.2 Beta ETA