Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMK0o-0027qK-44 for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jul 2023 03:07:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qMK0l-00FvKB-DG for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jul 2023 03:07:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMK0j-00FvK3-Sw for pgsql-hackers@lists.postgresql.org; Thu, 20 Jul 2023 03:07:27 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMK0g-000YxX-38 for pgsql-hackers@postgresql.org; Thu, 20 Jul 2023 03:07:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7C3DC320238B; Wed, 19 Jul 2023 23:07:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 19 Jul 2023 23:07:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=1689822440; x=1689908840; bh=UR F/V54QVJ7lOrdooVXFu2BiGI/syzKM6fAaFLXeSTg=; b=PP6iKqGW39whGqpLA8 NcCFqBGDrlHhgZ2keZxdNG+XDT8SVaWW3+LWIAtDG2oATzhCcDf0mqSTcZpe3yGR cXQfbCAFFarTEG/0vSiKMcQbk0Hsdgep56cIyV7rYOLYPSGZKgixMLvvDBpbhWjT z2+kVG0Ym/rrlcYXabdKNd+w4bjGbs9cg1uzqNFc6WzQXWQm5+89mO8ektZDe4rz 0vytgkDXQxx2G2ndMbnyB2lZ3QEu4or2qHzmTP9hrBCPGMnn8IW4FpVE8ilSC2rb SOyKVyaSsSsm4uBdWMrXYzwuSYPTwXJ3tJc8f+X+Q8e1sxRIMy1Hsk68lb/Xj3CL Yk7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1689822440; x=1689908840; bh=URF/V54QVJ7lO rdooVXFu2BiGI/syzKM6fAaFLXeSTg=; b=1Zce4C1ffEEzpp2TSIyXLqDTeKyvF A0f58/dP3J6exyJU5d7sIHbmXwd5+4hiwZktgKT8SKbkYlsNjQuqwALdCLuEcihK cGU6C0+UHu3Mp1kau5jOvr1ufftsTG+JrzNHy47YO7yD9+R0UHvjIQSo/NM8w2NK uyyfgQGD1SGe6MACVtnWyOPAR2yZwV1xBqdqGpaFbGJ59qkGEjmfUf9bKwEUzKsa +yYahBWNDA9S5+evQ/bR5m8hu4YjaQINnVsCuvnAWkxgLeX2JjSU3hhTbdo2o1A9 XCm3JLroXTCWYkTOrudLDHlF1XBjsPRUAAZFLVyYOWC5XzIrLmtmu1t4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeelgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jul 2023 23:07:18 -0400 (EDT) Date: Thu, 20 Jul 2023 12:07:14 +0900 From: Michael Paquier To: Tristan Partin Cc: pgsql-hackers@postgresql.org Subject: Re: Use COPY for populating all pgbench tables Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ms2VOQUA/WdYbRo8" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ms2VOQUA/WdYbRo8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 19, 2023 at 01:03:21PM -0500, Tristan Partin wrote: > Didn't actually include the changes in the previous patch. -initGenerateDataClientSide(PGconn *con) +initBranch(PQExpBufferData *sql, int64 curr) { - PQExpBufferData sql; + /* "filler" column defaults to NULL */ + printfPQExpBuffer(sql, + INT64_FORMAT "\t0\t\n", + curr + 1); +} + +static void +initTeller(PQExpBufferData *sql, int64 curr) +{ + /* "filler" column defaults to NULL */ + printfPQExpBuffer(sql, + INT64_FORMAT "\t" INT64_FORMAT "\t0\t\n", + curr + 1, curr / ntellers + 1); Hmm. Something's not right here, see: =3D# select count(*) has_nulls from pgbench_accounts where filler is null; has_nulls=20 ----------- 0 (1 row) =3D# select count(*) > 0 has_nulls from pgbench_tellers where filler is nul= l; has_nulls=20 ----------- f (1 row) =3D# select count(*) > 0 has_nulls from pgbench_branches where filler is nu= ll; has_nulls=20 ----------- f (1 row) Note as well this comment in initCreateTables(): /* * Note: TPC-B requires at least 100 bytes per row, and the "filler" * fields in these table declarations were intended to comply with that. * The pgbench_accounts table complies with that because the "filler" * column is set to blank-padded empty string. But for all other tables * the columns default to NULL and so don't actually take any space. We * could fix that by giving them non-null default values. However, that * would completely break comparability of pgbench results with prior * versions. Since pgbench has never pretended to be fully TPC-B compli= ant * anyway, we stick with the historical behavior. */ So this patch causes pgbench to not stick with its historical behavior, and the change is incompatible with the comments because the tellers and branches tables don't use NULL for their filler attribute anymore. -- Michael --ms2VOQUA/WdYbRo8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmS4pOIACgkQnvQgOdby QH0O6RAAhS/D6jpvCv6qd23Z7aCj/fJmJ12QK8yKDs1uO83Fj+CEonrTAmeamXaZ FKdka2pQmXBjllx8QOB0MkYgs2zG6NmKRthGVbJz52RvHINrDf8+vdPg+2+sYpEc q7M3Ibijx6kYHIOaH0Dho7DJCPSyHevwq0Jjb5TqS6QEXftIBNVPn1AZORO1Je7d Zxmxmol4QjbwtsyzSCaGIGHl9A0oh96pbD2lOIr93Y3dOi8JA2tXd+gySRAajrde DyMRLgTko/6g5xRdzFTaQxYPK7oc838jMloCqro8PE+r6cviAr9F5vEmtR4jo0iY f5qrA0OMFGh8qS8H7tuNzImAfJcIwDAkitSCkQiFi/Yv/hzeqWj2cvuxqXopKKxG f/7jxI0ZLEBzNjndQEQwQCyJAarSF+eHJZiADvYCBryDP7OBlLXMFXubGMVsOH7g s3fNziHxB11k+Ir0hF2S3PtIhQy4/TtF6LRIaO40gxqRU/Qe79MrofWI2jGlEu4u uYitD1Zf8Qo4zENWtjKS67ozqSB/M7T2TXf32YwJKP4QqHtWybiKld4eEhCViMTE 7l20sZzVRV3KChf9RZzqOgNTuhY8Hz/8gE5koC2D7PJpIBWtPLalC5S4hCIDNVLa jQsBWS5xLJdCl8ZZENl9esDzKcpPXJSvsAtzp1UxCItBQCHRtpk= =CAEI -----END PGP SIGNATURE----- --ms2VOQUA/WdYbRo8--