Subject | Repost: When to mark as foreign key or not? |
---|---|
Author | dhay@lexmark.com |
Post date | 2003-10-28T19:09:29Z |
Hi,
Any takers on this? An explanation would be very helpful!
thanks,
David
---------------------- Forwarded by David Hay/Lex/Lexmark on 28/10/2003
03:09 PM ---------------------------
David Hay
23/10/2003 05:28 PM
To: firebird-support@yahoogroups.com
cc:
Subject: When to mark as foreign key or not? (Document link: David Hay)
Hi,
I have a forms table, a categories table, and a formcategory table which
links the form with the categories it is in.
I automatically set the form_id and category_id in the formcategory table
(that's all it contains) as foreign keys to forms.id and categories.id
respectively. However this automatically creates an index on category_id,
but with a selectivity of 100.
So...will this be problematic in terms of the optimizer? Should I handle
the foreign key stuff myself? It seems like the right thing to
do...but???!
Any advice appreciated,
Cheers,
David
Any takers on this? An explanation would be very helpful!
thanks,
David
---------------------- Forwarded by David Hay/Lex/Lexmark on 28/10/2003
03:09 PM ---------------------------
David Hay
23/10/2003 05:28 PM
To: firebird-support@yahoogroups.com
cc:
Subject: When to mark as foreign key or not? (Document link: David Hay)
Hi,
I have a forms table, a categories table, and a formcategory table which
links the form with the categories it is in.
I automatically set the form_id and category_id in the formcategory table
(that's all it contains) as foreign keys to forms.id and categories.id
respectively. However this automatically creates an index on category_id,
but with a selectivity of 100.
So...will this be problematic in terms of the optimizer? Should I handle
the foreign key stuff myself? It seems like the right thing to
do...but???!
Any advice appreciated,
Cheers,
David