- MS Access - Data Export
- MS Access - Data Import
- MS Access - Macros
- MS Access - Built-In Functions
- MS Access - Formatting Reports
- MS Access - Reports Basics
- MS Access - Controls & Properties
- MS Access - Formatting
- MS Access - SQL View
- MS Access - Combo Box
- MS Access - Navigation Form
- MS Access - Modify A Form
- MS Access - Create A Form
- Unmatched Query Wizard
- MS Access - Duplicate Query Wizard
- MS Access - Joins
- MS Access - Summarizing Data
- MS Access - Grouping Data
- MS Access - Indexing
- MS Access - Calculated Expression
- MS Access - Wildcards
- Many-To-Many Relationship
- One-To-Many Relationship
- One-To-One Relationship
- MS Access - Create Relationships
- MS Access - Relating Data
- MS Access - Alternate Criteria
- MS Access - Parameter Queries
- MS Access - Create Queries
- MS Access - Action Queries
- MS Access - Query Criteria
- MS Access - Query Data
- MS Access - Adding Data
- MS Access - Create Tables
- MS Access - Data Types
- MS Access - Create Database
- MS Access - Objects
- MS Access - RDBMS
- MS Access - Overview
- MS Access - Home
MS Access Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MS Access - Indexing
An index is a data structure, a special data structure designed to improve the speed of data retrieval. If you often search a table or sort its records by a particular field, you can speed up these operations by creating an index for the field. Microsoft Access uses indexes in a table as you use an index in a book to find data.
In some instances, such as for a primary key, Access automatically creates an index for you.
At other times, you might want to create an index yourself.
An index stores the location of records based on the field or fields that you choose to index.
After Access obtains the location from the index, it can then retrieve the data by moving directly to the correct location.
In this way, using an index can be considerably faster than scanning through all of the records to find the data.
Indexes can speed up searches in queries, but they can also slow down performance when adding or updating records.
Let us now look into what indexes Microsoft Access creates by default and how to create them ourselves and learn how to delete any unnecessary indexes. Open the tblEmployees table in Access database which we have created.
We haven t really played with indexes in this database but that doesn t mean we don t have any.
In fact, any field that is set as a primary key in Access is automatically indexed.
Access creates additional secondary indexes depending on the names of your fields.
Let us now go to the File menu and select Options.
You will see the Access Options window.
Go to the Object Designers and you will see a section labeled AutoIndex on Import/Create and in the textbox you will see ID;key;code;num. By default, access automatically adds a secondary index to fields that start or end with these names and that goes for fields you have imported as well as ones you have manually created.
If you want to make any field indexed you can go to the Field tab.
Select any field that you want indexed and check the Indexed checkbox in Field Vapdation section. You also have alternate options for creating or removing an index. You can go back to the Design View.
You can adjust indexes by selecting any field. You can also see how they are indexed in the field properties area below. Any field that has No selected next to indexed, means there is no index for that given field. You can change that by cpcking on the drop-down menu and choosing the other two options — Yes (Duppcate OK) and Yes (No duppcates).
The last option Yes (No Duppcates) means that Access will automatically prohibit duppcate values in that field. Let us now create an index for our last name field.
Let us select LastName to index and say Yes (Duppcates OK). As we save, Access will create that index. Another area where you can view and adjust your indexes for a table is the tables design area in the Show/Hide group.
If you cpck on this Indexes button that will bring up a special view displaying all the indexes created for this table.
We now have two indexes for tblEmployees —one that was created automatically based on the primary key field and one that we just created for the LastName field. These are the different ways to deal with indexes in Microsoft Access tables.
Advertisements