Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hovTN-0001zC-CO for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 19:56:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hovTJ-0003MS-Lw for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 19:56:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hovTH-0003DP-DH for pgsql-hackers@lists.postgresql.org; Sat, 20 Jul 2019 19:56:45 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hovTD-0002rE-CU for pgsql-hackers@postgresql.org; Sat, 20 Jul 2019 19:56:42 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C3D5121C0F; Sat, 20 Jul 2019 15:56:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 20 Jul 2019 15:56:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=2uBFoDKgYVqvkqgKNywuIXU8dHG /aiZfhVQtNJmkUxg=; b=mwxMK5XN016ZKWw7RsI097nVu49EXeVDLjJR8bSLakk 2HrDr5hdnmiLTzvDdgiL4fIKjp+h7F/iwstZXWGYwKe3PiGFlhOiKZPG7Ol+wWp4 wYbdsz+R6qzRm5PNtJ6MATrDvbVHJ9c9GVF1pFaOV6cAYWBBx+7lO4w4ycLNHK5v aQXgwJQB6zf8frkMlHrQ6LjuT/1yqK8XI/8FD7sBSukp/R2rCHQAeiGb/9XiaY+q pkOY8FAVYGw4O0BszJdEfCctOc/9Gc7q9OdnII0QFhkBXd2tVb1h3Ay4TrD9mneO edVZORd9AQTmOQZEiaZIR/NRW8y0WHQnuqPTImgC1BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=2uBFoD KgYVqvkqgKNywuIXU8dHG/aiZfhVQtNJmkUxg=; b=fqWpPbPE+izRmtmiyCukjn arQxOSqL5UIpMF9NJsv28P7fpnmVyZ0Goof1VZf4vZfXX4VfwjRxj0fIygE3CmS4 kzhihYhrAeVIMflHZ5AuL4zf+wf84jaqDw2pOlItVzLNTjfEGOXZF/nSHKJDk2JU iD2LKtAoF1c+1+YLdiZaJZzea4Eez1s189WsQ3AQohyPgSXBIzAWrm37jCc0+sXn 32dVRNPcmSDCtqXBRFlodwQ+m2X7557Vk1c3j7mFMG25xqn6WHCvFfgAB/BmmvKv 2x5XYbpq+by4Elmks9fM46cBHNZ0I9IB4BN8/TEPWrLgdyjTiRXYyjGnuDepJ3JA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrieelgddugeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepie ejrdduiedtrddvudekrddvfeejnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E50D8005C; Sat, 20 Jul 2019 15:56:36 -0400 (EDT) Date: Sat, 20 Jul 2019 12:56:34 -0700 From: Andres Freund To: Noah Misch Cc: pgsql-hackers@postgresql.org Subject: Re: [RFC] Removing "magic" oids Message-ID: <20190720195634.qgomnrssru7iw74y@alap3.anarazel.de> References: <20180930034810.ywp2c7awz7opzcfr@alap3.anarazel.de> <20181114080152.xkk6coduvfrh4ntr@alap3.anarazel.de> <20181115045728.GA1121738@rfd.leadboat.com> <20181115050241.exereob7wk3xxewj@alap3.anarazel.de> <20181120092004.f3j2znfodallkksn@alap3.anarazel.de> <20190707170035.GA1485546@rfd.leadboat.com> <20190719171257.urgz76ob753ygxmd@alap3.anarazel.de> <20190720182152.GB1865623@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190720182152.GB1865623@rfd.leadboat.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-07-20 11:21:52 -0700, Noah Misch wrote: > On Fri, Jul 19, 2019 at 10:12:57AM -0700, Andres Freund wrote: > > On 2019-07-07 10:00:35 -0700, Noah Misch wrote: > > > +# Test concurrent OID generation via pg_enum_oid_index. This indirectly > > > +# exercises LWLock and spinlock concurrency. > > > +my $labels = join ',', map { "'l$_'" } 1 .. 1000; > > > pgbench( > > > '--no-vacuum --client=5 --protocol=prepared --transactions=25', > > > 0, > > > [qr{processed: 125/125}], > > > [qr{^$}], > > > - 'concurrent insert workload', > > > + 'concurrent OID generation', > > > { > > > '001_pgbench_concurrent_insert' => > > > - 'INSERT INTO insert_tbl SELECT FROM generate_series(1,1000);' > > > + "CREATE TYPE pg_temp.e AS ENUM ($labels); DROP TYPE pg_temp.e;" > > > }); > > > > Hm, perhaps we should just do something stupid an insert into a catalog > > table, determining the oid to insert with pg_nextoid? That ought to be a > > lot faster and thus more "stress testing" than going through a full > > blown DDL statement? But perhaps that's just too ugly. > > I expect the pg_nextoid strategy could have sufficed. The ENUM strategy > wastes some time parsing 1000 label names, discarding odd-numbered OIDs, and > dropping the type. The pg_nextoid strategy wastes time by performing the > insertion loop in the executor instead of dedicated C code of > EnumValuesCreate(). Hard to say how to weight those factors. Fair enough. Are you planning to commit your changes? Greetings, Andres Freund