Examples of indexes
The following index examples are provided to help you create effective indexes.
For the purposes of the examples, assume that three indexes are created.
Assume that an index HEXIX was created with *HEX as the sort sequence.
CREATE INDEX HEXIX ON STAFF (JOB)Assume that an index UNQIX was created with a unique-weight sort sequence.
CREATE INDEX UNQIX ON STAFF (JOB)Assume that an index SHRIX was created with a shared-weight sort sequence.
CREATE INDEX SHRIX ON STAFF (JOB)
- Index example: Equals selection with no sort sequence table
Equals selection with no sort sequence table (SRTSEQ(*HEX)).
- Index example: Equals selection with a unique-weight sort sequence table
Equals selection with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Equal selection with a shared-weight sort sequence table
Equal selection with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
- Index example: Greater than selection with a unique-weight sort sequence table
Greater than selection with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Join selection with a unique-weight sort sequence table
Join selection with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Join selection with a shared-weight sort sequence table
Join selection with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
- Index example: Ordering with no sort sequence table
Ordering with no sort sequence table (SRTSEQ(*HEX)).
- Index example: Ordering with a unique-weight sort sequence table
Ordering with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Ordering with a shared-weight sort sequence table
Ordering with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
- Index example: Ordering with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table
Ordering with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Grouping with no sort sequence table
Grouping with no sort sequence table (SRTSEQ(*HEX)).
- Index example: Grouping with a unique-weight sort sequence table
Grouping with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Grouping with a shared-weight sort sequence table
Grouping with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
- Index example: Ordering and grouping on the same columns with a unique-weight sort sequence table
Ordering and grouping on the same columns with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Ordering and grouping on the same columns with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table
Ordering and grouping on the same columns with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Ordering and grouping on the same columns with a shared-weight sort sequence table
Ordering and grouping on the same columns with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
- Index example: Ordering and grouping on the same columns with ALWCPYDTA(*OPTIMIZE) and a shared-weight sort sequence table
Ordering and grouping on the same columns with ALWCPYDTA(*OPTIMIZE) and a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU).
- Index example: Ordering and grouping on different columns with a unique-weight sort sequence table
Ordering and grouping on different columns with a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Ordering and grouping on different columns with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table
Ordering and grouping on different columns with ALWCPYDTA(*OPTIMIZE) and a unique-weight sort sequence table (SRTSEQ(*LANGIDUNQ) LANGID(ENU)).
- Index example: Ordering and grouping on different columns with ALWCPYDTA(*OPTIMIZE) and a shared-weight sort sequence table
Ordering and grouping on different columns with ALWCPYDTA(*OPTIMIZE) and a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
Parent topic:
Creating an index strategy