Oracle 5.0 Reference Manual page 666

Table of Contents

Advertisement

ref
The
column shows which columns or constants are compared to the index named in the
ref
column to select rows from the table.
rows
The
rows
query.
For
InnoDB
Extra
This column contains additional information about how MySQL resolves the query. For descriptions
of the different values, see
Join Types
EXPLAIN
The
column of
type
join types, ordered from the best type to the worst:
system
The table has only one row (= system table). This is a special case of the
const
The table has at most one matching row, which is read at the start of the query. Because there is
only one row, values from the column in this row can be regarded as constants by the rest of the
optimizer.
[646]
const
values. In the following queries,
SELECT * FROM
SELECT * FROM
WHERE primary_key_part1=1 AND primary_key_part2=2;
eq_ref
One row is read from this table for each combination of rows from the previous tables. Other than the
[646]
system
of an index are used by the join and the index is a
[646]
eq_ref
comparison value can be a constant or an expression that uses columns from tables that are read
before this table. In the following examples, MySQL can use an
ref_table:
SELECT * FROM
WHERE ref_table.key_column=other_table.column;
SELECT * FROM
WHERE
ref_table.key_column_part1=other_table.column
AND ref_table.key_column_part2=1;
[646]
ref
All rows with matching index values are read from this table for each combination of rows from the
previous tables.
a
PRIMARY KEY
key value). If the key that is used matches only a few rows, this is a good join type.
EXPLAIN
column indicates the number of rows MySQL believes it must examine to execute the
tables, this number is an estimate, and may not always be exact.
EXPLAIN
output describes how tables are joined. The following list describes the
EXPLAIN
[646]
[646]
[646]
tables are very fast because they are read only once.
const
is used when you compare all parts of a
tbl_name
WHERE primary_key=1;
tbl_name
[646]
and
[646]
const
can be used for indexed columns that are compared using the
ref_table,other_table
ref_table,other_table
[646]
is used if the join uses only a leftmost prefix of the key or if the key is not
ref
or
index (in other words, if the join cannot select a single row based on the
UNIQUE
Output Format
Extra
Information.
PRIMARY KEY
can be used as a
tbl_name
types, this is the best possible join type. It is used when all parts
PRIMARY KEY
646
[646]
const
or
index to constant
UNIQUE
[646]
table:
const
or
UNIQUE NOT NULL
operator. The
=
[646]
join to process
eq_ref
key
join type.
index.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents