performance with triggers depends on table size? - Mailing list pgsql-general

From Christian Mock
Subject performance with triggers depends on table size?
Date
Msg-id 20020812170632.GA11183@notemock.coretec.at
Whole thread Raw
Responses Re: performance with triggers depends on table size?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
hello,

I've got two identical tables, "input" and "output"; input is filled
by an importing process, the data is processed and partially deleted,
and the rest is copied to "output" by means of
INSERT INTO output SELECT * FROM input

What I noticed is that with triggers on the output table which update
a statistics table, the time needed for that copying is more or less
linearily dependant on the number of rows in the output table.

If I empty the triggered function (PL/pgsql), so the trigger fires but
doesn't update any tables, performance is about 60% of triggerless,
which is OK.

Also, both without a trigger and with the empty trigger, performance is
pretty much constant and doesn't depend on the size of the output table.

What I don't understand is how the size of the output table, which
is never used in the triggered function (except by the NEW alias)
can have such an extreme influence on the copying performance.

I made a small test case which is attached (perl/DBI) which demonstrates
this problem and displays the timings.

Regards,

cm.

--
Christian Mock                          Wiedner Hauptstrasse 15
Senior Security Engineer                1040 Wien
CoreTEC IT Security Solutions GmbH      +43-1-5037273

Attachment

pgsql-general by date:

Previous
From: Greg Copeland
Date:
Subject: Re: [HACKERS] Linux Largefile Support In Postgresql RPMS
Next
From: Greg Copeland
Date:
Subject: Re: [HACKERS] Linux Largefile Support In Postgresql RPMS\