Re: Slow alter sequence with PG10.1 - Mailing list pgsql-general

From David G. Johnston
Subject Re: Slow alter sequence with PG10.1
Date
Msg-id CAKFQuwYxR=tQGJOQk_wKLUadh4wme1s8Kbk9qipxAo_Abt32-A@mail.gmail.com
Whole thread Raw
In response to Re: Slow alter sequence with PG10.1  (Michael Krüger <michael@kruegers.email>)
Responses Re: Slow alter sequence with PG10.1  (Kenneth Marshall <ktm@rice.edu>)
List pgsql-general
On Mon, Jan 22, 2018 at 3:47 PM, Michael Krüger <michael@kruegers.email> wrote:

Is there any drawback to use setval compared to the ALTER SEQUENCE which I have used before? If not, then this could be the work around to go with as it has a similar performance to the original function. 

​Not that I can think of.
I guess - the reason I'm a bit disappointed from the new behavior is that we have used Postgresql for more than 10 years and it has never let us down. We have been able to improve our product with every new release of Postgres. This is the first time for me that a new release of Postgres caused some severe headaches among our customers.

OK...but I am not surprised as to how this played out.  The system doesn't expect ALTER SEQUENCE to be executed frequently and your example doesn't argue for it since setval is indeed provided and can handle the situation where you wish to skip to some other sequence number for subsequent calls.

Disruption of existing code is unavoidable since two of the goals of this project are innovation and stability.  That your customers discovered this particular instance of disruption is more on you than the project - major upgrades, especially the first few patch releases, don't end up seeing a wide variety of unusual setups (like this one) until they hit production since, as it seems here, people with those unusual setups are not putting it through its paces during the beta release period.

David J.

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Slow alter sequence with PG10.1
Next
From: Kenneth Marshall
Date:
Subject: Re: Slow alter sequence with PG10.1