Oracle 5.0 Reference Manual page 717

Table of Contents

Advertisement

table and
is the average value group size. That ratio yields an approximate number of value groups
S
in the table.
For a join based on the
NULL, just as
NULL <=>
However, for a join based on the
is not true when
expr2
comparisons of the form
of
is NULL, because the comparison cannot be true.
expr
For
comparisons, it does not matter how many
=
purposes, the relevant value is the average size of the
not currently enable that average size to be collected or used.
For
tables, you have some control over collection of table statistics by means of the
MyISAM
myisam_stats_method
as follows:
• When
myisam_stats_method
(that is, they all form a single value group).
If the
value group size is much higher than the average
NULL
method skews the average value group size upward. This makes index appear to the optimizer to be
less useful than it really is for joins that look for
method may cause the optimizer not to use the index for
• When
myisam_stats_method
same. Instead, each
If you have many
NULL
the average
non-NULL
1 causes the optimizer to overestimate the value of the index for joins that look for
values. Consequently, the
[646]
lookups when other methods may be better.
ref
• When
myisam_stats_method
If you tend to use many joins that use
and one
is equal to another. In this case,
NULL
The
myisam_stats_method
value affects
statistics collection for all
MyISAM
statistics collection only for the current client connection. This means that you can force a table's
statistics to be regenerated with a given method without affecting other clients by setting the session
value of
myisam_stats_method
To regenerate table statistics, you can use any of the following methods:
• Execute
myisamchk --stats_method=method_name --analyze
• Change the table to cause its statistics to go out of date (for example, insert a row and then delete it),
and then set
myisam_stats_method
Some caveats regarding the use of
• You can force table statistics to be collected explicitly, as just described. However, MySQL may also
collect statistics automatically. For example, if during the course of executing statements for a table,
some of those statements modify the table, MySQL may collect statistics. (This may occur for bulk
inserts or deletes, or some
are collected using whatever value
Index Statistics Collection
MyISAM
comparison operator,
<=>
for any other N.
N <=> N
operator,
=
NULL
or
(or both) are NULL. This affects
expr1
expr2
expr: MySQL will not access the table if the current value
tbl_name.key =
[476]
system variable. This variable has three possible values, which differ
[476]
is nulls_equal, all
[476]
is nulls_unequal,
value forms a separate value group of size 1.
NULL
values, this method skews the average value group size downward. If
value group size is large, counting
nulls_unequal
[476]
is nulls_ignored,
rather than =,
<=>
[476]
system variable has global and session values. Setting the global
[476].
[476]
myisam_stats_method
statements, for example.) If this happens, the statistics
ALTER TABLE
myisam_stats_method
697
is not treated differently from any other value:
NULL
is different from
non-NULL
values are in the table. For optimization
NULL
non-NULL
value groups. However, MySQL does
values are treated as identical
NULL
non-NULL
non-NULL
values. Consequently, the
[646]
accesses when it should.
ref
values are not considered the
NULL
values each as a group of size
NULL
method may cause the optimizer to use this index for
values are ignored.
NULL
values are not special in comparisons
NULL
is the appropriate statistics method.
nulls_equal
tables. Setting the session value affects
MyISAM
and issue an
ANALYZE TABLE
[476]:
[476]
values:
expr1 =
[646]
accesses for
ref
value group size, this
nulls_equal
non-NULL
statement
has at the time. Thus, if you

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents