use master
create resource pool RestrictedIOPool with
(
MAX_IOPS_PER_VOLUME = 30,
MIN_IOPS_PER_VOLUME = 1
);
create workload group RestrictedIOGroup
using RestrictedIOPool;
create function RestrictedIO()
returns sysname with schemabinding
as
begin
declare @GroupName sysname
if suser_name() = 'RestrictMyIO'
begin
set @GroupName = 'RestrictedIOGroup'
end
else
begin
set @GroupName = 'Default'
end
return @GroupName;
end
alter resource governor with (classifier_function = dbo.RestrictedIO)
alter resource governor reconfigure