With the function-based index feature, you can create indexes on functions and expressions directly. Like computed column indexes, this feature is useful for user-defined ordering and DDS applications.
This example creates an index on a generalized index key, using three columns in the table.
CREATE INDEX generalized_index on parts_table (general_key(part_no,listPrice, part_no>>version)
In some situations, when you cannot create an index on individual columns, you can create a generalized index key by invoking a user-defined function that returns a composite value on multiple columns.
For the modifications to commands necessary to create function-based indexes and indexes on computed columns, see “Computed columns and function-based indexes syntax changes”.
Copyright © 2005. Sybase Inc. All rights reserved. |