8.2.1.5 Engine Condition pushdown optimization engine optimization condition push

Source: Internet
Author: User

8.2.1.5 Engine Condition pushdown optimization engine optimization condition push

This optimization improves the efficiency of direct comparisons in a non indexed column and a constant, in which case the condition is pushed into the storage engine for evaluation,

This optimization can only be used by the NDB storage engine.

MySQL Cluster, the optimizer can eliminate the need to send mismatched records through the network in Cluster data nodes and MySQL Server execution query,

Suppose the MySQL Cluster table is defined as follows:

CREATE TABLE T1 (
A INT,
b INT,
KEY (a)
) Engine=ndb;

Conditional push can be used for queries, as shown in the figure above, which includes comparisons between non indexed columns and a constant
SELECT A, b from t1 WHERE B = 10;

The use of condition Pushdown can is 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 to used with either to these two queries:

However, conditional push cannot be used in the following 2 queries:

SELECT a,b from t1 WHERE a = 10;
SELECT a,b from t1 WHERE B + 1 = 10;

Conditional push is not applicable to the first query because one index has column A. (The access method for one index becomes more efficient, so a conditional push is selected)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.