Re: WIP: Covering + unique indexes.

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: WIP: Covering + unique indexes.
Дата
Msg-id CAMkU=1zAr_jDAEk8QoxaMbGM=mdjbqGnhJqJzL+s1tVs5yREpQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: Covering + unique indexes.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Ответы Re: WIP: Covering + unique indexes.  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Список pgsql-hackers
On Thu, Feb 11, 2016 at 8:46 AM, Anastasia Lubennikova
<a.lubennikova@postgrespro.ru> wrote:
> 02.02.2016 15:50, Anastasia Lubennikova:

>
> As promised, here's the new version of the patch "including_columns_4.0".
> I fixed all issues except some points mentioned below.

Thanks for the update patch.  I get a compiler warning:

genam.c: In function 'BuildIndexValueDescription':
genam.c:259: warning: unused variable 'tupdesc'

Also, I can't create a primary key INCLUDING columns directly:

jjanes=# create table foobar (a int, b int, c int);
jjanes=# alter table foobar add constraint foobar_pkey primary key
(a,b) including (c);
ERROR:  syntax error at or near "including"

But I can get there using a circuitous route:

jjanes=# create unique index on foobar (a,b) including (c);
jjanes=# alter table foobar add constraint foobar_pkey primary key
using index foobar_a_b_c_idx;

The description of the table's index knows to include the including column:

jjanes=# \d foobar   Table "public.foobar"Column |  Type   | Modifiers
--------+---------+-----------a      | integer | not nullb      | integer | not nullc      | integer |
Indexes:   "foobar_pkey" PRIMARY KEY, btree (a, b) INCLUDING (c)


Since the machinery appears to all be in place to have primary keys
with INCLUDING columns, it would be nice if the syntax for adding
primary keys allowed one to implement them directly.

Is this something or future expansion, or could it be added at the
same time as the main patch?

I think this is something it would be pretty frustrating for the user
to be unable to do right from the start.

Cheers,

Jeff



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Performance degradation in commit 6150a1b0
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: GIN data corruption bug(s) in 9.6devel