primary key or index?

  • Thread starter Thread starter Garret
  • Start date Start date
Alright, so if the relationship is there I don't have to worry if it's
not in the Index window. I find this odd because for one of my tables
an Index appeared after the relationships were built, but only this
one. Would you suggest I go and create Indexes for the fields where
the tables are joined anyway? This is Access2000, in case that matters
at all.

Do you know how to do as I was saying before? Searching a Parent
record of all its children? (And if this is really necessary if it is
just the same amount of effort to search the child table for all
records with this field) I'll give you an example to try to be as
clear as possible.

tblGages
GageNo (PK)
GageDesc
GageType

tblGageTypes
GageType (PK)
GageTypeDesc

Where they are joined by GageType. tblGageType's records have children
of each record in the tblGages. If a record in tblGages (named G115)
has a GageType of "BORE", then if you go to tblGageTypes and look at
the "BORE" record's children, then you see G115 there.
I'm trying to be as clear as I can. Sorry if theres any
misunderstanding and I appreciate your help.
 
There's no point in creating a second index if one already exists on a given
field. Since you have an index on GageType because of the relationship, the
only additional one you should need to create is the one on GageDesc.

If you want to know how many child records have a particular value in them,
you search the child table, not the parent table!
 
Douglas said:
There's no point in creating a second index if one already exists on a given
field. Since you have an index on GageType because of the relationship, the
only additional one you should need to create is the one on GageDesc.

Should I create an Index on GageDesc because I'm going to be searching
the table, or only if I do a search by GageDesc?
If you want to know how many child records have a particular value in them,
you search the child table, not the parent table!

I usually do, but I was told that since there might be thousands of
records in the tblGages, then it would be much faster, rather than
search through them the records in tblGages for a particular value of
GageType, to search the tblGageTypes for all the children of one record
in there, saving the time of searching through every single record and
just searching through the ones with a particular GageType.
 
Back
Top