A method for execution by at least one processing module of a database system, comprising:
- determining a query expression indicating a query for execution;
- generating a query operator execution flow based on a nested ordering of a plurality of operators indicated by the query expression, wherein generating the query operator execution flow includes:
- identifying an OR operator of the query expression;
- generating a plurality of parallel sub-flows of the query operator execution flow based on a plurality predicates of the OR operator in the nested ordering of the plurality of operators;
- and
- generating a plurality of serial sub-flows of the query operator execution flow based on the OR operator of the query expression, wherein a first consecutive one of the plurality of serial sub-flows includes an identifier appending operator, wherein a second consecutive one of the plurality of serial sub-flows includes a tee operator, wherein a third consecutive one of the plurality of serial sub-flows includes the plurality of parallel sub-flows from the tee operator, and wherein a fourth consecutive one of the plurality of serial sub-flows includes a union distinct operator applied to the plurality of parallel sub-flows;
- and;
- facilitating execution of the query by applying the query operator execution flow to a plurality of rows indicated by the query, wherein each of the plurality of rows includes a set of column values for each of a set of columns for the plurality of rows, wherein each the plurality of rows are assigned an appended identifier by applying the identifier appending operator, wherein the each of the plurality of rows are duplicated by applying the tee operator for processing by applying each of the plurality of parallel sub-flows, and wherein applying the union distinct operator removes all remaining duplicated ones the plurality of rows outputted by the plurality of parallel sub-flows by utilizing the appended identifiers;
- wherein at least two of the plurality of rows are identical based on having equivalent column values for all of the set of columns, wherein the at least two of the plurality of rows are assigned different appended identifiers based on being identical, and wherein none of the at least two of the plurality of rows are removed by applying the union distinct operator based on being assigned the different appended identifiers;
- and
- wherein applying the identifier appending operator includes generating a new column for the plurality of rows that indicates a plurality of appended identifiers assigned to the plurality of rows, wherein the each of the plurality of rows is assigned the appended identifier as a corresponding new column value of the each of the plurality of rows for the new column, wherein applying the tee operator includes duplicating the each of the plurality of rows based on duplicating column values of the each of the plurality of rows for each of the set of columns and further based on duplicating the column value of the each of the plurality of rows for the new column, and wherein the union distinct operator removes all remaining duplicated ones the plurality of rows outputted by the plurality of parallel sub-flows based on processing the set of columns and the new column for the plurality of rows, wherein the union distinct operator removes at least one duplicated one the plurality of rows outputted by the plurality of parallel sub-flows based on identifying multiple ones of the plurality of rows having corresponding equivalent column values for all of the set of columns and further having equivalent new column values for the new column, and wherein the none of the at least two of the plurality of rows are removed by applying the union distinct operator based on all of the at least two of the plurality of rows having different new column values for the new column.