Search Postgresql Archives

indexes

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

 



I notice a lot of places where people use the approach of creating an index and a unique key like:

CREATE TABLE foo (
  idx SERIAL PRIMARY KEY,
  name varchar(32) UNIQUE NOT NULL
)

instead of
CREATE TABLE foo (
  name varchar(32) PRIMARY KEY
)

If the name is NEVER going to change, is there any advantage to doing this?
If there are many-to-many reference tables (like name-to-friends) is this any different?

I've seen this a lot, but I've always assumed that with the condition that 'name' would NEVER change, there was no advantage.


	


[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