Re: Question of using COPY on a table with triggers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux