From: Andreas Kretschmer <andreas@a-kretschmer.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: WTF with hash index?
Date: Tue, 13 Nov 2018 19:39:17 +0100
Message-ID: <f3d155d3-ede5-44da-a472-ef47abe20b2a@a-kretschmer.de> (raw)
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>
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
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: andreas@a-kretschmer.de
Subject: Re: WTF with hash index?
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>
* 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