github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/norm/rules/max1row.opt (about)

     1  # =============================================================================
     2  # max1row.opt contains normalization rules for the Max1Row operator.
     3  # =============================================================================
     4  
     5  # EliminateMax1Row discards the Max1Row operator if its input is statically
     6  # guaranteed to have no more than one row. Removing the Max1Row operator is
     7  # important when decorrelating subqueries, as it interferes with ApplyJoin
     8  # pushdown when it's present.
     9  [EliminateMax1Row, Normalize]
    10  (Max1Row $input:* & (HasZeroOrOneRow $input))
    11  =>
    12  $input