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 1h7k1d-0008F4-Pw for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Mar 2019 17:01:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7k1b-0007BQ-V7 for pgsql-hackers@arkaria.postgresql.org; Sat, 23 Mar 2019 17:01:39 +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 1h7k1b-00078x-N4 for pgsql-hackers@lists.postgresql.org; Sat, 23 Mar 2019 17:01:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7k1V-00058c-1Y for pgsql-hackers@lists.postgresql.org; Sat, 23 Mar 2019 17:01:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2NH1NfT003704; Sat, 23 Mar 2019 13:01:24 -0400 From: Tom Lane To: Fabien COELHO cc: Georgios Kokolatos , PostgreSQL Developers , Fabien Coelho Subject: Re: CPU costs of random_zipfian in pgbench In-reply-to: References: <155246731010.16480.15850913449923768119.pgcf@coridan.postgresql.org> Comments: In-reply-to Fabien COELHO message dated "Wed, 13 Mar 2019 10:49:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3702.1553360483.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 23 Mar 2019 13:01:23 -0400 Message-ID: <3703.1553360483@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: > [ pgbench-zipf-doc-3.patch ] I started to look through this, and the more I looked the more unhappy I got that we're having this discussion at all. The zipfian support in pgbench is seriously over-engineered and under-documented. As an example, I was flabbergasted to find out that the end-of-run summary statistics now include this: /* Report zipfian cache overflow */ for (i =3D 0; i < nthreads; i++) { totalCacheOverflows +=3D threads[i].zipf_cache.overflowCount; } if (totalCacheOverflows > 0) { printf("zipfian cache array overflowed %d time(s)\n", totalCacheOv= erflows); } What is the point of that, and if there is a point, why is it nowhere mentioned in pgbench.sgml? What would a user do with this information, and how would they know what to do? I remain of the opinion that we ought to simply rip out support for zipfian with s < 1. It's not useful for benchmarking purposes to have a random-number function with such poor computational properties. I think leaving it in there is just a foot-gun: we'd be a lot better off throwing an error that tells people to use some other distribution. Or if we do leave it in there, we for sure have to have documentation that *actually* explains how to use it, which this patch still doesn't. There's nothing suggesting that you'd better not use a large number of different (n,s) combinations. regards, tom lane