liuchaoheliang opened a new issue #8457:
URL: https://github.com/apache/shardingsphere/issues/8457
## Question
public final class SQLStatementParserEngine {
private final SQLStatementParserExecutor sqlStatementParserExecutor;
private final LoadingCache<String, SQLStatement> sqlStatementCache;
public SQLStatementParserEngine(final String databaseType) {
sqlStatementParserExecutor = new
SQLStatementParserExecutor(databaseType);
// TODO use props to configure cache option
sqlStatementCache = SQLStatementCacheBuilder.build(new
CacheOption(2000, 65535L, 4), databaseType);
}
/**
* Parse to SQL statement.
*
* @param sql SQL to be parsed
* @param useCache whether use cache
* @return SQL statement
*/
public SQLStatement parse(final String sql, final boolean useCache) {
return useCache ? sqlStatementCache.getUnchecked(sql) :
sqlStatementParserExecutor.parse(sql);
}
}
hello, from this class ,i found useCache is not any effect, because the
default value is false, is there needn't Cache?
why ? when most of the same sqls need parse ,how to guaranatee performance?
----------------------------------------------------------------
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]