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/04/28 07:27:44 UTC

[GitHub] [shardingsphere] strongduanmu edited a comment on pull request #5327: create RANGE sharding algorithm

strongduanmu edited a comment on pull request #5327:
URL: https://github.com/apache/shardingsphere/pull/5327#issuecomment-620431368


   > After more consideration, the second one `init()` is not necessary, maybe.
   > At first, I considered to initialize `partitionRangeMap` in init(). However, that means `partitionRangeMap` will not be a final member. If so, at the multi-thread condition, it is not safe, which is more important than the performance of `doSharding()`.
   > What's your idea about this one? Wait for your kind reply.
   > 
   > Trista
   
   Hi, @tristaZero , I agree with you that thread safety is more important. We can use another way to improve performance by providing a `useCache` parameter. 
   If users configured fewer partitions, the performance should be able to meet the requirements. But if the num of partition ranges is very large, such as 100 partitions, users can set `useCache` parameter to `true`, use the cache to improve performance, just like SQLParseResultCache.


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