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 1gvP0a-0000zd-HP for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Feb 2019 16:09:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvP0Z-0007Zp-BL for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Feb 2019 16:09:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvP0Z-0007Zi-1B for pgsql-hackers@lists.postgresql.org; Sun, 17 Feb 2019 16:09:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gvP0W-0002uu-KQ for pgsql-hackers@postgresql.org; Sun, 17 Feb 2019 16:09:33 +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 x1HG9RKb006066; Sun, 17 Feb 2019 11:09:28 -0500 From: Tom Lane To: Fabien COELHO cc: Tomas Vondra , PostgreSQL Hackers Subject: Re: CPU costs of random_zipfian in pgbench In-reply-to: References: Comments: In-reply-to Fabien COELHO message dated "Sun, 17 Feb 2019 09:51:59 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6064.1550419767.1@sss.pgh.pa.us> Date: Sun, 17 Feb 2019 11:09:27 -0500 Message-ID: <6065.1550419767@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: >> I'm trying to use random_zipfian() for benchmarking of skewed data sets, >> and I ran head-first into an issue with rather excessive CPU costs. > If you want skewed but not especially zipfian, use exponential which is > quite cheap. Also zipfian with a > 1.0 parameter does not have to compute > the harmonic number, so it depends in the parameter. Maybe we should drop support for parameter values < 1.0, then. The idea that pgbench is doing something so expensive as to require caching seems flat-out insane from here. That cannot be seen as anything but a foot-gun for unwary users. Under what circumstances would an informed user use that random distribution rather than another far-cheaper-to-compute one? > ... This is why I submitted a pseudo-random permutation > function, which alas does not get much momentum from committers. TBH, I think pgbench is now much too complex; it does not need more features, especially not ones that need large caveats in the docs. (What exactly is the point of having zipfian at all?) regards, tom lane