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 1gMdiv-0002Zq-4Y for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 18:47: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 1gMdit-0001sl-H1 for pgsql-general@arkaria.postgresql.org; Tue, 13 Nov 2018 18:47:39 +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 1gMdit-0001sc-5p for pgsql-general@lists.postgresql.org; Tue, 13 Nov 2018 18:47:39 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMdiq-0003W4-TW for pgsql-general@lists.postgresql.org; Tue, 13 Nov 2018 18:47:38 +0000 Received: by mail-oi1-x230.google.com with SMTP id v198-v6so11292039oif.2 for ; Tue, 13 Nov 2018 10:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=iQpDytx4U0tJwQcg/zsLNDpKvYbociyCML9v3RZALGU=; b=elopXIeEIgisMb2Sus+m9lDqRKabrQI+tI4JgCzbLHU/31VMs7SRkMwWkdYDeI58Vh vHE/HvWsWXcKv3N7Osht74YTU4gU4sDfbeTCvBuCiNE/aA9Vq7r/eBbed25vOT2zlJ3X Q61tsQmfhjaE8P5c5I0JOiQb6OSqDhAR6/ZXMTpRFgfOJUuGr5b4wr9wI0XpHBItJknE N2kGkwR9i6OLJoTDmwyXcfe+3waEfbpUxPABU6NXs473pncUphTyfkWMghM4K8vKRmsz fhoPWoRCs+kUpDs+UUkieKs38kXdi1ErFin41V9omkltVjefsI50/UzI2WwytxPZguTZ J8Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=iQpDytx4U0tJwQcg/zsLNDpKvYbociyCML9v3RZALGU=; b=ZgCritQAlDM8nFIU0+5af3uMJS+Q8ewSCkFNZapFZiocPFzqhSWWIAcC29EyzcV+jB 5Bi7tCykSjkIqTt1z/Jg9/QikqaYmGXjhVD8KYyVQVYDlugyyJaXZfg+s3T106dsAGBW iNWr/QYLJf5hZeBXm8WoduISOz+G3jtBaf9F5ZteL04mxv9MyHygaTp13e0qu6n0SCPU wZ5JxYhRaRIAl+DnlpIQ06wBhg0Z/uYxU7HroCNw0AUp29hcOk9W+mdJivTGdKkVvd8d GKPmkzywfFnPtXMJM9knPdEmkGPb6o2qc+QgDizbG/94Z0yGURpj1gHx8YGgV2ciNDEJ qAPg== X-Gm-Message-State: AGRZ1gIUWrmnOQ46cXyv/X2/BEzMqOagGn7/h2Ad6hyE6AeLcVlQO5BU XJvraba6QiFul1gV8B+oJkWWULWT X-Google-Smtp-Source: AJdET5fDgzo1grAkpa0V07s0KXDqZmfnDrpF8pKqOCKR5DowJsyTXaEW+gZMhfOnXWwhNpfjoXVAkA== X-Received: by 2002:aca:c650:: with SMTP id w77mr3366748oif.122.1542134855940; Tue, 13 Nov 2018 10:47:35 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id c58sm14847668otd.34.2018.11.13.10.47.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 10:47:35 -0800 (PST) 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: Ron Message-ID: <31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com> Date: Tue, 13 Nov 2018 12:47:32 -0600 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: 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 On 11/13/2018 12:39 PM, Andreas Kretschmer wrote: > > > 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. I had to read it thrice. :)  It's an example of why I like white space and indenting... -- Angular momentum makes the world go 'round.