Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 31, 2023
2 parents a081c76 + c80819a commit 5311e65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XCode/Entity/EntitySession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ private Int64 GetCount(Int64 count)
}

// 查真实记录数,修正FastCount不够准确的情况
if (/*count >= 0 &&*/ count < 10_000_000)
var fastCountMin = XCodeSetting.Current.FastCountMin;
if (count < fastCountMin)
{
var builder = new SelectBuilder
{
Expand Down
4 changes: 4 additions & 0 deletions XCode/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public class XCodeSetting : Config<XCodeSetting>
/// <summary></summary>
[Description("表名称、字段名大小写格式。Default 根据模型生成;Upper 全大写;Lower 全小写;Underline下划线")]
public NameFormats NameFormat { get; set; } = NameFormats.Default;

/// <summary>快速统计最小数据量</summary>
[Description("快速统计最小数据量。默认一千万,在对数据表进行无条件 count 时,先进行快速统计。如果快速统计的结果大于该值,则使用快速统计的结果。反之则进行 count(*) 操作获取精确统计。")]
public int FastCountMin { get; set; } = 10_000_000;
#endregion

#region 方法
Expand Down

0 comments on commit 5311e65

Please sign in to comment.