Microsoft KB Archive/193250

= XL98: How to Create an Index with Microsoft Query =

Article ID: 193250

Article Last Modified on 6/27/2007

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q193250





SUMMARY
This article describes how to create indexes with Microsoft Query.



MORE INFORMATION
Indexes can make queries run more quickly. To improve query performance, you can create indexes for fields that are used in joins, criteria, and sorts.

The more unique a field's entries are, the more an index for that field can improve query performance. For example, an index for a field of phone numbers will improve query performance more than an index for a field containing only Yes or No entries.

To create an index with Microsoft Query, follow these steps:  On the File menu, click Table Definition. In the Select Data Source dialog box, select a data source and then click OK. In the Select Table dialog box, select a table and then click Index. In the Create Index dialog box, type the name for the index in the Index Name box. In the Index Fields list, click the field to be indexed.

Depending on the ODBC driver you are using, you may be able to index on multiple fields, or index on an expression. Ensure that the Unique Index box is selected, and then click Add. Note that you receive the following message:

Index was created successfully.

If you receive an error message, click to clear the Unique Index check box.</li> Click OK.</li> Repeat steps 5-7 for any other fields that you want to be indexed on that table.</li> Click Close.</li> Repeat steps 3-9 for any other tables with fields that you want to be indexed.</li></ol>

When you run your query again, you may receive better performance.

Note that indexes can make data entry slower because the indexes are updated each time data is entered. If you find that your indexes are slowing down the data entry process, delete indexes for fields which contain few unique entries. For example, if a field of phone numbers is used in a criteria, create an index for it because there are many unique entries. But if 10 fields, each containing only a Yes or a No entry, are used in criteria, you may prefer not to create indexes for these fields because they will do little to improve query performance and may slow down data entry.

<div class="references_section">