Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmlkM-00070E-JW for pgsql-general@arkaria.postgresql.org; Thu, 13 Apr 2023 01:27:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmlkL-0008Aj-4h for pgsql-general@arkaria.postgresql.org; Thu, 13 Apr 2023 01:27:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmlkK-0008AZ-9L for pgsql-general@lists.postgresql.org; Thu, 13 Apr 2023 01:27:32 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pmlkG-002Y4E-P9 for pgsql-general@lists.postgresql.org; Thu, 13 Apr 2023 01:27:31 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6619D5C007C for ; Wed, 12 Apr 2023 21:27:27 -0400 (EDT) Received: from imap44 ([10.202.2.94]) by compute2.internal (MEProxy); Wed, 12 Apr 2023 21:27:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= zzzcomputing.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1681349247; x=1681435647; bh=9BZi+PXegV TsUoE4JQM/LLzgQgJUYekO0EjyzpQUrMk=; b=puSfXyLsQfhPrdZf/KCejYcAcI g3GCRzakil6w+BVzEAIesbZAFR0SZyjO935Bfd6HvdJjqHGjfO0aw/Ix6kGQG1Rb ss63T8EfZwyVl2N/FAlfnxwL46UmHbhmabnuRLOVkbTnvfNE5B/sRm3eA2yqxvgF QM2oI+LEJXstefIYwutj1CgrwsQ9qOpMRSe6hGq8W8+WtAJBpOzN8iyYXNI8YnWG NMRx+tSW7oo8LOQT5ne8eiIQ7mTPcZfZ88KKe9BRrnERUOqcBLPvdepfuPt377Xx 0Gv7PeINpW3pf24FebQC7E8rpZ0/FJkudzUlMrUjob7lzUsgL6j4NH4EQfnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1681349247; x= 1681435647; bh=9BZi+PXegVTsUoE4JQM/LLzgQgJUYekO0EjyzpQUrMk=; b=Q 3IqkYN84XCBnyR9swOuMFiSeCgGHNKvPtZPDRGuSl0gQd1NU5hB9PpZh/lX7BoPO m9zNKJjcufBUGLKhCtPUS9NU9Xx5friyCcdMUROn0bQwsz7kANTLNMtjjGwuGQhr q+PwL+bUyZB+nXtjU0n70EqIwrMHuDNxNbPDXuhjT+J/jkRryr7keh/mUFFNxsZw 8x7M8y4TRSxSuPgveBTla0KLYkUfpDe41U+z1fLLniHRC2B8MjbOR3c27aeiMAhU Mkdei0E8sucS7HvNUOKJ8yGDM3hae5mk47TzQPzJsLKNdNaMBXmDEw4dVjyaKrql q34tBPfW6cG4Kp7skfiWg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekjedggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtgfesth hqredtreerjeenucfhrhhomhepfdfoihhkvgcuuegrhigvrhdfuceomhhikhgvpghmphes iiiiiigtohhmphhuthhinhhgrdgtohhmqeenucggtffrrghtthgvrhhnpeffkedugffggf etudevfeehueevfedvgedvkeelhffhgfejheffuedvffevtddvfeenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihhkvggpmhhpseiiiiiitg homhhpuhhtihhnghdrtghomh X-ME-Proxy: Feedback-ID: i1c194411:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1D98A36A0075; Wed, 12 Apr 2023 21:27:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-334-g8c072af647-fm-20230330.001-g8c072af6 Mime-Version: 1.0 Message-Id: <86f9eae7-acd6-45e7-b8a6-2a24b42fe306@app.fastmail.com> In-Reply-To: <84746f13-fc7f-9126-12f3-ae5fbd5e6b79@evolvis.org> References: <95fbd8c8-2f7a-38a1-4a41-b2ac3763d89c@aklaver.com> <84746f13-fc7f-9126-12f3-ae5fbd5e6b79@evolvis.org> Date: Wed, 12 Apr 2023 21:27:06 -0400 From: "Mike Bayer" To: pgsql-general@lists.postgresql.org Subject: Re: Guidance on INSERT RETURNING order Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk We do something different for uuids. These are usually created client s= ide anyway or are very easy to create client side if not and then we als= o have a separate sentinel column option.=20 Overall the whole thing is an optimization that can be turned off for un= common 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 identi= ty 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=E2=80=99s uuid or something instead of a sequen= ce? > > bye, > //mirabilos > --=20 > 15:41=E2=8E=9C Somebody write a testsuite for = helloworld :-)