Working with Table Indexes

When you create a table, Visual FoxPro creates a table (.dbf) file and, if your table includes memo or general fields, the associated table memo (.fpt) file. By default, Visual FoxPro stores records in the table in the order that you enter them. When your application performs operations on the table, the records are processed in the order they were entered.

You can control the order and increase the speed of processing table records by creating an index for the table. An index does not change the physical order of the records stored in the table; rather, it provides an efficient and versatile mechanism for accessing table records. For example, suppose you want to process records in a customer table by company name in alphabetical order. You can create a table index based on the company name field so that your application can process records in the order specified by the index you created. You can also add a filter to the index so you can add only those records that meet the filter criteria to the index.

After you create the table index, you can set the order of records in the table to the index so that your application processes records in the order specified. In addition, you can create different indexes for a table so that you can change the order in which your application processes records. For example, you might want to organize a customer table by contact name to quickly find the name you want or by postal code to generate mailing labels that are presorted for efficient mailing. You can create and store different ordering scenarios for tables by creating multiple indexes for the same table. You can use different types of index files to store indexes depending on their frequency of use.

You can also use indexes to create persistent relationships between tables in a database, making it possible for you to access the exact records you want. Persistent relationships between database tables are stored in the database file and exist as the default relationships when you use the tables in the data environment.

In This Section

Visual FoxPro Index Files

Describes different types of Visual FoxPro index files for storing indexes.

Visual FoxPro Index Types

Describes different index types.

How to: Create Indexes (Visual FoxPro)

Describes how to create indexes.

Index Creation Based on Expressions

Describes different types of expresions you can use to create indexes.

Considerations for Creating Index Expressions

Describes considerations to remember when creating index expressions.

Indexes Based on Deleted Records

Discusses how indexes based on deleted records improve query performance and ensure use of Rushmore query optimization.

How to: Filter Data

Describes how to add filters to indexes so you can select records containing only the data that you want.

How to: Create Less Frequently Used Indexes

Describes how to create indexes you use rarely or for a special task.

How to: Set Controlling Indexes

Describes how to select a controlling, or master, index for a table.

How to: Select Indexes at Run Time

Describes how the user can change the display of records at run time.

How to: Display Records in Descending Order

Describes how to change the display of records from ascending order to descending order.

How to: Enhance the Efficiency of Indexes

Describes how to improve index performance, primarily by keeping indexes updated.

How to: Delete Indexes (Visual FoxPro)

Describes how to remove indexes that you no longer use.


User Interface Reference (Visual FoxPro)

Explains the options that appear on various dialog boxes, windows, and other user interfaces. Generally, these topics appear when you press F1 in a dialog box or window.

Language Reference (Visual FoxPro)

Provides a list of language reference topics in alphabetical order.

Related Sections

Working with Data

Describes how to design and build your database to create effective applications with indexes, tables, and databases based on your data requirements.

Working with Tables (Visual FoxPro)

Discusses how to make sure your tables have the structure that your application requires.

Working with Fields

Introduces records, how to view them, and how to use them to store data in tables.

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic