Removing needless product attribute values

Recently, we have faced with an issue that looked like a default Magento behavior. It turns out that Magento keeps the product attribute value even if the attribute was removed from the current attribute set. This brief article describes the issue’s details and a shell script on how to remove the old unnecessary attribute values from the database.