Partial hash index is not used for implied qual.

Поиск
Список
Период
Сортировка
От Sergei Glukhov
Тема Partial hash index is not used for implied qual.
Дата
Msg-id e200bf38-6b45-446a-83fd-48617211feff@postgrespro.ru
обсуждение исходный текст
Ответы Re: Partial hash index is not used for implied qual.
Список pgsql-hackers
Hi!

Partial hash index is not used if qual is an implied qual
since this qual is not added to indrestrictinfo and we cannot
get the keys needed to make hash index scan possible.
Suggested fix is to add implied qual for the indexes
which requires the presence of a key to scan the index.

How to repeat:

CREATE TABLE hash_partial(x) AS
        SELECT x as y from generate_series(1, 1000) as x;
ANALYZE hash_partial;
CREATE INDEX partial_idx ON hash_partial USING hash(x) WHERE x = 1;
EXPLAIN (COSTS OFF) SELECT x FROM hash_partial WHERE x = 1;
...
          QUERY PLAN
--------------------------
  Seq Scan on hash_partial
    Filter: (x = 1)
  ...

  Regards,
  Sergei Glukhov


Вложения

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