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 1hovVa-000232-Ea for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 19:59:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hovVZ-0000dY-9r for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2019 19:59:05 +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 1hovVZ-0000dR-11 for pgsql-hackers@lists.postgresql.org; Sat, 20 Jul 2019 19:59:05 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hovVV-0002sx-9Y for pgsql-hackers@postgresql.org; Sat, 20 Jul 2019 19:59:04 +0000 Received: by mail-pl1-x641.google.com with SMTP id az7so17214659plb.5 for ; Sat, 20 Jul 2019 12:59:00 -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=PdzXp9/BAasbq7tQHjBts2sCjjmk/4QjJR7G0nfrkEE=; b=SgD/0nMNQS4h3QnX6NIZrc63CaRMywwTUJlu+ZDZQujlg1QWlAa1ypryycwfE7q3HT 9z46mIXnaY4eAE1uRVvTdyP1BuYdVF5xLNVv/jH1R9Lw29g8CpiHesSN8W7pCJdp91OC 5cFEceiMkDpzZjHLySbYtRpCYlngnk7+h/Jec= 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=PdzXp9/BAasbq7tQHjBts2sCjjmk/4QjJR7G0nfrkEE=; b=H1Hkoz6imBsTR9eYMEGt9V3LCAf5gPQM/1kwoE2yo1Z+STAfyrRSBGWkKYWd2x99GL u5+BaWbgduV/w1R6o4mlUTC3YRFeueg8oSI8CuE9RNUSCGcYSDktfhuYLBD1XYI9bbgJ CMLscxQUhsm67yK5vAHv9ONkDV9tZD14arWiYLB7XMZLkAvndgzviRbehu8ps/sbU0ua 5PxPerQxAxsOPT0cktsbpEzK42tzLfcyBwxWrsLlWd6kTOLgvJx+XYpIejVXwW9wHo/B vPDXATFpurRKmSyJ6Fj6wwP2qM98yLEhGxb6a6RqJZlRDTZtFrjKmpfI34Difk3hSnDp EJUQ== X-Gm-Message-State: APjAAAUMFVYNCxm9QATABXt7zEvcbRBRCfBBpw7nTVpKOws79w1F768O tRJa7E+2lfFxdIZFtu4N6kY= X-Google-Smtp-Source: APXvYqxi2SbXTQ4LMdkvJ5aTNyPeylFnPtKYAloiZdLev+9gicV0Po2Nb6P8YYqxNcKk2MmZQvzQcg== X-Received: by 2002:a17:902:467:: with SMTP id 94mr64256193ple.131.1563652737910; Sat, 20 Jul 2019 12:58:57 -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 q144sm34861925pfc.103.2019.07.20.12.58.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jul 2019 12:58:57 -0700 (PDT) Date: Sat, 20 Jul 2019 12:58:55 -0700 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org Subject: Re: [RFC] Removing "magic" oids Message-ID: <20190720195855.GC1865623@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> <20190720182152.GB1865623@rfd.leadboat.com> <20190720195634.qgomnrssru7iw74y@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190720195634.qgomnrssru7iw74y@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 Sat, Jul 20, 2019 at 12:56:34PM -0700, Andres Freund wrote: > 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? https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=8a0cbb88524e8b6121597285b811640ee793b3e8