Share via


Index Creation for Tables

When you want to navigate, view, or manipulate table records in a particular order, you use an index. Visual FoxPro uses indexes as ordering mechanisms to provide you with flexibility and power as you develop your application. You have the flexibility to create and use many different index keys for the same table, enabling you to work with records in different orders, according to your application's requirements. You have the power to create custom relationships between tables based on their indexes, enabling you to access exactly the records you want.

A Visual FoxPro index is a file that contains pointers that are logically ordered by the values of an index key. The index file is separate from the table's .dbf file, and does not change the physical order of the records in the table. Rather, when you create an index, you create a file that maintains pointers to the records in the .dbf file. When you want to work with table records in a particular order, you choose an index to control the order and increase the speed in which the table is viewed and accessed.

Note   Indexes are so easy to create, you might be tempted to define one for every field. However, indexes that you use only rarely can slow performance. Other types of index files are better for storing indexes you don't use regularly.

See Also

Deleting Records | Creating One Index | Working with Records | Index File Creation |Index Information Display | Setting a Primary or Candidate Index | Permitting Duplicate Values | Creating Multiple Indexes | Table Creation | Ordering by Multiple Fields | Index Creation for Tables