We have a problem with Azure SQL databases as they increase in size, mainly because of one internal system table - plan_persist_plan.
In one of the databases with a total size of 400 MB, the plan_persist_plan table is 310Mb , and the rest are mainly users of tables and indexes.
We calculate the size of the database with the following query:
SELECT sum(reserved_page_count)*8.0/1024 FROM sys.dm_db_partition_stats
To find out the size of each object, we use:
SELECT OBJECT_NAME(object_id), reserved_page_count*8.0/1024, * FROM sys.dm_db_partition_stats order by reserved_page_count desc
Can someone explain:
- Is the purpose of this table plan_persist_plan?
- How can we control its size and possibly reduce it?