473,491 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Indexes in Microsoft Access

MMcCarthy
14,534 Recognized Expert Moderator MVP
The more data you include in your tables the more you will need to have indexes to search and sort that data. However, there is a balance between having enough indexes and too many. Too many indexes will slow down the speed of updates on your records.

Access presets a number of Indexes for you. If you look in Tools ... Options under the Tables/Queries tab you will see that under "Auto Index on Import/Create" there is a list as follows:

ID;key;code;num

This means that Access will automatically create an index on any field which begins or ends with these terms. Although this can be helpful it can also mean that access will create duplicate indexes or indexes on fields you didn't intend to be indexed. If you are confident of setting your own indexes you can delete this list.

When Access creates an Index it essentially stores internally the value in the field(s) being indexed and the location of every field with that value. This then speeds up any search on that field.

When you set a field as a primary key it is automatically indexed. Most indexes you need to define will contain values from only a single field.

Creating an Index

To create an index on a single field, open the table in design view. Select the field on which you want to create an index. Go to the Indexed property and change the property value to Yes (Duplicates OK). The other value of Yes (No Duplicates) is only used on fields where the value is unique (no value is duplicated). The Yes (No duplicates) value is used by primary keys and is also useful when creating an index on foreign keys where the relationship to the other table is one to one only.

If you create an index on more than one field in a table for example two fields and set criteria on both fields in a query Access will combine the indexes to search the table.

Multiple Field Indexes

If you frequently set criteria on multiple fields when querying large tables it might be useful to create a multiple field index to save Access from combining multiple single field indexes. A good example of this is when you search on both surname and firstname fields.

To create a multiple field index, open the table in design view and open the index window (View ... Indexes). Under Index Name give a name to the multiple field index e.g. FullName. You only need to enter this on the first line. Under Field Name add the Surname field and set sort order. Then go to the next line and add the Firstname field under Field Name and set the sort order. You have now created a multiple field index.
Nov 28 '07 #1
0 7524

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1208
by: noelle.bond | last post by:
I tried migrating a database from a standalone SQL Server 2000 on Windows 2003 to a clustered Windows 2003/SQL 2000 Server, and the Full Text indexes will not fully populate. There should be...
4
1803
by: robert | last post by:
my colleagues are convinced that having more than an index or two destroys performance on their batch runs. could be. i don't have the data, and i'm wondering whether there might be some...
4
1748
by: WindAndWaves | last post by:
Hi Everyone Is there anyone who has some sound rules of thumb for using indexes. I see that, for example, access automatically adds them to linked tables, but I feel, they are probably of more...
2
3287
by: tekanet | last post by:
Hello folks, I'm developing a program that reads an access MDB file and produce some scripts to rebuild the same structure against other databases (MSSQL, MySQL and so on). Reading structure...
5
1831
by: Bruce Rusk | last post by:
I have a question about indexing multiple fields and whether it's redundant to index the individual fields separately. As I understand it, if there is an index on two fields, say idxFullName...
2
4327
by: Lyle Fairfield | last post by:
'Property Clustered As Boolean 'Member of DAO.Index Private Sub IsThereaClusteredIndex() Dim tdf As DAO.TableDef Dim idx As DAO.Index For Each tdf In DBEngine(0)(0).TableDefs For Each idx In...
14
19628
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
10
2674
by: lesperancer | last post by:
you start with a small application in access97, then you have more modules and more... and you reach the point where tables like 'item' and 'employee' reach the limit and you know there's more...
2
2589
by: umair.cheema | last post by:
Hi! 1-I read in MS Access help that Indexes are automatically made when we declare a primary key and they are used for fast searching and sorting purpose. But i am still confused that how can i...
0
7112
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
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
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
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.