ascIndex = false;
break;
}
}
FromBaseTable fbt = (FromBaseTable)tableVector.firstElement();
MaxMinAggregateDefinition temp = (MaxMinAggregateDefinition)ad;
/* MAX ASC NULLABLE
* ---- ----------
* TRUE TRUE TRUE/FALSE = Special Last Key Scan (ASC Index Last key with null skips)
* TRUE FALSE TRUE/FALSE = JustDisableBulk(DESC index 1st key with null skips)
* FALSE TRUE TRUE/FALSE = JustDisableBulk(ASC index 1st key)
* FALSE FALSE TRUE/FALSE = Special Last Key Scan(Desc Index Last Key)
*/
if (((!temp.isMax()) && ascIndex) ||
((temp.isMax()) && !ascIndex))
{
fbt.disableBulkFetch();
singleInputRowOptimization = true;
}
/*
** Max optimization with asc index or min with
** desc index is currently more
** restrictive than otherwise.
** We are getting the store to return the last
** row from an index (for the time being, the
** store cannot do real backward scans). SO
** we cannot do this optimization if we have
** any predicates at all.
*/
else if (!selectHasPredicates &&
((temp.isMax() && ascIndex) ||
(!temp.isMax() && !ascIndex )))
{
fbt.disableBulkFetch();
fbt.doSpecialMaxScan();
singleInputRowOptimization = true;
}