Oracle 5.0 Reference Manual page 683

Table of Contents

Advertisement

SELECT a, b FROM t1 WHERE b = 10;
The use of condition pushdown can be seen in the output of EXPLAIN:
mysql>
EXPLAIN SELECT a,b FROM t1 WHERE b = 10\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: t1
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 10
Extra: Using where with pushed condition
However, condition pushdown cannot be used with either of these two queries:
SELECT a,b FROM t1 WHERE a = 10;
SELECT a,b FROM t1 WHERE b + 1 = 10;
Condition pushdown is not applicable to the first query because an index exists on column a. (An index
access method would be more efficient and so would be chosen in preference to condition pushdown.)
Condition pushdown cannot be employed for the second query because the comparison involving the
nonindexed column
is indirect. (However, condition pushdown could be applied if you were to reduce
b
to
b + 1 = 10
b = 9
Condition pushdown may also be employed when an indexed column is compared with a constant
using a
or
operator:
>
<
mysql>
EXPLAIN SELECT a, b FROM t1 WHERE a < 2\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: t1
type: range
possible_keys: a
key: a
key_len: 5
ref: NULL
rows: 2
Extra: Using where with pushed condition
Other supported comparisons for condition pushdown include the following:
column [NOT] LIKE pattern
must be a string literal containing the pattern to be matched; for syntax, see
pattern
Section 12.5.1, "String Comparison
column IS [NOT] NULL
column IN (value_list)
Each item in the
value_list
column BETWEEN constant1 AND constant2
and
constant1
constant2
In all of the cases in the preceding list, it is possible for the condition to be converted into the form of
one or more direct comparisons between a column and a constant.
Engine condition pushdown is disabled by default. To enable it at server startup, set the
engine_condition_pushdown
lines:
Optimizing
SELECT
in the
clause.)
WHERE
Functions".
must be a constant, literal value.
must each be a constant, literal value.
[449]
system variable. For example, in a
663
Statements
file, use these
my.cnf

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents