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 1hB4eB-0001cq-UV for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2019 21:39:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hB4eA-000101-GI for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2019 21:39:14 +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 1hB4eA-0000wz-4K for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2019 21:39:14 +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 1hB4e7-0006S8-OR for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2019 21:39:12 +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 x31Ld536019056; Mon, 1 Apr 2019 17:39:05 -0400 From: Tom Lane To: Fabien COELHO cc: Tomas Vondra , Georgios Kokolatos , PostgreSQL Developers Subject: Re: CPU costs of random_zipfian in pgbench In-reply-to: References: <155246731010.16480.15850913449923768119.pgcf@coridan.postgresql.org> <3703.1553360483@sss.pgh.pa.us> <010a884f-8ffc-4cb7-9773-fd05f32ef4cc@2ndquadrant.com> <29040.1553452066@sss.pgh.pa.us> Comments: In-reply-to Fabien COELHO message dated "Sun, 24 Mar 2019 21:21:45 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19054.1554154745.1@sss.pgh.pa.us> Date: Mon, 01 Apr 2019 17:39:05 -0400 Message-ID: <19055.1554154745@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fabien COELHO writes: >> I was wondering about that too. It seems like it'd be a wise idea to >> further constrain s and/or n to ensure that the s > 1 code path doesn't do >> anything too awful ... > Yep. The attached version enforces s >= 1.001, which avoids the worse cost > of iterating, according to my small tests. Seems reasonable. Pushed with minor documentation editing. regards, tom lane