Search Postgresql Archives

Shorthand for foreign key indices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anybody else think it would be cool if you could use a shorthand
expression for creating an index on a foreign key?  I think it's fair
to say that in the majority of cases, if you're using a foreign key,
you're going to want an index on it.

I know that it was decided a fair few releases ago to stop creating an
implicit index for each foreign key, and that's cool, but should the
creation syntax really require a separate statement for every single
FK you want to index?

Something like ...

CREATE TABLE foo (
 foo int NOT NULL REFERENCES bar INDEX
);

... would be marvellous

My apologies if this has been answered before, but a search of the
-general mailing list was not fruitful.

BJ

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux