You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2025/11/16 14:37:17 UTC

[I] Improve IndexMetaDataUtils.getActualIndexName to reduce index name too long problem [shardingsphere]

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

   ## Feature Request
   
   ### Is your feature request related to a problem?
   Yes.
   
   Related code
   ```
   IndexMetaDataUtils.java
       public static String getActualIndexName(final String logicIndexName, final String actualTableName) {
           return Strings.isNullOrEmpty(actualTableName) ? logicIndexName : logicIndexName + UNDERLINE + actualTableName;
       }
   ```
   When executing create table SQL with index, SQL will be rewritten and index name will be changed to longer. `actualTableName` will be appended which might cause index name too long on underlying database.
   
   ### Describe the feature you would like.
   1. If index names are scoped to the table, e.g. MySQL, looks it's not need to append `actualTableName` on index name. 
   
   2. If index names are scoped to the schema, e.g. PostgreSQL, could we append shorter string?
   2.1) Use short random string
   2.2) Find unique integer for every actual table of sharding / broadcast / single table
   


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


Re: [I] Improve IndexMetaDataUtils.getActualIndexName to reduce index name too long problem [shardingsphere]

Posted by "ym0506 (via GitHub)" <gi...@apache.org>.
ym0506 commented on issue #37123:
URL: https://github.com/apache/shardingsphere/issues/37123#issuecomment-3994661152

   My understanding is that `IndexMetaDataUtils.getActualIndexName` can generate names that exceed the index-name length limit in some cases. I plan to make the generated name length-safe while keeping it deterministic and unique (e.g., truncate + stable hash suffix), and add tests for max-length and collision-related edge cases.


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


Re: [I] Improve IndexMetaDataUtils.getActualIndexName to reduce index name too long problem [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #37123: Improve IndexMetaDataUtils.getActualIndexName to reduce index name too long problem
URL: https://github.com/apache/shardingsphere/issues/37123


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