ParallelMergeOptions ParallelMergeOptions ParallelMergeOptions ParallelMergeOptions Enum

定义

指定要在查询中使用的首选输出合并类型。 换言之,它指示 PLINQ 如何将多个分区的结果合并回单个结果序列。 这仅是一个提示,系统在并行处理所有查询时可能不会考虑这一点。This is a hint only, and may not be respected by the system when parallelizing all queries.

public enum class ParallelMergeOptions
public enum ParallelMergeOptions
type ParallelMergeOptions = 
Public Enum ParallelMergeOptions
继承
ParallelMergeOptionsParallelMergeOptionsParallelMergeOptionsParallelMergeOptions

字段

AutoBuffered AutoBuffered AutoBuffered AutoBuffered 2

利用系统选定大小的输出缓冲区进行合并。Use a merge with output buffers of a size chosen by the system. 在向查询使用者提供结果之前,会先将结果累计到输出缓冲区中。Results will accumulate into an output buffer before they are available to the consumer of the query.

Default Default Default Default 0

使用默认合并类型,即 AutoBuffered。Use the default merge type, which is AutoBuffered.

FullyBuffered FullyBuffered FullyBuffered FullyBuffered 3

利用整个输出缓冲区进行合并。Use a merge with full output buffers. 在向查询使用者提供任何结果之前,系统会先累计所有结果。The system will accumulate all of the results before making any of them available to the consumer of the query.

NotBuffered NotBuffered NotBuffered NotBuffered 1

不利用输出缓冲区进行合并。Use a merge without output buffers. 一旦计算出结果元素,就向查询使用者提供这些元素。As soon as result elements have been computed, make that element available to the consumer of the query.

注解

用于NotBuffered将作为流使用和输出的查询, 这在开始执行查询和生成的元素之间存在最低延迟。Use NotBuffered for queries that will be consumed and output as streams, this has the lowest latency between beginning query execution and elements being yielded. 对于某些查询 (如涉及排序 (OrderBy, OrderByDescending) 的查询), 缓冲是必需的, 并且将忽略 NotBuffered 或 AutoBuffered 的提示。For some queries, such as those involving a sort (OrderBy, OrderByDescending), buffering is essential and a hint of NotBuffered or AutoBuffered will be ignored. 但是, 只要不在查询本身中执行进一步的排序, 就可以对使用 AsOrdered 运算符创建的查询进行流式处理。However, queries that are created by using the AsOrdered operator can be streamed as long as no further sorting is performed within the query itself.

大多数AutoBuffered情况下使用; 这是默认设置。Use AutoBuffered for most cases; this is the default. 它在延迟与整体性能之间取得平衡。It strikes a balance between latency and overall performance.

如果FullyBuffered在需要信息之前可以处理整个输出, 请使用进行查询。Use FullyBuffered for queries when the entire output can be processed before the information is needed. 如果所有输出都可以在生成任何信息之前累计, 则此选项可提供最佳性能, 但它不适合用于流处理或显示部分结果中查询。This option offers the best performance when all of the output can be accumulated before yielding any information, though it is not suitable for stream processing or showing partial results mid-query.

适用于

另请参阅