Indexing on More than One Column

Often, you might find yourself sorting data on more than one column; an example is indexing on last name plus first name. Your directors table might have more than one director with the same last name. To correctly display the names, you need to sort on last name plus first name. This way, Jack Smith always appears before Jane Smith, who always appears before John Smith.

Indexing on two columns—such as last name plus first name—isn’t the same as creating two separate indexes (one for last name and one for first name). You have not created an index for the first name column itself. The index is of use only when you’re searching or sorting the last name column, or both the last name and first name.

As with all ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.