Quickstart: Create a dedicated SQL pool workload classifier using the Azure portal
In this quickstart, you will create a workload classifier for assigning queries to a workload group. The classifier will assign requests from the ELTLogin
SQL user to the DataLoads
workload group. Follow the Quickstart: Configure workload isolation tutorial to create the DataLoads
workload group. This tutorial will create a workload classifier with the WLM_LABEL option to help further classify requests correctly. The classifier will assign HIGH
workload importance to these requests as well.
If you don't have an Azure subscription, create a free Azure account before you begin.
Sign in to the Azure portal
Sign in to the Azure portal.
Note
Creating a dedicated SQL pool instance in Azure Synapse Analytics may result in a new billable service. For more information, see Azure Synapse Analytics pricing.
Prerequisites
This quickstart assumes you already have a dedicated SQL pool instance that you have CONTROL DATABASE permissions. If you need to create one, use Create and Connect - portal to create a dedicated SQL pool called mySampleDataWarehouse.
A workload group DataLoads
exists. See the Quickstart: Configure workload isolation tutorial to create the workload group.
Important
Your dedicated SQL pool must be online to configure workload management.
Create a login for ELTLogin
Create a SQL Server authentication login in the master
database using CREATE LOGIN for ELTLogin
.
IF NOT EXISTS (SELECT * FROM sys.sql_logins WHERE name = 'ELTLogin')
BEGIN
CREATE LOGIN [ELTLogin] WITH PASSWORD='<strongpassword>'
END
;
Create user and grant permissions
After the login is created, a user needs to be created in the database. Use CREATE USER to create the SQL user ELTRole
in the mySampleDataWarehouse. Since we will test the classification during this tutorial, grant ELTLogin
permissions to mySampleDataWarehouse.
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = 'ELTLogin')
BEGIN
CREATE USER [ELTLogin] FOR LOGIN [ELTLogin]
GRANT CONTROL ON DATABASE::mySampleDataWarehouse TO ELTLogin
END
;
Configure workload classification
Classification allows you to route requests, based on a set of rules, to a workload group. In the Quickstart: Configure workload isolation tutorial we created the DataLoads
workload group. Now you will create a workload classifier to route queries to the DataLoads
workload group.
Navigate to your mySampleDataWarehouse dedicated SQL pool page.
Select Workload management.
Select Settings & classifiers on the right-hand side of the
DataLoads
workload group.Select Not configured under the Classifiers column.
Select + Add classifier.
Enter
ELTLoginDataLoads
for Name.Enter
ELTLogin
for Member.Choose
High
for Request Importance. Optional, normal importance is default.Enter
fact_loads
for Label.Select Add.
Select Save.
Verify and test classification
Check the sys.workload_management_workload_classifiers
catalog view to verify existence of the ELTLoginDataLoads
classifier.
SELECT * FROM sys.workload_management_workload_classifiers WHERE name = 'ELTLoginDataLoads'
Check the sys.workload_management_workload_classifier_details catalog view to verify classifier details.
SELECT c.[name], c.group_name, c.importance, cd.classifier_type, cd.classifier_value
FROM sys.workload_management_workload_classifiers c
JOIN sys.workload_management_workload_classifier_details cd
ON cd.classifier_id = c.classifier_id
WHERE c.name = 'ELTLoginDataLoads'
Run the following statements to test classification. Ensure you are connected as ELTLogin
and Label
is used in query.
CREATE TABLE factstaging (ColA int)
INSERT INTO factstaging VALUES(0)
INSERT INTO factstaging VALUES(1)
INSERT INTO factstaging VALUES(2)
GO
CREATE TABLE testclassifierfact WITH (DISTRIBUTION = ROUND_ROBIN)
AS
SELECT * FROM factstaging
OPTION (LABEL='fact_loads')
Verify the CREATE TABLE
statement classified to the DataLoads
workload group using the ELTLoginDataLoads
workload classifier.
SELECT TOP 1 request_id, classifier_name, group_name, resource_allocation_percentage, submit_time, [status], [label], command
FROM sys.dm_pdw_exec_requests
WHERE [label] = 'fact_loads'
ORDER BY submit_time DESC
Clean up resources
To delete the ELTLoginDataLoads
workload classifier created in this tutorial:
Click on 1 Classifier on the right-hand side of the
DataLoads
workload group.Click on Classifiers.
Click on the
...
to the right of theELTLoginDataLoads
workload classifier.Click on Delete.
Click on Save.
You're being charged for data warehouse units and data stored in your dedicated SQL pool. These compute and storage resources are billed separately.
- If you want to keep the data in storage, you can pause compute when you aren't using your dedicated SQL pool. By pausing compute, you're only charged for data storage. When you're ready to work with the data, resume compute.
- If you want to remove future charges, you can delete your dedicated SQL pool.
Follow these steps to clean up resources.
Sign in to the Azure portal, select your dedicated SQL pool.
To pause compute, select the Pause button. When the dedicated SQL pool is paused, you see a Start button. To resume compute, select Start.
To remove your dedicated SQL pool so you're not charged for compute or storage, select Delete.
Next steps
Monitor your workload using the Azure portal monitoring metrics. See Manage and monitor Workload Management for details.