Re: Update in trigger

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: "[Ikl_di] Lajos" <il(at)mithrandir(dot)hu>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Update in trigger
Date: 2002-04-03 16:44:59
Message-ID: 200204031644.g33Gixc32234@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

[Ikl_di] Lajos wrote:
[Charset iso-8859-2 unsupported, filtering to ASCII...]
> Hi,
> I have a problem with trigger in 7.1.3.
> I have a table with after insert trigger, which is making updates in
> another table.
> I recognized that the more records I have in first table the slower is
> my insert.
> If my trigger is doing something else, for example inserts in another
> table, it becomes * 20 times * quicker, and the speed of my insert
> doesn't depend on tablesize.
> Don't I have to make updates in trigger?

Are there appropriate indexes on the table updated in the
trigger and is the database "VACUUM ANALYZE"ed so the indexes
get used?

Even if it is an AFTER INSERT trigger, your INSERT has to
wait until the trigger finishes, because it still has a right
to abort the transaction.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-04-03 19:07:41 Re: [SQL] Logging option
Previous Message Stephan Szabo 2002-04-03 16:39:31 Re: Primary and foreign key from system tables