BUG #15136: gin index not used when using column with a where clause

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15136: gin index not used when using column with a where clause
Дата
Msg-id 152235612063.6316.9977108518874961054@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15136
Logged by:          Improve query planner
Email address:      cdalxndr@yahoo.com
PostgreSQL version: 9.6.0
Operating system:   Windows 10
Description:

Index defined as:
CREATE INDEX product_en_idx
  ON product USING GIN (lexeme)
  WHERE language = 'en' :: REGCONFIG;

Column product.lexeme is of type tsvector, and product.language is
regconfig.

The following query doesn't use this index:
select count(*) from product p 
where p.lexeme @@ plainto_tsquery(p.language, 'text') and p.language =
'en'::regconfig

But this one does:
select count(*) from product p 
where p.lexeme @@ plainto_tsquery('en'::regconfig, 'text') and p.language =
'en'::regconfig

As language is restricted in the 'where' clause, both queries should use the
index.


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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15135: Feature-Request: extend error-message if value is too long
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15137: X509 auth breaks in CA has extendedKeyUsage