github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/ops/enforcer.opt (about) 1 # enforcer.opt contains Optgen language definitions for "enforcer" operators 2 # that ensure result sets provide requested physical properties like row sort 3 # order and column naming. These operators are added by the optimizer on an 4 # as-needed basis, in order to wrap input expressions that do not naturally 5 # provide the desired properties. 6 # 7 # Tags 8 # 9 # Enforcer - All operators in this file are marked with the Enforcer tag, so 10 # they can be easily distinguished from Scalar and Relational 11 # operators. 12 13 # Sort enforces the ordering of rows returned by its input expression. Rows can 14 # be sorted by one or more of the input columns, each of which can be sorted in 15 # either ascending or descending order. See the Ordering field in the 16 # PhysicalProps struct. 17 [Enforcer, Telemetry] 18 define Sort { 19 # InputOrdering specifies the ordering that the sort requires 20 # from its input. It allows the optimizer and DistSQL to plan 21 # the sort using the segmented/chunk sort strategy. 22 # 23 # For a regular sort, this is empty. If it is not empty, this 24 # is a segmented sort where the input is already sorted on the 25 # specified prefix of columns. 26 InputOrdering OrderingChoice 27 }