Re: Slow alter sequence with PG10.1

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michael Krüger <michael(at)kruegers(dot)email>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Slow alter sequence with PG10.1
Date: 2018-01-22 23:40:54
Message-ID: CAKFQuwYxR=tQGJOQk_wKLUadh4wme1s8Kbk9qipxAo_Abt32-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 22, 2018 at 3:47 PM, Michael Krüger <michael(at)kruegers(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kenneth Marshall 2018-01-22 23:54:36 Re: Slow alter sequence with PG10.1
Previous Message Peter Eisentraut 2018-01-22 22:51:04 Re: Slow alter sequence with PG10.1