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/01/07 10:51:37 UTC
[GitHub] [shardingsphere] RaigorJiang opened a new issue #14609: [DistSQL] Add a syntax `SHOW UNUSED SHARDING ALGORITHMS`
RaigorJiang opened a new issue #14609:
URL: https://github.com/apache/shardingsphere/issues/14609
Hi community,
### Background
Now, when there are unused sharding algorithms in the metadata, users can use DistSQL to drop them.
For example:
1. User created a sharding algorithm, but never created a SHARDING TABLE RULE to use it;
2. User dropped the SHARDING TABLE RULE which using a algorithm, but did not drop the corresponding algorithm;
At the same time, users can view all sharding algorithms through `SHOW SHARDING ALGORITHMS,` but they do not know which algorithms are not in used when viewing them.
### Aim
Therefore, I suggest adding a new syntax to help users quickly find algorithms that can be cleaned up and improve the efficiency of operation and maintenance. The syntax is as follows:
```sql
SHOW UNUSED SHARDING ALGORITHMS [FROM schemaName]
```
### How to
1. Refer to `ShardingAlgorithmQueryResultSet` to get all the sharding algorithms `algorithms`;
2. Traverse all `ShardingTableRuleConfiguration` and `ShardingAutoTableRuleConfiguration`, parse out the name of the algorithms being used, and remove them from `algorithms`;
3. return `algorithms`, which is the collection of unused sharding algorithms.
--
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] yx9o commented on issue #14609: [DistSQL] Add a syntax `SHOW UNUSED SHARDING ALGORITHMS`
Posted by GitBox <gi...@apache.org>.
yx9o commented on issue #14609:
URL: https://github.com/apache/shardingsphere/issues/14609#issuecomment-1007317858
I want to try.
--
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] yx9o commented on issue #14609: [DistSQL] Add a syntax `SHOW UNUSED SHARDING ALGORITHMS`
Posted by GitBox <gi...@apache.org>.
yx9o commented on issue #14609:
URL: https://github.com/apache/shardingsphere/issues/14609#issuecomment-1007317858
I want to try.
--
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] RaigorJiang closed issue #14609: [DistSQL] Add a syntax `SHOW UNUSED SHARDING ALGORITHMS`
Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #14609:
URL: https://github.com/apache/shardingsphere/issues/14609
--
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