1 / 5

Indexes

Indexes. 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. Access uses indexes in a table as you use an index in a book: to find data, Office Access 2010 looks up the location of the data in the index.

orrin
Download Presentation

Indexes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Indexes • 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. • Access uses indexes in a table as you use an index in a book: to find data, Office Access 2010 looks up the location of the data in the index. • 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.

  2. What is an index? • You can use an index to help Access find and sort records faster. • 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.

  3. Decide which fields to index • You can create indexes that are based on a single field or on multiple fields. • You will probably want to index fields that you search frequently, fields that you sort, and fields that you join to fields in other tables in multiple table queries. • Indexes can speed up searches and queries, but they can slow down performance when you add or update data. • When you enter data in a table that contains one or more indexed fields, Access must update the indexes each time a record is added or changed. Adding records by using an append query or by appending imported records is also likely to be slower if the destination table contains indexes.

  4. Multiple-field indexes • If you think that you will often search or sort by two or more fields at a time, you can create an index for that combination of fields. For example, if you often set criteria for the Vendor and ProductName fields in the same query, it makes sense to create a multiple-field index on both fields. • When you sort a table by a multiple-field index, Access sorts first by the first field defined for the index. You set the order of the fields when you create a multiple-field index. If there are records with duplicate values in the first field, Access sorts next by the second field defined for the index, and so on. • You can include up to 10 fields in a multiple-field index.

  5. Create an index • To create an index, you first decide whether you want to create a single-field index or a multiple-field index. You create an index on a single field by setting the Indexed property. The following table lists the possible settings for the Indexed property. • To create a multiple-field index for a table, you include a row for each field in the index and include the index name only in the first row. Access treats all rows as part of the same index until it comes to a row containing another index name. To insert a row, right-click the location where you want to insert a row, and then click Insert Rows on the shortcut menu. • In the Navigation Pane, right-click the name of the table that you want to create the index in, and then click Design View on the shortcut menu. • On the Design tab, in the Show/Hide group, click Indexes. • The Indexes window appears. Resize the window so that some blank rows appear and the index properties are shown. • In the Index Name column, in the first blank row, type a name for the index. You can name the index after one of the index fields, or use another name. • In the Field Name column, click the arrow and then click the first field that you want to use for the index. • In the next row, leave the Index Name column blank, and then, in the Field Name column, click the second field for the index. Repeat this step until you select all the fields that you want to include in the index.

More Related