Re: WTF with hash index? - Mailing list pgsql-general

From Ron
Subject Re: WTF with hash index?
Date
Msg-id 6bc22d13-42a5-db93-fc69-78e0eab23c8b@gmail.com
Whole thread Raw
In response to WTF with hash index?  (Олег Самойлов <splarv@ya.ru>)
Responses Re: WTF with hash index?
List pgsql-general
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.


pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: WTF with hash index?
Next
From: Andreas Kretschmer
Date:
Subject: Re: WTF with hash index?