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 1gMdat-0002AS-VQ for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 18:39:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMdar-0005ji-Rd for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 18:39:21 +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 1gMdar-0005jb-JL for pgsql-general@lists.postgresql.org; Tue, 13 Nov 2018 18:39:21 +0000 Received: from mail.i-mark.de ([188.138.104.222]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMdap-0003n6-P6 for pgsql-general@lists.postgresql.org; Tue, 13 Nov 2018 18:39:21 +0000 Received: from [192.168.178.20] (unknown [185.38.49.17]) by mail.i-mark.de (Postfix) with ESMTPSA id 709FE15802EF for ; Tue, 13 Nov 2018 19:39:14 +0100 (CET) Authentication-Results: loft7616.startdedicated.de; spf=pass (sender IP is 185.38.49.17) smtp.mailfrom=andreas@a-kretschmer.de smtp.helo=[192.168.178.20] Received-SPF: pass (loft7616.startdedicated.de: connection is authenticated) Subject: Re: WTF with hash index? To: pgsql-general@lists.postgresql.org References: <425df8ed-d3d1-ead4-06db-224446ded1f3@a-kretschmer.de> <6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com> From: Andreas Kretschmer Message-ID: Date: Tue, 13 Nov 2018 19:39:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am 13.11.2018 um 19:12 schrieb Ron: > On 11/13/2018 12:07 PM, Andreas Kretschmer wrote: >> >> >> Am 13.11.2018 um 17:42 schrieb Олег Самойлов: >>> insert into gender (gender) select case when random<0.50 then >>> 'female' when random<0.99 then 'male' else 'other' end from (select >>> random() as random, generate_series(1,:table_size)) as subselect; >> >> is that really your intended data distibution? 99% male? > > select case when random<0.50 then 'female' > when random<0.99 then 'male' >             else 'other' end > from (select random() as random, generate_series(1,:table_size)) as > subselect; > > Shouldn't that make 49% male? you are right, my fault :-(. the case - statement will be left if the first condition is true. Regards, Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com