Not medical advice, but for folks looking to supplement with Mg, it's best to avoid Magnesium oxide, as it is very poorly absorbed. Magnesium chloride and Magnesium bisglycinate are much better absorbed.
There are charts out there showing the bioavailability of different compounds. As a rule of thumb, the oxide versions of a mineral (e.g. magnesium oxide, zinc oxide) are often the cheapest and least bioavailable versions.