Progress
Database Design
Guide


How Indexes Work

A database index works like a book index. To look up a topic, you scan the book index, locate the topic, and turn to the pages where the information resides. The index itself does not contain the topic information; instead it contains page numbers that direct you to the appropriate pages. Without an index, you would have to search the entire book, scanning each page sequentially.

Similarly, if you ask for specific data from a database, the system looks for an index. An index contains two pieces of information—the index key and and a row pointer that points to the corresponding row in the main table. Figure 4–1 illustrates this.

The index table entries are always sorted in numerical, alphabetical, or chronological order. Using the pointers, the system can then access data rows directly and in the sort order specified by the index.

Every table should have at least one index, the primary index. When you create the first index on any table in a 4GL implementation, Progress assumes it is the primary index and sets the Primary flag accordingly. Figure 4–1 illustrates the Order-Num (the primary index) and Order-Date indexes on the Order table in the sports database.

Figure 4–1: Indexing the Order Table


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095