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 2022/09/02 08:06:13 UTC

[GitHub] [shardingsphere] tuichenchuxin opened a new issue, #20736: Support SQL HINT

tuichenchuxin opened a new issue, #20736:
URL: https://github.com/apache/shardingsphere/issues/20736

   ## Feature Request
   
   We have `HintManager` for users to use for hint route, But it's depends on `ThreadLocal`.
   
   We want to use SQL hint to replace HintManager for more convenient to use.
   
   ## replace `HintManager.setDatabaseShardingValue`
   ```
   /* SHARDINGSPHERE_HINT: SHARDING_DATABASE_VALUE=1 */
   SELECT * FROM t_order,t_order_item;
   ```
   ## replace `HintManager.addDatabaseShardingValue` `HintManager.addTableShardingValue`
   ```
   /* SHARDINGSPHERE_HINT: t_order.SHARDING_DATABASE_VALUE=100,t_order.SHARDING_TABLE_VALUE=100 */
   SELECT * FROM t_order,t_order_item;
   ```
   ## replace `HintManager.setWriteRouteOnly` mix sharding
   ```
   /* SHARDINGSPHERE_HINT: t_order.SHARDING_DATABASE_VALUE=100,t_order.SHARDING_TABLE_VALUE=100,t_order_item.SHARDING_DATABASE_VALUE=100,WRITE_ROUTE_ONLY=true */
   SELECT * FROM t_order,t_order_item;
   ```
   
   ## for better performance
   
   Since we have SQL parse cache, shardingSphere have a good performance. But if we have same SQL with different comment, we can not use the parse cache. So it's better to extract hint in proxy and jdbc, and remove the hint message from sql before parsing sql.
    
   ## tasks
   
   - [ ] support sql hint for sharding
   - [ ] refactor sql hint for readwrite
   - [ ] move shadow comment extracted to sql hint
   - [ ] better performance for sql hint
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1275441876

   Hi @tuichenchuxin @dongzl , could we finish this issue in 5.2.1?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1277014673

   Since this task still has some subtasks unfinished, I will move it to 5.2.2.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] lanrenbulan commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
lanrenbulan commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1283480649

   Hi, In proxy5.2.1, I tested SQL hint, but it didn't work. #21437


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1333319476

   Hi @tuichenchuxin @dongzl 
   Have we finished this?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] dongzl commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1235248918

   I want to try it. If others are interested, we can do it together.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1364867079

   Hi @tuichenchuxin and @dongzl , could it be done totally on 5.3.1?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu closed issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #20736: Support SQL HINT
URL: https://github.com/apache/shardingsphere/issues/20736


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] tuichenchuxin closed issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
tuichenchuxin closed issue #20736: Support SQL HINT
URL: https://github.com/apache/shardingsphere/issues/20736


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] dongzl commented on issue #20736: Support SQL HINT

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #20736:
URL: https://github.com/apache/shardingsphere/issues/20736#issuecomment-1275459667

   > Hi @tuichenchuxin @dongzl , could we finish this issue in 5.2.1?
   
   Hi @strongduanmu ,what's the deadline for Release 5.2.1? I think only part of the work can be done.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org