You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even with plan cache hits, high cpu on tryLockMDLAndUpdateSchemaIfNecessary is observed, the table has over 1 thousands columns. seems the loops on tbl.Meta().Columns caused high cpu usage, need to see if anyway to optimize the cpu usage when the number of column on the table is high.
// Check the column change.
for _, col := range tbl.Meta().Columns {
if col.State != model.StatePublic {
continue
}
found := false
for _, coll := range tableInfo.Columns {
if col.Name.L == coll.Name.L && col.ID != coll.ID {
logutil.BgLogger().Info("public column changed", zap.String("column", col.Name.L), zap.String("old_col", coll.Name.L), zap.Int64("new id", col.ID), zap.Int64("old id", coll.ID))
found = true
break
}
}
if found {
if !skipLock {
sctx.GetSessionVars().GetRelatedTableForMDL().Delete(tableInfo.ID)
}
return nil, domain.ErrInfoSchemaChanged.GenWithStack("public column %s has changed", col.Name)
}
}
}
The text was updated successfully, but these errors were encountered:
Enhancement
Even with plan cache hits, high cpu on tryLockMDLAndUpdateSchemaIfNecessary is observed, the table has over 1 thousands columns. seems the loops on
tbl.Meta().Columns
caused high cpu usage, need to see if anyway to optimize the cpu usage when the number of column on the table is high.The text was updated successfully, but these errors were encountered: