Primary Key and Other Indexes

T

tbl

When a new, simple table is created in Access, with a
typical Primary Key assigned, I notice that two Indexes are
listed in the "Indexes" listing dialog. One is for the
Primary Key, and the other is for the same field, but not
inicating anything about a Primary Key.

Are both required? Beneficial?
 
J

John Vinson

When a new, simple table is created in Access, with a
typical Primary Key assigned, I notice that two Indexes are
listed in the "Indexes" listing dialog. One is for the
Primary Key, and the other is for the same field, but not
inicating anything about a Primary Key.

Are both required? Beneficial?

No, and no. Access has a somewhat infuriating misfeature: if you
select Tools... Options... Tables/Queries, you'll see a textbox
labeled "Auto Index on import/create". This will automatically index
fieldnames ending in the listed text strings (ID, Num, ...) - EVEN IF
an index already exists for that field.

I'd suggest clearing this textbox in all databases. If I want an index
- I'll create an index!

John W. Vinson[MVP]
 
T

tbl

Correction: The duplicate index gets created based on a setting in
Tools>Options>Tables/Queries - see the AutoIndex option. If there are entries
there, and your intended key field matches one of them (and it doesn't have
to be an exact match!), two indexes may get created: non-primary as a result
of the "Autoindex on create" option, and primary as a result of clicking Yes
on the primary key dialog. My preference is to turn off autoindexing and
manage indexes by hand.

Thank you Ted!
 
T

tbl

No, and no. Access has a somewhat infuriating misfeature: if you
select Tools... Options... Tables/Queries, you'll see a textbox
labeled "Auto Index on import/create". This will automatically index
fieldnames ending in the listed text strings (ID, Num, ...) - EVEN IF
an index already exists for that field.

I'd suggest clearing this textbox in all databases. If I want an index
- I'll create an index!

John W. Vinson[MVP]


Thanks John! Good stuff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple field primary key and other indexes 1
Too many indexes 3
Too Many Indexes Error 3
do I need more indexes? 24
Primary key of two fields 3
Access 2010 Form Issue's 0
indexes vs PK 3
Primary Key 4

Top