Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chnzhang opened this issue Dec 20, 2019 · 0 comments
Open

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

chnzhang opened this issue Dec 20, 2019 · 0 comments
Assignees

Comments

@chnzhang
Copy link

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标签的拼接效率极低,希望可以改进

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

No branches or pull requests

2 participants