Postgres Primary Key

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Postgres Primary Key

Post by phppick »

Hi,

Can anybody tell me, what is this means..

this is i am getting when i am adding primary key

NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "tablename_pkey" for table "tablename"

Thanks
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Indexes are primarily used to enhance database performance (though inappropriate use will result in slower performance).

As primary keys are unique and do not depend on other tables they can speed up query access to the table by having the index in place hence they are automatically added. You can also add additional indexes with the "CREATE INDEX" command (See http://www.postgresql.org/docs/7.4/inte ... index.html).

Too many or incorrectly indexed columns can degrade performance.

It is customary to run a "Vacuum analyse" on the database at regular intervals (cron job) to tidy up the indexes.

This sort of detail should be covered anywhere dealing with database management but at the moment I cannot point you to a specific reference point.
Post Reply