Search Postgresql Archives

Re: in Pl/PgSQL, do commit every 5000 records

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

 



On Fri, Mar 10, 2006 at 09:36:16 -0500,
  Emi Lu <emilu@xxxxxxxxxxxxxxxxx> wrote:
> Good morning,
> 
> In a plpgsql function, I am trying to insert 900, 000 records into 
> several tables. I remembered people mentioned before that it is better 
> and more efficient to commit actions for let's say every 5000 records' 
> insertion.

You can't do commits inside of a function. I think you are misremembering
advice about not do inserts with a transaction per row which will have
a lot of overhead for all of the commits.

You can do savepoints inside of a function, but those are going to slow things
down, not speed them up.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux