Subject How to create a foreign key that use an already existing index ?
Author sabatierstephane
Hello,

i often meet this scenario :

CREATE TABLE MASTER(
ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);

CREATE TABLE SLAVE(
ID_MASTER INTEGER NOT NULL,
PRIMARY KEY (ID)
);

ALTER TABLE SLAVE ADD FOREIGN KEY (ID_MASTER) REFERENCES MASTER (ID);

the big problem is that i will have 2 INDEXES on the same field on the table Slave, one for the primary key and another for the foreign key, both exactly the same.

is it possible to say to the foreign key to not create any index and use instead the index on the primary_key ?