Skip to content

[功能改进]: SqlMethod中String.format性能差 #6857

Open
@syphgxrsn

Description

@syphgxrsn

确认

  • 我的版本是最新版本, 我的版本号与 version 相同, 并且项目里无依赖冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为你的想法(不得删除 描述 前面的部分)

功能改进

com.baomidou.mybatisplus.core.injector.methods.SelectById:
SqlSource sqlSource = super.createSqlSource(this.configuration, String.format(sqlMethod.getSql(), this.sqlSelectColumns(tableInfo, false), tableInfo.getTableName(), tableInfo.getKeyColumn(), tableInfo.getKeyProperty(), tableInfo.getLogicDeleteSql(true, true)), Object.class);

String.format拼接sql的性能极差,类似的地方强烈建议建议改成字符串拼接,如有必要再做一层缓存。

参考资料

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions