Task priority is an attribute of an execution class that is set with sp_bindexeclass. The current_priority column from sp_showpsexe output shows the priority level for the current task execution settings:
sp_showpsexe
spid appl_name login_name exec_class current_priority task_affinity ------ ------------------------------ ------------------------------ ------------------------------ ---------------- ------------------------------ 6 NULL NULL NULL LOW syb_default_pool 7 NULL NULL NULL MEDIUM syb_default_pool 8 NULL NULL NULL LOW syb_default_pool 13 isql sa EC2 MEDIUM syb_default_pool
In threaded mode, the task_affinity
column
indicates the name of the thread pool. In process mode, it indicates
the name of the engine group.
Use sp_setpsexe to set the priority for a specific task. For example, to set the isql task in the example above to a priority level of HIGH, use:
sp_setpsexe 13, 'priority', 'HIGH'
When you set task priorities, consider that:
You set priorities for Adaptive Server tasks, not operating system threads.
Priorities are relative to other tasks. For example, if a user thread pool contains only tasks from a single execution class, setting the priority of that class has no effect since all tasks are running at the same priority.