Skip site navigation (1) Skip section navigation (2)

Re: Question of using COPY on a table with triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Benjamin Krajmalnik" <kraj(at)servoyant(dot)com>
Cc: "Pierre C" <lists(at)peufeu(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Question of using COPY on a table with triggers
Date: 2010-07-16 00:24:46
Message-ID: 1005.1279239886@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Benjamin Krajmalnik" <kraj(at)servoyant(dot)com> writes:
> That is what I thought.
> The trigger calls a 3000 row stored procedure which does all of the calculations to aggregate data into 3 separate tables and then insert the raw data point into a 4th table.

Youch.  Seems like you might want to rethink the idea of doing those
calculations incrementally for each added row.  Wouldn't it be better
to add all the new data and then do the aggregation once?

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Scott MarloweDate: 2010-07-16 01:22:58
Subject: Re: performance on new linux box
Previous:From: Benjamin KrajmalnikDate: 2010-07-15 23:28:39
Subject: Re: Question of using COPY on a table with triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group