473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Hidden Index from Foreign Keys

I ve been told from Allen and others that when enforcing referential
integrity Access creates a hidden index for the foreign key, therefore, I do
not need to re-index it myself.

However, I noticed that if the foreign key has the same name as the name of
the field to which it corresponds in the other table, then it appears as
indexed in the indexes list.

For example:
Table PERSON. Field: PersonID
TABLE EMPLOYEE Field that is lForeign key: EmployeeID
Employee appears as non-indexed so I assume from what I ve been told that
Access already created a hidden index on it after ref. integrity was
enforced between the two tables.

But if:
TABLE PERSON. FIELD: PersonID
TABLE EMPLOYEE: FIELD that is Foreign key: PersonID,
then the field appears as indexed in the EMPLOYEE table.
Should I delete this index as there should be a hidden index as well when RI
was enforced?

Cheers!
Konstantinos
Nov 13 '05 #1
2 2449
Kostas wrote:
I ve been told from Allen and others that when enforcing referential
integrity Access creates a hidden index for the foreign key, therefore, I do
not need to re-index it myself.

However, I noticed that if the foreign key has the same name as the name of
the field to which it corresponds in the other table, then it appears as
indexed in the indexes list.

For example:
Table PERSON. Field: PersonID
TABLE EMPLOYEE Field that is lForeign key: EmployeeID
Employee appears as non-indexed so I assume from what I ve been told that
Access already created a hidden index on it after ref. integrity was
enforced between the two tables.

But if:
TABLE PERSON. FIELD: PersonID
TABLE EMPLOYEE: FIELD that is Foreign key: PersonID,
then the field appears as indexed in the EMPLOYEE table.
Should I delete this index as there should be a hidden index as well when RI
was enforced?


What is probably happening here is that Access is set to automatically
add an index to fields that end in "ID", it's in the options and if you
know what you're doing when designing a database, best turned off.

--
Pretentious? Moi?
Nov 13 '05 #2
Thank you!
I found it out, and turned it off.
That explains why my CountryCode field was indexed too!

Regards,
Konstantinos

"Trevor Best" <nospam@localhost> wrote in message
news:41**********************@auth.uk.news.easynet .net...
Kostas wrote:
I ve been told from Allen and others that when enforcing referential
integrity Access creates a hidden index for the foreign key, therefore, I
do not need to re-index it myself.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Olivier Crèvecoeur | last post by:
Hello, Excuse me for my poor english. I would kike know if create index on the foreign key it's necessary or if Oracle, are optimized for using foreign key whithout index. Best regards ...
10
by: Bodza Bodza | last post by:
I'm having an argument with an incumbent self-taught programmer that it is OK to use null foreign keys in database design. My take is the whole point of a foreign key is that it's not supposed...
1
by: Vinodh Kumar P | last post by:
I understand the number of foreign keys allowed is restricted by the DBMS I use. In a general relational schema design perspective how many foreign keys a table shall have? If I have large number...
6
by: christopher.secord | last post by:
Is there any advantage to doing this: ALTER TABLE testtable ADD CONSTRAINT PK_sysUser PRIMARY KEY NONCLUSTERED (UserID) WITH FILLFACTOR = 100, CONSTRAINT IX_sysUser UNIQUE NONCLUSTERED...
3
by: Phil Latio | last post by:
I am following a book on PHP and MySQL and have come across the below SQL statement. CREATE TABLE users ( user_id MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT, username VARCHAR(20) NOT NULL,...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
1
by: rbarber | last post by:
I have to synchronize 2 databases hourly but am having difficulty maintaining foreign key relations. These tables use auto-increment columns as primary keys, with child records in other tables...
1
by: apax999 | last post by:
Kinda new to SQL, using SQL Server 2005. I have some foreign keys in a couple of tables. I need to drop these tables, but can't since I'll get the error: Msg 3726, Level 16, State 1, Line...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.