Device event partitioning (Optional)
Device event partitioning is optional. The following scripts are included and executed with the installation and upgrade process.
-
DevEvtP7n_AddMonth.sql
-
DevEvtP7n_Migrate_Data.sql
Configuring device event partitioning
-
Run the following query to check for existing partitioning:
Select * from sys.partitions p
inner join sys.tables t on p.object_id=t.object_id
where p.partition_number<>1 and t.name = 'DeviceEvent';
-
Run the following command:
DevEvtP7n_Migrate_Data
-
Run the following query to verify the partitioning:
Select * from sys.partitions p
inner join sys.tables t on p.object_id=t.object_id
where p.partition_number<>1 and t.name = 'DeviceEvent';
-
Run the following query to view the partition details:
Select distinct table_name = o.name,
partition_index_name = i.name,
partition_index_type = i.type_desc,
partition_scheme = ps.name, partition_function = pf.name
from sys.partitions p
join sys.objects o on o.object_id = p.object_id
join sys.indexes i on p.object_id = i.object_id and p.index_id = i.index_id
join sys.data_spaces ds on i.data_space_id = ds.data_space_id
join sys.partition_schemes ps on ds.data_space_id = ps.data_space_id
JOIN sys.partition_functions pf on ps.function_id = pf.function_id
where o.name = 'DeviceEvent';
-
Run the following command:
SELECT p.partition_number AS PartitionNumber, f.name AS PartitionFilegroup, p.rows AS NumberOfRows FROM sys.partitions p JOIN sys.destination_data_spaces dds ON p.partition_number = dds.destination_id JOIN sys.filegroups f ON dds.data_space_id = f.data_space_id WHERE OBJECT_NAME(OBJECT_ID) = 'DeviceEvent';