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

Re: Question of using COPY on a table with triggers

From: "Pierre C" <lists(at)peufeu(dot)com>
To: "Benjamin Krajmalnik" <kraj(at)servoyant(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Question of using COPY on a table with triggers
Date: 2010-07-15 22:46:54
Message-ID: op.vfwpkgx0eorkce@apollo13 (view raw or flat)
Thread:
Lists: pgsql-performance
> 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 inserting into the tbale and trigger-calling has to be done for  
both.

If the trigger is a "very large stored procedure" it is very likely that  
executing it will take a lot more time than parsing & executing the  
INSERT. So, using COPY instead of INSERT will not gain you anything.

In response to

Responses

pgsql-performance by date

Next:From: Pierre CDate: 2010-07-15 22:57:28
Subject: Re: performance on new linux box
Previous:From: Ben ChobotDate: 2010-07-15 22:18:45
Subject: Re: performance on new linux box

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