Subject | Index creation |
---|---|
Author | Robert martin |
Post date | 2007-08-09T04:03:58Z |
Hi
I have the following table
TableA
UniqueID (primarly Key)
FK1 (Foreign Key into another table)
FK2 (Foreign Key into another table)
We are not using Foreign keys in FB. I anticipate searching using
'WHERE FK1 = xx AND FK2 = xx) most of the time. However I will also be
doing searches on each FK field individually. Should I create one
composite index for FK1, FK2 or two individual indexs ?
FK1 should have a high selectivity, FK2 will have a low selectivity
(i.e. lots of duplicate entries for FK2 but not many for FK1).
This is a FB 2 database.
TIA
--
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
I have the following table
TableA
UniqueID (primarly Key)
FK1 (Foreign Key into another table)
FK2 (Foreign Key into another table)
We are not using Foreign keys in FB. I anticipate searching using
'WHERE FK1 = xx AND FK2 = xx) most of the time. However I will also be
doing searches on each FK field individually. Should I create one
composite index for FK1, FK2 or two individual indexs ?
FK1 should have a high selectivity, FK2 will have a low selectivity
(i.e. lots of duplicate entries for FK2 but not many for FK1).
This is a FB 2 database.
TIA
--
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd