We are having an issue with our SQL Azure databases, as they increase size, mainly because of one internal system table - plan_persist_plan.
In one of the databases, with a total size of 400Mb, the plan_persist_plan table represents by itself 310Mb and the rest are mainly user tables and indexes.
We calculate the database size with the following query:
SELECT sum(reserved_page_count)*8.0/1024 FROM sys.dm_db_partition_stats
To know each object size, 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 anyone please explain:
- The purpose of this table - plan_persist_plan?
- How can we control it's size and possibly shrink it?