Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How much memory does a single savepoint (within a transaction) take up in postgresql? I'm developing an application which might create a significant amount of savepoints (100k+) and was wondering about the performance penalty.

share|improve this question
up vote 1 down vote accepted

As far as I know they are very cheap, just like transactions are in general. But I have never tried creating 100k of them.

You should be aware that there is a limit on the size of a transaction (at most 2^32-1 commands, if I recall correctly) which it sounds like you are getting close to hitting with your design. In general, I would probably consider a design with hundreds of thousands of save-points flawed.

share|improve this answer

I think this is best answered by trying it out in your particular application. It's not much per individual savepoints, but when you are talking 100k+, the effects will accumulate and other factors can come into play as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.