Hello,

I have created the following join table: the two FKs are the PK of the table. Typically, I will need to select rows for a given ITEM_FK.

Question: is it necessary/advisable to create an index for the ITEM_FK column? Or is this redundantbecause this column is already one of the PK columns?

CREATE TABLE SUPPLY
(
ITEM_FK integer NOT NULL,
CONTACT_FK integer NOT NULL,
COST numeric (7,2),
PRIMARY KEY (ITEM_FK,CONTACT_FK)
);


--


Regards/Gruß,

Tarlika Elisabeth Schmitz

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to