Re: Can we add syntax for references auto create index or not.

From: digoal zhou <digoal(dot)zhou(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can we add syntax for references auto create index or not.
Date: 2015-05-28 00:03:52
Message-ID: CAKHd5CfbkW0ebnW0_UqdZOfE20Mu72FG8GxxqkyXGjf3RY9eXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-05-28 1:41 GMT+08:00 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:

> On Tue, May 26, 2015 at 7:03 PM, digoal zhou <digoal(dot)zhou(at)gmail(dot)com>
> wrote:
>
>> When we create table, some column use foreign key references.
>> Now PostgreSQL don't create index for the FK, and there is no problem.
>> But when some body need the index to speed up the query within these APP,
>> they need to add the index manual one-by-one when has many tables.
>> If we can add syntax for auto create index for FK by user's choose, and
>> default not create?
>>
>
> ​I presume you mean to modify the CREATE TABLE statement.​
>
> ​How does this help solve the problem "when some body need the index to
> speed up the query"?
>
Sometimes, when user need delete FK's parent table's tuple, FK has an
index will improve the performance.
or sometime, user need query FK table with FK's condition (assume it need
the btree index).
There is no other database product do the thing, but if PG has the
syntax(when add FK, user can choose whether or not create index), users
will happy to use it.
Regards,
digoal

>
> My first impression is that I like the idea. The fact that it is not
> supported by the SQL standard is a drawback Do any other vendors do this?
>
> David J.​
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-28 00:22:18 Re: fsync-pgdata-on-recovery tries to write to more files than previously
Previous Message Peter Eisentraut 2015-05-27 23:28:39 Re: Run pgindent now?