Skip to content

FOR 标签拼接效率低下问题 #126

Description

@chnzhang

SmartSql version 4.1.29

Database Mysql and 5.7

Steps to reproduce

总写入数据条数:1000

( ?Id, ?SysUserId, ?UserWechatId, ?OriginalWechatId, ?CustomWechatId, ?NickName)

Repository:
[Statement(Id = "SaveBatch")]
int SaveBatch(IList list);
Service:
Console.WriteLine("开始时间:" + DateTime.Now);
UserWechatFriendsRepository.SaveBatch(insertFriends);
Console.WriteLine("结束时间:" + DateTime.Now);

Expected result

打印:
开始时间:2019/12/19 20:46:38
结束时间:2019/12/19 20:49:21
3分钟时长

Actual result

//手动拼接sql
string sql = CreateSql(insertFriends);
Console.WriteLine("执行开始时间:" + DateTime.Now);
UserWechatFriendsRepository.SqlMapper.Execute(new SmartSql.RequestContext
{
Scope = nameof(UserWechatFriends),
SqlId = "Insert",
RealSql = sql
});
Console.WriteLine("执行结束时间:" + DateTime.Now);

打印:
执行开始时间:2019/12/20 11:07:01
执行结束时间:2019/12/20 11:07:02
时长:1s

Stack trace

总结:For标签的拼接效率极低,希望可以改进

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions