Index question... -
04-01-2004
, 11:42 AM
I have a one to many relationship between two tables. The "one" table has a
5 field PK (total 7 fields, 1400 records) and the "many" table has a 7
field PK (total 15 fields, 1500 records). I followed the general rule of
indexing each field in the PKs in both tables. I was doing a query on both
tables with a "group by" to get the sum of a field in the "many" table. The
query was taking about 5 seconds to run which I thought was horrendous. I
deleted the individual indexes on the PK fields of the "many" table and that
made the query instantaneous. My question is: When creating a PK, does
that automatically index the individual fields? If so, then does my
re-indexing them slow things down?
Thanks.
Matthew Wells
MWells (AT) NumberCruncher (DOT) com |