Retired Note 1 # MySQL = lambda SQL: SQL + & #39; Source Code 4 Explain Plan & #39 ;,

Source: Internet
Author: User

Retired Note 1 # MySQL = lambda SQL: SQL + 'source Code 4 Explain Plan ',

The Mysql query execution process is roughly divided into four stages:


Syntax analysis (SQL _parse.cc <lexical analysis, syntax analysis, semantic check>)

> SQL _resolver.cc # JOIN. prepare

Generate logical query plan (SQL _optimizer.cc)

>># JOIN. optimize

Generate a physical query plan (SQL _planner.cc)

Run the explain plan (SQL _executor.cc) JOIN.exe c





JOIN. prepare ():

Remove redundant sub-queries

In subquery optimization resolve_subquery ()

Converts all/any subqueries to min/max to optimize simple subqueries.

 

JOIN. optimize ():

Pull flatten_subqueries () on the subquery ()

Optimize external connection to internal connection simplify_joins ()

Eliminate nested connections

Where clause, join/on clause, having clause simplification, expression simplification containing constants, equality merge optimize_cond () opt_sum_query ()

Optimize count (*) min () man () without the group by clause ()

Determine the multi-Table connection path make_join_statistice ()

Optimize distinct

Create temporary table store temporary results optimize group sorting choose_table_order ()


In fact, logical and physical optimization is a bit confusing and ambiguous,

After the physical query is optimized, some logic optimization is continued.





There are only two ways to scan a single table:

Index scan (others), table scan (JT_ALL)

Opt_range.h> class QUICK_SELECT_ I> use the index scanning drop-down Interface

For the child classes, see source code;











SELECT NOW(),CURDATE(),CURTIME()





1 Reading Note

Gulliver Travel Notes
Note: A person dared to go to the place where he could see my whole face. He raised his hands and looked up, expressing surprise. In a sharp and clear voice, he shouted, "Hai qinna-göl ", the rest also shouted this sentence several times, but at that time I still didn't understand what they meant. Readers can believe that it is uncomfortable for me to lie down like this and finally struggle to break away from the binding. I was so lucky that I suddenly broke the rope and pulled out the dingtalk on the ground holding my left arm. I lifted my left arm to the front and found out how they bound me. At this moment, I tried to pull it. Although it was very painful, I made a little loose by binding the rope with my hair on the left, so that I could turn my head for a moment. But before I could catch them, they ran away. They shouted in a harsh and harsh manner. After the shouting, I heard a man shouting, "tolgoz benak". In a twinkling of an eye, I think a hundred arrows have shot my left hand and stabbed me like a needle. Then they shot a while in the sky, like a European bomb, I think there are a lot of arrows falling on me (although I don't think), and some still fall on my face, so I quickly covered my face with my left hand. After a shower of arrows, I groaned with grief. After a while, I struggled to get out, and they put arrows longer than they just put, some people want to stab my waist with a spear. Fortunately, I'm wearing a cowhide vest and they cannot stab me in.
Appreciation: as soon as the novel was opened, it laid the tone of the book with a strange conception. Gulliver was blown to the desert island by a storm, and woke up and found that he was already bound by more than million people. This text vividly describes the words and deeds of the little people who first entered the perspective of Gulliver Buddha, especially the behavior that they continuously archery and sting Gulliver Buddha, laying a foreshadowing for the future progress of the plot.

The document at the beginning is simple and concise. The writer once declared: "I would rather use the simplest and simplest style to describe ordinary facts, because I write this book mainly to report to you, rather than for your entertainment ." Despite the different situations and experiences of Gulliver roaming around the world, the layout and style of the whole novel are consistent, and the causes and consequences of Gulliver's every overseas journey are explained in detail, complex Plots are described in chronological and spatial order. The texts are concise and vivid, and the stories are strong.

How can I write a notebook?

Reading Notes of Camel Xiangzi

Introduction:
Lao She (1899-1966), formerly Shu qingchun, Beijingers. Modern Chinese novelist, A Paster. Lao She has been diligent and has a great number of books. He is hailed as a "People's Artist ". The main works include "Camel Xiangzi", "four generations in the same hall", "two horses", "Tea House", and "long feigou. His work is rich in life, real characters, and refined in language. Many works have a unique "Beijing flavor" style.
Good words:
Cool, cool, cool, clear
Good Section:
1 A burst of heat in the early summer is like a magic symbol that makes the Old City Magical everywhere. It no matter whether it is death, whether it is evil, or suffering, then it will exert its power to hypnotize the hearts of millions of people, singing its praises like a dream. It is dirty, it is beautiful, it is aging, It is lively, It is messy, it is idle, it is cute, it is great in the early summer of Beijing.
Experience:
This book tells the story of the rough and miserable experiences of the old man, chefu, Xiangzi, in Beijing. The novel illustrates the oppression and exploitation and oppression of honest and kind workers in the dark old society, accused the old society of turning people into ghosts. He expressed his deep sympathy for the working people, criticized selfish and narrow-minded personalization, and revealed that the individual struggle is not the subject of the changing circumstances of the working people to get rid of poverty.

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.