Re: WTF with hash index?

2018-11-16 Thread Stephen Frost
Greetings, * Олег Самойлов (spl...@ya.ru) wrote: > Ah, thanks. I am not a developer of PostgreSQL. I am a developer in > PostgreSQL. :) And I see two hash indexes on the same data and one of them 43 > times bigger then other, this looked like something terribly wrong. Just free > idea how to

Re: WTF with hash index?

2018-11-14 Thread Олег Самойлов
Ah, thanks. I am not a developer of PostgreSQL. I am a developer in PostgreSQL. :) And I see two hash indexes on the same data and one of them 43 times bigger then other, this looked like something terribly wrong. Just free idea how to considerably improve your product. > 13 нояб. 2018 г., в

Re: WTF with hash index?

2018-11-13 Thread Alvaro Herrera
On 2018-Nov-13, Олег Самойлов wrote: > Very much better. What about to copy paste algorithm from > gin(jsonb_path_ops) to the hash index? You're welcome to submit patches. -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training &

Re: WTF with hash index?

2018-11-13 Thread Олег Самойлов
I am just doing experiment what a type a most suitable for enumeration in PostgreSQL. And what index. And this effect looked for me very strange. There is in the PostgreSQL one another hash index. This is gin(jsonb_path_ops) for the jsob type. It is also use hash internally, but it is much

Re: WTF with hash index?

2018-11-13 Thread Andreas Kretschmer
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,

Re: WTF with hash index?

2018-11-13 Thread Andreas Kretschmer
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?

Re: WTF with hash index?

2018-11-13 Thread 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;

Re: WTF with hash index?

2018-11-13 Thread Laurenz Albe
Олег Самойлов wrote: > \set table_size 100 > begin; > create table gender (gender varchar); > > 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

WTF with hash index?

2018-11-13 Thread Олег Самойлов
CentOS 7 $ rpm -q postgresql10 postgresql10-10.6-1PGDG.rhel7.x86_64 SQL script for psql: \set table_size 100 begin; create table gender (gender varchar); insert into gender (gender) select case when random<0.50 then 'female' when random<0.99 then 'male' else 'other' end from (select