Re: performance for insert / update

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Catalin Constantin <catalin(at)bounce-software(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: performance for insert / update
Date: 2005-06-28 13:01:02
Message-ID: 20050628130102.GD20566@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 27, 2005 at 18:46:58 +0300,
Catalin Constantin <catalin(at)bounce-software(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zlatko Matic 2005-06-28 13:07:42 Re: automating backup ?
Previous Message Sergey Levchenko 2005-06-28 11:39:39 ERROR: "TZ"/"tz" not supported