SqlUserDefinedAggregateAttribute.IsInvariantToDuplicates 属性


指示聚合是否与重复值无关。Indicates whether the aggregate is invariant to duplicates.

 property bool IsInvariantToDuplicates { bool get(); void set(bool value); };
public bool IsInvariantToDuplicates { get; set; }
member this.IsInvariantToDuplicates : bool with get, set
Public Property IsInvariantToDuplicates As Boolean



如果聚合与重复值无关,则为 true;否则为 falsetrue if the aggregate is invariant to duplicates; otherwise false.


在查询处理器使用的情况下, true 如果聚合与重复项无关,则此属性为。Used by the query processor, this property is true if the aggregate is invariant to duplicates. 也就是说,当 X 已在中时,S、{X} 的聚合与 S 的聚合相同。例如,聚合函数(如 MIN 和 MAX)满足此属性,而 SUM 不满足。That is, the aggregate of S, {X} is the same as aggregate of S when X is already in S. For example, aggregate functions such as MIN and MAX satisfy this property, while SUM does not.

错误设置此属性可能会导致不正确的查询结果。Incorrectly setting this property can result in incorrect query results. 此属性不是优化器提示;这会影响所选的计划和查询返回的结果。This property is not an optimizer hint; it affects both the plan selected and the results returned by the query.