throws StandardException {
TransactionController tc = lcc.getTransactionExecute();
trace(1, "writing new stats (xid=" + tc.getTransactionIdString() + ")");
UUID table = td.getUUID();
DataDictionary dd = lcc.getDataDictionary();
UUIDFactory uf = dd.getUUIDFactory();
// Update the heap row count estimate.
setHeapRowEstimate(tc, td.getHeapConglomerateId(), numRows);
// Drop existing index statistics for this index.
if (!lcc.dataDictionaryInWriteMode()) {
dd.startWriting(lcc);
}
dd.dropStatisticsDescriptors(table, index, tc);
boolean conglomerateGone = false; // invalidation control flag
// Don't write statistics if the table is empty.
if (numRows == 0) {
trace(2, "empty table, no stats written");
} else {
// Construct and add the statistics entries.
for (int i=0; i < cardinality.length; i++) {
StatisticsDescriptor statDesc = new StatisticsDescriptor(
dd, uf.createUUID(), index, table, "I",
new StatisticsImpl(numRows, cardinality[i]),
i+1);
dd.addDescriptor(statDesc, null,
DataDictionary.SYSSTATISTICS_CATALOG_NUM, true, tc);
}