You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/09 12:25:41 UTC
[GitHub] [incubator-shardingsphere] tuohai666 opened a new issue #3916: SQL
should not be cached if it does not contain a question mark
tuohai666 opened a new issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916
For now, SQLs will be cached when use a PreparedStatement regardless of the question mark. This may lead to all SQLs of a service be cached and performance declined.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] limingwei edited a comment on issue
#3916: SQL should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
limingwei edited a comment on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573391504
```
MyFactory extends DefaultShardingSpherePreparedStatementFactory {
boolean cacheThePreparedStatement ( it ) {
if ( not contains parameter marker ) {
return false;
}
return super.cachePreparedStatement( it );
}
}
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] tuohai666 commented on issue #3916: SQL
should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573020430
I think the rule should be: Use PreparedStatement and contains question mark.
An SQL without question mark will never be hit in most scenarios.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] limingwei commented on issue #3916: SQL
should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
limingwei commented on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573391504
`
MyFactory extends DefaultShardingSpherePreparedStatementFactory {
boolean cacheThePreparedStatement ( it ) {
if ( not contains parameter marker ) {
return false;
}
return super.cachePreparedStatement( it );
}
}
`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3916: SQL
should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573266501
We should not consider about whatever SQL contains parameter marker or not.
For PreparedStatement, we should cache the SQL parse result; for Statement, do not cache.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] limingwei commented on issue #3916: SQL
should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
limingwei commented on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573391104
However, this could be an extension point of our shardingsphere plugin system
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] limingwei edited a comment on issue
#3916: SQL should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
limingwei edited a comment on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-573391504
`MyFactory extends DefaultShardingSpherePreparedStatementFactory {
boolean cacheThePreparedStatement ( it ) {
if ( not contains parameter marker ) {
return false;
}
return super.cachePreparedStatement( it );
}
}`
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu closed issue #3916: SQL should
not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] limingwei commented on issue #3916: SQL
should not be cached if it does not contain a question mark
Posted by GitBox <gi...@apache.org>.
limingwei commented on issue #3916: SQL should not be cached if it does not contain a question mark
URL: https://github.com/apache/incubator-shardingsphere/issues/3916#issuecomment-572942847
What dose the rules should be
rule A: SQL include a question mark ? cache it : no cache
rule B: Use jdbc.PreparedStatement -> cache it; Use jdbc.Statement -> no cache
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services