예제 #1
0
        /// <summary>
        /// Determines the order index state for the output operator
        /// </summary>
        private void InitOrderIndexState()
        {
            // SkipWhile/TakeWhile needs an increasing index. However, if the predicate expression depends on the index,
            // the index needs to be correct, not just increasing.

            OrdinalIndexState requiredIndexState = OrdinalIndexState.Increasing;
            OrdinalIndexState childIndexState    = Child.OrdinalIndexState;

            if (_indexedPredicate != null)
            {
                requiredIndexState = OrdinalIndexState.Correct;
                _limitsParallelism = childIndexState == OrdinalIndexState.Increasing;
            }

            OrdinalIndexState indexState = ExchangeUtilities.Worse(childIndexState, OrdinalIndexState.Correct);

            if (indexState.IsWorseThan(requiredIndexState))
            {
                _prematureMerge = true;
            }

            if (!_take)
            {
                // If the index was correct, now it is only increasing.
                indexState = indexState.Worse(OrdinalIndexState.Increasing);
            }

            SetOrdinalIndexState(indexState);
        }
        /// <summary>
        /// Determines the order index state for the output operator
        /// </summary>
        private OrdinalIndexState OutputOrderIndexState()
        {
            // SkipWhile/TakeWhile needs an increasing index. However, if the predicate expression depends on the index,
            // the index needs to be correct, not just increasing.

            OrdinalIndexState requiredIndexState = OrdinalIndexState.Increasing;

            if (m_indexedPredicate != null)
            {
                requiredIndexState = OrdinalIndexState.Correct;
            }

            OrdinalIndexState indexState = ExchangeUtilities.Worse(Child.OrdinalIndexState, OrdinalIndexState.Correct);

            if (indexState.IsWorseThan(requiredIndexState))
            {
                m_prematureMerge = true;
            }

            if (!m_take)
            {
                // If the index was correct, now it is only increasing.
                indexState = indexState.Worse(OrdinalIndexState.Increasing);
            }
            return(indexState);
        }
        private OrdinalIndexState OutputOrderIndexState()
        {
            OrdinalIndexState increasing = OrdinalIndexState.Increasing;

            if (this.m_indexedPredicate != null)
            {
                increasing = OrdinalIndexState.Correct;
            }
            OrdinalIndexState state2 = base.Child.OrdinalIndexState.Worse(OrdinalIndexState.Correct);

            if (state2.IsWorseThan(increasing))
            {
                this.m_prematureMerge = true;
            }
            if (!this.m_take)
            {
                state2 = state2.Worse(OrdinalIndexState.Increasing);
            }
            return(state2);
        }