Re: [PERFORM] Question of using COPY on a table with triggers

2010-07-15 Thread Tom Lane
"Benjamin Krajmalnik" 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 d

Re: [PERFORM] Question of using COPY on a table with triggers

2010-07-15 Thread Benjamin Krajmalnik
day, July 15, 2010 4:47 PM > To: Benjamin Krajmalnik; pgsql-performance@postgresql.org > Subject: Re: [PERFORM] Question of using COPY on a table with triggers > > > Essentially, we insert a set of columns into a table, and each row > fires > > a trigger function which ca

Re: [PERFORM] Question of using COPY on a table with triggers

2010-07-15 Thread Pierre C
Essentially, we insert a set of columns into a table, and each row fires a trigger function which calls a very large stored procedure For inserting lots of rows, COPY is much faster than INSERT because it parses data (a lot) faster and is more "data-stream-friendly". However the actual inse

[PERFORM] Question of using COPY on a table with triggers

2010-07-15 Thread Benjamin Krajmalnik
First of all, a little background. We have a table which is used as a trigger table for entering and processing data for a network monitoring system. Essentially, we insert a set of columns into a table, and each row fires a trigger function which calls a very large stored procedure which aggrega