Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database structure question

Status
Not open for further replies.

jennyflower

Programmer
Oct 10, 2006
60
GB
Hi,

I am converting a visual fox pro database to Postgres. When converting this data are primary/foreign keys faster at looking up data then normal indexes?

Thanks
 
these are different things

foreign key is not an index at all (actually it only slows things down, a good idea is to put an index along with the foreign key)
primary key is implemented using index and should be as fast as UNIQUE index

both primary key and foreign key imply constraints the change the behaviour of queries
normal indexes are just indexes they are not constraints, they have only speed implications (may be for good, or for bad - updates, deletes get slower when more indexes exist on a table)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top