MySQL Source optimizer

Source: Internet
Author: User

after the SQL parsing process is complete, you start to enter the optimizer:The process of invocation is divided into: mysql_select:join::p repare:join::optimize:join::exec:prepare Process: Assemble each component, including: Stepup tables, fields, condition, order 1.               Tables:setup_tables_and_check_access: Check access from table_list and add tables count to Leaf_tables. Setup_tables&&check_single_table_access 2. Setup_fields
          setup_wild: If you use *, this place is to be solved in a field.           find_field_in_tables: Find out if a field exists in the table            Generate the item as field.          3. setup_without_group               setup_conds: Working with where conditions, retrieving fields in Conds                setup_order: processing order clauses, retrieving fields in order           &NBSP ;    setup_group: Working with the group clause, retrieving fields in group  optimize procedure:     1. simplify_ Joins: All external connections are changed to internal connections.      2. build_bitmap_for_nested_joins: Establish a bitmap for nested join queries.      3. Optimize_cond: Optimize where conditions                remove_eq_conds: Delete equivalent conditions      4. Prune_partitions: Partition pruning, this is only the processing of partitioned tables, non-partitioned tables do not handle      5. make_join_statistics:               table->file->stats.records; search LeadsStatistics on the table,               table->s->keys: Gets all keys for this table on the Table_share object.                update_ref_and_keys: Get index information                choose_plan:
Optimize_straight_join:
Find_best:
The process of greedy_search:exec: 1. Do_select: Breaks down join 2. Sub_select:retrieve Records 3. Evaluate_join_record: The next article begins with some experiments:
Related Article

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.