Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual page 162

Table of Contents

Advertisement

Choosing an index type
142
Often, the type of data in a column gives a good indication how the column will
be used. For example, a date column will probably be used for range searches
in
clauses, and a column that contains prices or sales amounts will
WHERE
probably be used in the projection as an argument for aggregate functions
(
,
, and so on).
SUM
AVG
Adaptive Server IQ can still resolve queries involving a column indexed
Note
with the wrong index type, although it may not do so as efficiently.
This table shows recommended index types based on the query. The index that
is usually fastest for each query is listed first, the slowest last. These
recommendations should not be your only criteria for picking an index type.
You should also consider the number of unique values and disk space. See the
other tables in this section.
Table 4-2: Query type/index
Type of Query Usage
In a
SELECT
projection list
In calculation expressions such as
(A+B)
SUM
As
argument
AVG/SUM
As
argument
MIN/MAX
As
argument
COUNT
As
COUNT DISTINCT, SELECT DISTINCT
or
argument.
GROUP BY
If field does not allow duplicates
Columns used in ad hoc join
Columns used in a join index
As
argument in a
LIKE
WHERE
As
argument
IN
In equality or inequality (=, <>)
In range predicate in
WHERE
>=, <=,
BETWEEN
While
is recommended, in certain cases
Note
HNG
often used in place of
HNG
the performance of
or
LF
selected.
Recommended Index Type
Default
Default
High_Non_Group, Low_Fast,
High_Group
LF, HG, HNG
LF, HG
, Default
LF
HG
Default,
HG, LF
clause
Default
HG, LF
HG, LF
clause (>, <,
or
LF
HNG
.
tends to give consistent performance, while
HNG
with ranges depends on the size of the range
HG
, Default
,
HG, LF
or
is faster, and is
LF
HG

Advertisement

Table of Contents
loading

Table of Contents