Re: Question of using COPY on a table with triggers

От: Benjamin Krajmalnik
Тема: Re: Question of using COPY on a table with triggers
Дата: ,
Msg-id: F4E6A2751A2823418A21D4A160B6898861470A@fletch.stackdump.local
(см: обсуждение, исходный текст)
Ответ на: Re: Question of using COPY on a table with triggers  ("Pierre C")
Ответы: Re: Question of using COPY on a table with triggers  (Tom Lane)
Список: pgsql-performance

Скрыть дерево обсуждения

Question of using COPY on a table with triggers  ("Benjamin Krajmalnik", )
 Re: Question of using COPY on a table with triggers  ("Pierre C", )
  Re: Question of using COPY on a table with triggers  ("Benjamin Krajmalnik", )
   Re: Question of using COPY on a table with triggers  (Tom Lane, )

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
tablesand then insert the raw data point into a 4th table.
 


> -----Original Message-----
> From: Pierre C [mailto:]
> Sent: Thursday, July 15, 2010 4:47 PM
> To: Benjamin Krajmalnik; 
> 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 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.


В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Question of using COPY on a table with triggers
От: Ryan Wexler
Дата:
Сообщение: Re: performance on new linux box