Re: Partitioned tables and covering indexes

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: Partitioned tables and covering indexes
Дата
Msg-id 48893c03-d1c8-62ef-b37d-b2f7dbdb8245@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Partitioned tables and covering indexes  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Ответы Re: Partitioned tables and covering indexes  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Список pgsql-hackers
On 2018/04/10 16:07, Jaime Casanova wrote:
> Hi,
> 
> Trying covering indexes on partitioned tables i get this error
> """
> postgres=# create index on t1_part (i) include (t);
> ERROR:  cache lookup failed for opclass 0
> """
> 
> To reproduce:
> 
> create table t1_part (i int, t text) partition by hash (i);
> create table t1_part_0 partition of t1_part for values with (modulus
> 2, remainder 0);
> create table t1_part_1 partition of t1_part for values with (modulus
> 2, remainder 1);
> insert into t1_part values (1, repeat('abcdefquerty', 20));
> 
> create index on t1_part (i) include (t);

It seems that the bug is caused due to the original IndexStmt that
DefineIndex receives being overwritten when processing the INCLUDE
columns.  Also, the original copy of it should be used when recursing for
defining the index in partitions.

Does the attached fix look correct?  Haven't checked the fix with ATTACH
PARTITION though.

Maybe add this to open items list?

Thanks,
Amit

Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Следующее
От: Devrim Gündüz
Дата:
Сообщение: submake-errcodes