Usage Note 23196: What is an index and when should I use one?
An index is a performance-tuning tool within SAS software. An index allows observations with specific values to be accessed quickly from a data file. Instead of reading through a variable file to find a particular value of a variable or variables, an index identifies the exact location of these observations. However, an index conserves some resources at the expense of others.
The Law of Conservation of Energy states that energy is neither lost nor gained, but simply changes from one form to another. The same is true with indexes. Some resources are consumed at the expense of others. The use of indexes is a balancing act - deciding what additional resources you can give up in order to get the performance benefits. CPU usage, I/O, memory and disk space are all affected when using indexes.
If you are querying large data files for small subsets of observations, indexes can decrease access time. However, this benefit may be offset by the increased space required to store the index. You must weigh the resources used to create and maintain the index against the better access time. When used properly, an index is a performance-tuning tool that helps you get the best possible performance for your SAS applications.
This paper by Diane Olson of SAS R&D, "Power Indexing: A Guide to Using Indexes Effectively," explores the creation and use of indexes. It includes information on determining if an index will help you and if so, how to tune it for best results.
Information on indexing is also available in the SAS OnlineDoc: Base SAS Software => SAS Language Reference: Concepts => SAS Files Concepts => SAS Data Files => SAS Indexes.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Date Modified: | 2008-11-12 14:31:13 |
Date Created: | 2003-02-25 14:36:26 |