GIN index operator ?(jsonb,text) not working?

Поиск
Список
Период
Сортировка
От jian he
Тема GIN index operator ?(jsonb,text) not working?
Дата
Msg-id CACJufxFcjss=F99XVA1o458XTVqfSWJcAJyTmp+E3UQcnx35bw@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi,

---
create  table test101 (  doc_id bigserial, document jsonb);
insert into test101(document) values ('{"user_removed" :false}') returning *;
insert into  test101(document)  select '{"user_removed" :false}'::jsonb from generate_series(1,10000);
insert into  test101(document)  select ('{"user_remove"  :false, "test":' || i ||'}'::text)::jsonb
                                from generate_series(1,400) i;

CREATE INDEX test101_gin_user_removed_na ON test101 USING GIN (document jsonb_ops)
    where (document ? 'user_removed') is false;
CREATE INDEX test101_gin_user_removed_na_b ON test101(document)
    where (document ? 'user_removed') is false;

Since 400 is very few percent compared to 10000. 
but the following query will not use any of the indexes.
    explain (analyze)  select * from test101 where  document ? 'user_removed' is false ;



--
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian


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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: help for pg_wal issue
Следующее
От: Karl Denninger
Дата:
Сообщение: Re: Libpq question related to allocated resources