Search Postgresql Archives

Re: Trouble with Savepoints in postgres

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

 



sam wrote:

FUNCTION UPDATE ()
BEGIN
 UPDATE statement

 EXCEPTION
END


when one record fails data only for that is rolled back the rest of
the data is saved. EXCEPTION has to be caught.

As I recently found out, too many savepoints really kill PostgreSQL's performance in a transaction. A function inserting/updating, say, 100,000 records will perform OK, but statements run in the same transaction after the function completes will be very slow.

So ... if you find that after your big update statement performance is terrible, you might need to explicitly check the conditions that might result in an exception and skip those records, thus avoiding the EXCEPTION block.

--
Craig Ringer

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

[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