Re: Guidance on INSERT RETURNING order

From: "Mike Bayer" <mike_mp(at)zzzcomputing(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Guidance on INSERT RETURNING order
Date: 2023-04-13 01:27:06
Message-ID: 86f9eae7-acd6-45e7-b8a6-2a24b42fe306@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We do something different for uuids. These are usually created client side anyway or are very easy to create client side if not and then we also have a separate sentinel column option.

Overall the whole thing is an optimization that can be turned off for uncommon cases. We just can't go back to having insert of 1000 rows be 3-5x slower for all tables w server generated primary keys which is what statement at a time gets us. Surrogate integer Pks w sequence or identity is the big case.

On Wed, Apr 12, 2023, at 8:58 PM, Thorsten Glaser wrote:
> On Wed, 12 Apr 2023, Mike Bayer wrote:
>
>>ascending values for "mytable_id_seq" will correspond to the ascending
>>values for "num".
>
> But, again, what if it’s uuid or something instead of a sequence?
>
> bye,
> //mirabilos
> --
> 15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2023-04-13 02:23:04 Re: [E] Re: parallel aggregation
Previous Message Adrian Klaver 2023-04-13 00:59:55 Re: Guidance on INSERT RETURNING order