Re: performance for insert / update - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: performance for insert / update
Date
Msg-id 20050628130102.GD20566@wolff.to
Whole thread Raw
In response to performance for insert / update  (Catalin Constantin <catalin@bounce-software.com>)
Responses Re: performance for insert / update
List pgsql-general
On Mon, Jun 27, 2005 at 18:46:58 +0300,
  Catalin Constantin <catalin@bounce-software.com> wrote:
> Hello,
>
> I have a pretty big database with about 200 000 rows.
> This is the main table. Also some other tables with FKs to this main
> table.
>
> I have to calculate some numbers for each entry at a certain amount of
> time and update the DB.
>
> I've noticed the update TAKES a very long time.

Do you have indexes on the foreign key fields in the referencing tables?
These are created by default and if you are updating the referenced tupples
a sequential search will be needed if there isn't an index.

Also of note is that there is recent a change to only do this if the referenced
fields in the record are changed, but I think this is new for 8.1. That
will make things go a lot faster if you aren't updating the referenced
fields in your main table.

pgsql-general by date:

Previous
From: Sergey Levchenko
Date:
Subject: ERROR: "TZ"/"tz" not supported
Next
From: "Zlatko Matic"
Date:
Subject: Re: automating backup ?