Oracle 5.0 Reference Manual page 684

Table of Contents

Advertisement

[mysqld]
engine_condition_pushdown=1
At runtime, enable condition pushdown with either of the following statements:
SET engine_condition_pushdown=ON;
SET engine_condition_pushdown=1;
Limitations.
• Condition pushdown is supported only by the
• Columns may be compared with constants only; however, this includes expressions which evaluate
to constant values.
• Columns used in comparisons cannot be of any of the
• A string value to be compared with a column must use the same collation as the column.
• Joins are not directly supported; conditions involving multiple tables are pushed separately where
possible. Use
8.3.1.6.
Optimization
IS NULL
MySQL can perform the same optimization on
col_name =
with
IS NULL
Examples:
SELECT * FROM
SELECT * FROM
SELECT * FROM
WHERE
key_col=const1
If a
clause includes a
WHERE
NULL, that expression is optimized away. This optimization does not occur in cases when the
NOT
column might produce
JOIN.
MySQL can also optimize the combination
is common in resolved subqueries.
used.
This optimization can handle one
Some examples of queries that are optimized, assuming that there is an index on columns
table t2:
SELECT * FROM t1 WHERE
SELECT * FROM t1, t2 WHERE t1.a=t2.a OR t2.a IS NULL;
SELECT * FROM t1, t2
WHERE (t1.a=t2.a OR t2.a IS NULL) AND t2.b=t1.b;
SELECT * FROM t1, t2
WHERE t1.a=t2.a AND (t2.b=t1.b OR t2.b IS NULL);
SELECT * FROM t1, t2
WHERE (t1.a=t2.a AND t2.a IS NULL AND ...)
Optimizing
Engine condition pushdown is subject to the following limitations:
EXPLAIN EXTENDED
constant_value. For example, MySQL can use indexes and ranges to search for
[877].
tbl_name
WHERE
key_col
tbl_name
WHERE
key_col
tbl_name
OR
key_col=const2
col_name IS NULL
anyway; for example, if it comes from a table on the right side of a
NULL
EXPLAIN
IS NULL
t1.a=expr
OR t1.a IS NULL;
Statements
SELECT
NDBCLUSTER
BLOB
to determine which conditions are actually pushed down.
col_name IS NULL
IS NULL;
<=> NULL;
OR
key_col
IS NULL;
[877]
condition for a column that is declared as
col_name = expr OR col_name IS
shows
ref_or_null
[877]
for any key part.
664
storage engine.
or
types.
TEXT
[877]
that it can use for
[647]
when this optimization is
NULL
LEFT
NULL, a form that
and
of
a
b

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents