473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,402 developers and data experts.

Indexes in Microsoft Access

MMcCarthy
14,534 Expert Mod 8TB
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 7511

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

Similar topics

0
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.