Does anyone have experience with magnesium deficiency/supplements in kids?

I haven't had DD tested, but I'm wondering if her most recent sleep issues could be a result of a mag deficiency. She eats almost nothing on the list of high magnesium foods (she occasionally goes through periods of eating peanuts, but maybe once every few months).

We tried melatonin and it helps her fall asleep quickly (even if she's had a late nap), but it doesn't help her stay asleep longer than 6 hours or so. She's up at 5am. For a year she had been sleeping until 9:30-10AM every morning, sometimes 11 or even noon, so this is a BIG change. For a couple weeks when this first started she would sleep 6 hours at night and then take a 3 hour nap during the day (she hasn't napped regularly for over a year). Now that we are a few weeks into this she sleeps about 7-8 hours at night and then takes a 45 minute nap during the day. 8-9 hours of sleep is so not enough for her! She's a wreck, and so am I honestly I'm grasping at straws. We both need to sleep!