1.connector SQL Interactive language,php,java , etc.
2. System Management and control tools
3. connection pooling management buffering user connections, threading, etc. need for caching requirements
4.SQL Interface accepts Sql commands and returns query results
5. interpreter SQL command passed to parser for parsing and validation
The decomposition of SQL statements into a data structure the passing of statements is based on this structure
verifying The legality of SQL during parsing , parsing error does not continue parsing
6. Query optimizer
query optimization is performed before the SQL statement is parsed, (producing multiple execution plans, choosing the best)
7.cache and buffer Query cache query cache with hit query results to fetch data directly from the cache
This caching mechanism consists of a series of small caches For example, table cache key cache permission Cache
8.engine Storage Engine
A subsystem that deals with files and where data is stored and retrieved. plug-in type
the file access mechanism
9. databases are generally called by other programming languages via SQL ,andMySQL processes and returns results
The first interaction is through connector , and the request is staged connection pool managed by manager
after the request enters the processing queue from the wait queue, the manager drops the request to the SQL interface
After the SQL interface receives the request, it hashes and compares with the cached result process, and returns the result by matching
otherwise thrown to the interpreter -"parsing data structure validation SQL legal -" Optimizer optimization query plan -" Give the storage engine to the disk to get the data back to the program
10. Cache Query Data
when the storage engine finishes processing the data back to the program, it also retains a copy of the data to the cache to process the next same request
EXECUTE statement + execution result -"hash saved to cache "
11.cache and buffer differences
Buffer is a write cache and the cache is read cached
MySQL Work flow