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 1hotzf-0006LK-Kc for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 18:22:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hotze-0005lk-AJ for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 18:22:02 +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 1hotzd-0005fN-OP for pgsql-hackers@lists.postgresql.org; Sat, 20 Jul 2019 18:22:02 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hotza-0001wt-Mu for pgsql-hackers@postgresql.org; Sat, 20 Jul 2019 18:22:00 +0000 Received: by mail-pf1-x441.google.com with SMTP id q10so15518078pff.9 for ; Sat, 20 Jul 2019 11:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+xudoduoQRCsX97EerOFmpI6kG9NESEG+O8LTc8wVa4=; b=HbDwWxQFm39a08mlGsU9QIVQLMnIHLROoQ8PfybZm98Vny8Ois1J58vRf7ZvvD2lA9 Sw7PsYtz6HjipFTi4l3IXL1hF8jMcnyd/0NBUGpDi8XfIavG5fDssr0+b+UPo3KJ1u50 mN/5AcfdAl/+apHWmQI2+ndMOHjXPSIyTAhJg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+xudoduoQRCsX97EerOFmpI6kG9NESEG+O8LTc8wVa4=; b=a584UWFgJkBaRJZPebR8k8a0rLNbvXdySqB3faJVaanYr3UMu1x01AIirCEX3ApUbC l7lc8Po3++aQkjel47rrUdsDZ5fIVH+VoeJpnZ4E4hgOg3kfimMpF9+8qXZC8U0RVRt4 +8bmm3AluWgj3RpSFIDNhNZjn0llkRMP5M0+dS4l0N+qkzYZwRdf1O6SZrOWmBKcoNax JnmR+arstysaf0w/R1N7AKkVt4gN4KateQWq8b/ATlnOson6NIVPDXmSnW4bihqldGXR o4rXhzGjlRFabwBhX7CJEP5FJzJAH6Iz3BawBW/l7ejtiZRMQGrxle5mtBVAiinwZ+AR xZgQ== X-Gm-Message-State: APjAAAVZU/6NLeDpwLw4KQ4FRmrkXJBcIfoCp8DZU2SarTASa9MGlxzH UeskGICa5abZYpCGM8u0/+E= X-Google-Smtp-Source: APXvYqyvUvThKGyfr+odXTOmfD0wq8h1CVAeMKatvHG08JHneB7nBj3XuyANyDo8ByJRgUcezWKaIA== X-Received: by 2002:a17:90a:898e:: with SMTP id v14mr65390734pjn.119.1563646915900; Sat, 20 Jul 2019 11:21:55 -0700 (PDT) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id g4sm46142994pfo.93.2019.07.20.11.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jul 2019 11:21:54 -0700 (PDT) Date: Sat, 20 Jul 2019 11:21:52 -0700 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org Subject: Re: [RFC] Removing "magic" oids Message-ID: <20190720182152.GB1865623@rfd.leadboat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190719171257.urgz76ob753ygxmd@alap3.anarazel.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.