Skip to content

Improve IndexMetaDataUtils.getActualIndexName to reduce index name too long problem #37123

@sandynz

Description

@sandynz

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions