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

   ## Feature Request
   
   Hi thanks for the library! I wonder whether there is something like 
"secondary vindex" (a term in Vitess) in Shardingsphere?
   
   What is "secondary vindex": 
https://vitess.io/docs/15.0/reference/features/vindexes/#secondary-vindexes. 
For (a very simplified) example, suppose we have a `message` table with columns 
`chat_id`, `message_id`, `another_id`, with `chat_id` being the sharding key. 
Then, when we have a SQL like `SELECT ... WHERE another_id = 42`, the naive 
solution will make the SQL be broadcasted to *all* sharded databases, because 
it does not contain the sharding key in the query. However, if we have a 
"secondary vindex", it is similar to an auto-managed table, with column 
`another_id` and `chat_id`, and shard key being `another_id`. Then, the engine 
can use this table to know chat_id, and thus rewrite the original query with a 
chat_id value, thus quite fast.
   
   ### Is your feature request related to a problem?
   
   Yes. Like the super-simplified example above, my database does contain (a 
lot of) such queries, and broadcasting to all tables is too slow.
   
   ### Describe the feature you would like.
   
   (see above)


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