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: 
[email protected]

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

Reply via email to