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:12:40 -0600
Message-ID: <6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com> (raw)
In-Reply-To: <425df8ed-d3d1-ead4-06db-224446ded1f3@a-kretschmer.de>
References: <A841C4BC-A878-497E-AD9B-4DE0830DCC68@ya.ru>
	<425df8ed-d3d1-ead4-06db-224446ded1f3@a-kretschmer.de>

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?

-- 
Angular momentum makes the world go 'round.




view thread (10+ messages)  latest in thread

Message-ID: <6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com>
Permalink:  ../6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com/
Also on:    postgresql.org/message-id/6bc22d13-42a5-db93-fc69-78e0eab23c8b@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: <6bc22d13-42a5-db93-fc69-78e0eab23c8b@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>

* 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