Subject | How to avoid automatic foreign key index |
---|---|
Author | Christian Kaufmann |
Post date | 2008-03-15T09:12:01Z |
Hi,
I have a detail table with a foreign key to another table. Can I
somehow tell FB to use the primarykey as index for the foreign key
relation? Or are there any other solutions to avoid the duplicate index?
CREATE TABLE SPLIT
(
DISTANCE SMALLINT NOT NULL,
SWIMRESULTID INTEGER NOT NULL,
SWIMTIME INTEGER,
CONSTRAINT PK_SPLIT PRIMARY KEY (SWIMRESULTID, DISTANCE)
);
ALTER TABLE SPLIT ADD CONSTRAINT FK_SPLIT_SWIMRESULT
FOREIGN KEY (SWIMRESULTID) REFERENCES SWIMRESULT
(SWIMRESULTID)
ON DELETE CASCADE
ON UPDATE CASCADE
cu Christian
I have a detail table with a foreign key to another table. Can I
somehow tell FB to use the primarykey as index for the foreign key
relation? Or are there any other solutions to avoid the duplicate index?
CREATE TABLE SPLIT
(
DISTANCE SMALLINT NOT NULL,
SWIMRESULTID INTEGER NOT NULL,
SWIMTIME INTEGER,
CONSTRAINT PK_SPLIT PRIMARY KEY (SWIMRESULTID, DISTANCE)
);
ALTER TABLE SPLIT ADD CONSTRAINT FK_SPLIT_SWIMRESULT
FOREIGN KEY (SWIMRESULTID) REFERENCES SWIMRESULT
(SWIMRESULTID)
ON DELETE CASCADE
ON UPDATE CASCADE
cu Christian