// this method sets the primary key columns. It goes through all the columns // of the table, and collects the columns which are marked as primary keys void TableDesc::setPrimaryKeyColumns() { ValueIdSet primaryColumns; for ( CollIndex j = 0 ; j < colList_.entries() ; j++ ) { ValueId valId = colList_[j]; NAColumn *column = valId.getNAColumn(); if ( column->isPrimaryKey() ) { primaryColumns.insert(valId) ; // mark column as referenced for histogram, as we may need its histogram // during plan generation if ((column->isUserColumn() || column->isSaltColumn() ) && (column->getNATable()->getSpecialType() == ExtendedQualName::NORMAL_TABLE) ) column->setReferencedForMultiIntHist(); } } primaryKeyColumns_ = primaryColumns; }