tristaZero commented on a change in pull request #7977:
URL: https://github.com/apache/shardingsphere/pull/7977#discussion_r514922920



##########
File path: docs/document/content/features/sharding/principle/parse.en.md
##########
@@ -31,8 +31,4 @@ To pursue good performance and quick achievement, the first 
generation of SQL pa
 
 The second generation of SQL parsing engine begins from 1.5.x version, 
ShardingSphere has adopted fully self-developed parsing engine ever since. Due 
to different purposes, ShardingSphere does not need to transform SQL into a 
totally abstract syntax tree or traverse twice through visitor. Using `half 
parsing` method, it only extracts the context required by data sharding, so the 
performance and compatibility of SQL parsing is further improved.
 
-The third generation of SQL parsing engine begins from 3.0.x version. 
ShardingSphere tries to adopts ANTLR as the SQL parsing engine, and plans to 
replace the former parsing engine according to the order of `DDL -> TCL -> DAL 
–> DCL -> DML –>DQL`. It is still in the process of replacement and iteration. 
Hoping for a better compatibility with SQL, we use ANTLR in the parsing engine 
of ShardingSphere. Though complex expressions, recursions, sub-queries and 
other sentences are not focused by the sharding core of ShardingSphere, they 
can influence the friendliness to understand SQL. After being tested in actual 
cases, the performance of ANTLR is about 3-10 times slower than the 
self-developed parsing engine when parsing SQL. To compensate for this gap, 
ShardingSphere will put the SQL parsing tree of `PreparedStatement` in the 
cache. Therefore, `PreparedStatement` is recommended to be used as the 
pre-compile method to improve the performance.
-
-The overall structure of the third generation of SQL parser is shown in the 
following picture.
-
-![Parsing 
Engine](https://shardingsphere.apache.org/document/current/img/sharding/parsing_architecture_en.png)
+The third generation of SQL parsing engine begins from 3.0.x version. 
ShardingSphere tries to adopts ANTLR as the SQL parsing engine, and used Visit 
to obtain SQL Statement from AST. Starting from version 5.0.x, the architecture 
of the parsing engine has been refactored. At the same time, it is convenient 
to directly obtain the parsing results of the same SQL to improve parsing 
efficiency by putting the AST obtained from the first parsing into the cache. 
Therefore, we recommend that users adopt `PreparedStatement` this SQL 
pre-compilation method to improve performance. Currently, users can also use 
ShardingSphere's SQL parsing engine independently to obtain AST and SQL 
Statements for a variety of mainstream relational databases. In the future, the 
SQL parsing engine will continue to provide powerful functions such as SQL 
formatting and SQL templating.

Review comment:
        and **used**(?) Visit 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to