pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pierre C <lists@peufeu.com>
To: Benjamin Krajmalnik <kraj@servoyant.com>
To: pgsql-performance@postgresql.org
Subject: Re: Question of using COPY on a table with triggers
Date: Fri, 16 Jul 2010 00:46:54 +0200
Message-ID: <op.vfwpkgx0eorkce@apollo13> (raw)
In-Reply-To: <F4E6A2751A2823418A21D4A160B68988614706@fletch.stackdump.local>
References: <F4E6A2751A2823418A21D4A160B68988614706@fletch.stackdump.local>

> 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.



view thread (4+ messages)  latest in thread

Message-ID: <op.vfwpkgx0eorkce@apollo13>
Permalink:  ../op.vfwpkgx0eorkce@apollo13/
Also on:    postgresql.org/message-id/op.vfwpkgx0eorkce@apollo13

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: lists@peufeu.com, kraj@servoyant.com
  Subject: Re: Question of using COPY on a table with triggers
  In-Reply-To: <op.vfwpkgx0eorkce@apollo13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox