Batch insertion performance optimization

This commit is contained in:
sunkaixuan 2018-12-08 17:17:24 +08:00
parent 16915513c1
commit 747569fe41

View File

@ -126,6 +126,14 @@ namespace SqlSugar
{
StringBuilder batchInsetrSql = new StringBuilder();
int pageSize = 200;
if (this.EntityInfo.Columns.Count > 30)
{
pageSize = 50;
}
else if (this.EntityInfo.Columns.Count > 20)
{
pageSize = 100;
}
int pageIndex = 1;
int totalRecord = groupList.Count;
int pageCount = (totalRecord + pageSize - 1) / pageSize;