I am using Azure SQL Database with 10gb of storage (Standard S2: 50 DTUs). I am running a process where I am deleting all rows in a table every 6 hours and recreating and loading table from our business system. What I am noticing is that although the data in our source isn’t getting exponentially larger it seems the database is getting larger at a higher speed. I am wondering if azure SQL when dropping and recreating stores even though its deleted and counted against your total storage?
Thanks for any help on this.
2
Answers
Please defrag all indexes. As mentioned on this article, fragmentation can claim a lot space.
Run sp_helpfile to verify the log is not consuming space also. If the log is big run the following statement to recover space.
Consider also to shrink the database.
On this thread I provided some queries that may be useful about database size.
While what Alberto Morillo says is good I suspect something changed the 13/12/2022:
The options are two: