Thread: Automatic Index Creation for Column Types

Automatic Index Creation for Column Types

From
Charles Sheridan
Date:
[ RESEND - earlier email was from wrong sending address ]

Hello,

I don't see indication that the capability described below exists in
Postgres (or any RDBMS), so this is likely a feature request; (not sure
if this is the place, but the pg web pages seem to suggest that it is) ---

For column types that are frequently defined in tables, and which are
typically indexed, it would be helpful to be able to specify in the type
definition of the column that its addition/creation into a table should
be automatically accompanied by the creation of an associated index.

Auto-index generation for a specific column type would be overridable
for specific tables, as you wouldn't always want to auto-create an index
at the time of column addition to a table. In the case of CREATE TABLE,
this would be less of a concern, and more of a concern for ALTER TABLE
ADD COLUMN.

Such a configuration would also specify the type of index.

If this is the appropriate group for this subject, what do you think ?


Thanks,
Charles Sheridan


Re: Automatic Index Creation for Column Types

From
Guillaume Lelarge
Date:
On Sun, 2013-08-18 at 20:16 -0500, Charles Sheridan wrote:
> [ RESEND - earlier email was from wrong sending address ]
>
> Hello,
>
> I don't see indication that the capability described below exists in
> Postgres (or any RDBMS), so this is likely a feature request; (not sure
> if this is the place, but the pg web pages seem to suggest that it is) ---
>
> For column types that are frequently defined in tables, and which are
> typically indexed, it would be helpful to be able to specify in the type
> definition of the column that its addition/creation into a table should
> be automatically accompanied by the creation of an associated index.
>
> Auto-index generation for a specific column type would be overridable
> for specific tables, as you wouldn't always want to auto-create an index
> at the time of column addition to a table. In the case of CREATE TABLE,
> this would be less of a concern, and more of a concern for ALTER TABLE
> ADD COLUMN.
>
> Such a configuration would also specify the type of index.
>
> If this is the appropriate group for this subject, what do you think ?
>

This mailing list is about pgadmin development, not PostgreSQL. So you
should better send this email to pgsql-general or pgsql-hackers.

I wouldn't hold my breath on it though. Auto-index generation for a
specific column type, as you called it, seems pretty much like hell to
me. I'm already fighting with my customers that have so many useless
indexes ("because, you never know, it might help"), and I don't want
more fights :)


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com