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 1qJatL-0004GA-IH for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jul 2023 14:32:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qJasM-0008EB-4B for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jul 2023 14:31:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJaqa-00041P-AF for pgsql-hackers@lists.postgresql.org; Wed, 12 Jul 2023 14:29:40 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qJaqW-0000ix-Kk for pgsql-hackers@postgresql.org; Wed, 12 Jul 2023 14:29:39 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1a1fa977667so6232453fac.1 for ; Wed, 12 Jul 2023 07:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1689172177; x=1691764177; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9BOZjxH+oHIe9fNPnBZrIHgrSKq8ICEQh7Rb+R5YN7A=; b=pnm+l7hsDeSv2o7BueQMV/qkJIda6eGT68/iVteXOII5nNgnWQgcu7HCaQDvgsdXeb TXpQl915eTc9L/t3x/P2SenCO1eNblpAJtEbdoJeaxtfjPnHK6aKlUTVPWot0HzRdbJF fQHlmruY8t1Tz3maQUVo8kriSkoY76y2sTSCij16rQQuoHjxJcO5ux+oxhtfGzauPZyA VD66a9NQFchknrQ8O0CgXoUM7CrYYrIuZxDONmGE9VUmxPl+rVfn9bm2bulyrK8o7pgw 4MmN3kQ6Bm2rokCdejwDzZSus2CLPl3xopzKlHd91TGm2s67RRN+T69QME0WiMQXkOwA +oDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689172177; x=1691764177; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9BOZjxH+oHIe9fNPnBZrIHgrSKq8ICEQh7Rb+R5YN7A=; b=UDDmw5Q06NX06dRY935e40kiniDWXE0JEi4vBiWO1hGICFBtTychUaUtsbNyUSCPnm G1I3qq4vagDzjReQA9ZpilalcGQecc+dWFG4QkmYZYEKm13aIVpHFyk3eE8t/7ZU9KIJ ajArEJd9nbYyT6vOPeeo7nGgGgeeIBDhx6ur9J1a+Qn1WWgPMchlJiCqX+EK6s6qpE0G 8tKx/rUfbU5xzPiqZVUnvYGKiPyeLLSPOpc3tRfWBHTdiDsguXyIs518g1NVVqTLN8oi NlUuT2lEEOJ5mXTL/1aMpawL0lOnCToeULunX3rJ+UCFa8mz56KlgMnpWxt/AA+R248P rgfQ== X-Gm-Message-State: ABy/qLZrNplibFZdcdRHNZBePU7U9VjlP85hsWD8DN2Ab6wuW7FOSYkr zdVaZCb4LMZIWc8TBRJtK6mW8c0FZ13Wk51hn3xhpg== X-Google-Smtp-Source: APBJJlHThOkH/M0DSAABI5ibKzIl/CeYCaCwoXTtg+pn824gIURO6YVe8FbqfUtpqNeSqhWXeardUA== X-Received: by 2002:a05:6870:b619:b0:1b7:3432:9ec4 with SMTP id cm25-20020a056870b61900b001b734329ec4mr9987646oab.10.1689172176860; Wed, 12 Jul 2023 07:29:36 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id a21-20020a056870b31500b001b03fbfa0c5sm2041447oao.39.2023.07.12.07.29.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jul 2023 07:29:36 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 12 Jul 2023 09:29:35 -0500 Message-Id: Cc: Subject: Re: Use COPY for populating all pgbench tables To: "Michael Paquier" From: "Tristan Partin" X-Mailer: aerc 0.15.2-84-g9a3ccd9a95db References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed Jul 12, 2023 at 1:06 AM CDT, Michael Paquier wrote: > On Tue, Jul 11, 2023 at 09:46:43AM -0500, Tristan Partin wrote: > > On Tue Jul 11, 2023 at 12:03 AM CDT, Michael Paquier wrote: > >> This seems a bit incorrect because partitioning only applies to > >> pgbench_accounts, no? This change means that the teller and branch > >> tables would not benefit from FREEZE under a pgbench compiled with > >> this patch and a backend version of 14 or newer if --partitions is > >> used. So, perhaps "partitions" should be an argument of > >> initPopulateTable() specified for each table?=20 > >=20 > > Whoops, looks like I didn't read the comment for what the partitions > > variable means. It only applies to pgbench_accounts as you said. I don'= t > > think passing it in as an argument would make much sense. Let me know > > what you think about the change in this new version, which only hits th= e > > first portion of the `if` statement if the table is pgbench_accounts. > > - /* use COPY with FREEZE on v14 and later without partitioning */ > - if (partitions =3D=3D 0 && PQserverVersion(con) >=3D 140000) > - copy_statement =3D "copy pgbench_accounts from stdin with (freeze= on)"; > + if (partitions =3D=3D 0 && strcmp(table, "pgbench_accounts") =3D=3D 0= && PQserverVersion(con) >=3D 140000) > + copy_statement_fmt =3D "copy %s from stdin with (freeze on)"; > > This would use the freeze option only on pgbench_accounts when no > partitioning is defined, but my point was a bit different. We could > use the FREEZE option on the teller and branch tables as well, no? > Okay, the impact is limited compared to accounts in terms of amount of > data loaded, but perhaps some people like playing with large scaling > factors where this could show a benefit in the initial data loading. Perhaps, should they all be keyed off the same option? Seemed like in your previous comment you wanted multiple options. Sorry for not reading your comment correctly. > In passing, I have noticed the following sentence in pgbench.sgml: > Using g causes logging to print one message > every 100,000 rows while generating data for the =20 > pgbench_accounts table. > It would become incorrect as the same code path would be used for the > teller and branch tables. I will amend the documentation to mention all tables rather than being specific to pgbench_accounts in the next patch revision pending what you want to do about the partition CLI argument. --=20 Tristan Partin Neon (https://neon.tech)