pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: WTF with hash index?
Date: Tue, 13 Nov 2018 12:47:32 -0600
Message-ID: <31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com> (raw)
In-Reply-To: <f3d155d3-ede5-44da-a472-ef47abe20b2a@a-kretschmer.de>
References: <A841C4BC-A878-497E-AD9B-4DE0830DCC68@ya.ru>
	<425df8ed-d3d1-ead4-06db-224446ded1f3@a-kretschmer.de>
	<6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com>
	<f3d155d3-ede5-44da-a472-ef47abe20b2a@a-kretschmer.de>

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.




view thread (10+ messages)  latest in thread

Message-ID: <31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com>
Permalink:  ../31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com/
Also on:    postgresql.org/message-id/31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: WTF with hash index?
  In-Reply-To: <31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com>
  References: <A841C4BC-A878-497E-AD9B-4DE0830DCC68@ya.ru> <425df8ed-d3d1-ead4-06db-224446ded1f3@a-kretschmer.de> <6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com> <f3d155d3-ede5-44da-a472-ef47abe20b2a@a-kretschmer.de> <31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox