SQL Server – When to Map All Partitions to the Same Filegroup

sql servert-sql

I was studying "Partition Function" and "Partition Schema" in SQL-Server in MSDN. I found this syntax that maps all partitions to the same filegroup.
For example:

CREATE PARTITION FUNCTION myRangePF3 (int)  
AS RANGE LEFT FOR VALUES (1, 100, 1000);  
GO  
CREATE PARTITION SCHEME myRangePS3  
AS PARTITION myRangePF3  
ALL TO ( test1fg );

My question is that what is the key point in doing this?
Is this even called partitioning???
When do we usually map all partitions to the same filegroup?

Best Answer

Partitioning a table with all of the partitions on the same filegroup gives you the following benefits:

  • Partition elimination in queries
  • Ability to partition switch within the filegroup
  • Rowgroups cannot be split across partitions for CCIs which can lead to better rowgroup elimination in queries
  • Incremental statistics as of SQL Server 2014
  • Other maintenance operations can be done at the partition level such as rebuilds
  • Different behavior for parallel scans which can be helpful in some cases.

These benefits are also present when putting partitions on different filegroups, except when noted otherwise.

One reason to put partitions on different filegroups is when you want to put older data on a filegroup that's mapped to a slower tier of storage.