SQL SERVER – Total Number of Partitions Created by Partition Function

SQL SERVER - Total Number of Partitions Created by Partition Function partitionfunction0-800x597 Yesterday, I was helping one of my clients with a comprehensive Comprehensive Database Performance Health Check, we found a very strange partitioning system slowing down their overall performance. It took us a while to figure out that they are facing the performance issues with the partitioning function which they were using. The next task for us was to find out how many partitions so far has been created by the same partition function. Let us learn about that today.

It is very easy to figure out how many partitions are created by any partition function with the help of sys.partition_functions.

SELECT name,fanout,modify_date		
FROM sys.partition_functions

When you run the above function, you will get the result as displayed in the following query.

The first column is self-explanatory, it displays the name of the function. The second column fanout lists the Number of partitions created by the function. The third column modify_date lists when was the last partition created by the same function.

Once we rectified the partition function by my client, we were able to restore the performance back to the original state.

SQL SERVER - Total Number of Partitions Created by Partition Function partitionfunction

Here are a few blog posts which I had written earlier on the topic of partition functions, which you may find relevant.

It is very common to hear in industry that partitioning helps with SQL Server performance, however, my experience says while partitioning are great for data management, I have not seemed significant performance improvement. I would like to know your opinion, please leave your comment.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL DMV, SQL Function, SQL Scripts, SQL Server, Table Partitioning
Previous Post
SQL SERVER – Statistics Modification Counter – sys.dm_db_stats_properties
Next Post
SQL SERVER – QDS_LOADDB Wait and Asynchronous Load of Query Store

Related Posts

Leave a Reply