This is inspired by this StackOverflow question. I have this code:
SELECT CONVERT(INT, SUM(reserved_page_count) * 8 / 1024) FROM sys.dm_db_partition_stats
for detecting database space consumption and it returns exactly the same result as SQL Azure management portal pie chart. The problem is the number fluctuates greatly without apparent reasons - sometimes it's around 35% and sometimes it's around 54%.
This is kinda worrying - I don't get what happens and the major concern is that we suddenly consume all the space and our service comes to a halt.
I seriously tried to look into
sys.partitions but they look like a pile of magic numbers to me.
What data should I use to find the root cause of the fluctuations?