Re: WTF with hash index?

Поиск
Список
Период
Сортировка
От Ron
Тема Re: WTF with hash index?
Дата
Msg-id 31423fac-9186-f17c-0601-9f0934d4b14c@gmail.com
обсуждение исходный текст
Ответ на Re: WTF with hash index?  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: WTF with hash index?
Следующее
От: Олег Самойлов
Дата:
Сообщение: Re: WTF with hash index?