Creating user-defined execution class task affinity

The following steps illustrate how to use system procedures to create a thread pool associated with a user-defined execution class and bind that execution class to user sessions. In this example, the server is used by technical support staff, who must respond as quickly as possible to customer needs, and by managers who are usually compiling reports, and can afford slower response time.

To create the user-defined execution class for this example:

  1. Create the thread pool named DS_GROUP that governs the task. For example:

    create thread pool DS_GROUP with thread count = 4
    
  2. Use sp_addexeclass to create a user-defined execution classes that have names and attributes you choose. For example:

    sp_addexeclass DS, LOW, 0, DS_GROUP
    
  3. Use sp_bindexeclass to associate the user-defined execution class with an execution object. For example with three logins:

    sp_bindexeclass mgr1, LG, NULL, DS
    
    sp_bindexeclass mgr2, LG, NULL, DS
    
    sp_bindexeclass mgr3, LG, NULL, DS
    

Perform these steps to create a user-defined execution class if Adaptive Server is configured for process mode:

  1. Create an engine group called DS_GROUP, consisting of engine 3:

    sp_addengine 3, DS_GROUP
    

    Expand the group so that it also includes engines 4 and 5:

    sp_addengine 4, DS_GROUP
    
    sp_addengine 5, DS_GROUP
    
  2. Create a user-defined execution class called DS with a priority of “low” and associate it with the DS_GROUP engine group.

    sp_addexeclass DS, LOW, 0, DS_GROUP
    
  3. Bind the less critical execution objects to the new execution class.

    For example, bind the manager logins, “mgr1,” “mgr2,” and “mgr3,” to the DS execution class using sp_bindexeclass three times:

    sp_bindexeclass mgr1, LG, NULL, DS
    
    sp_bindexeclass mgr2, LG, NULL, DS
    
    sp_bindexeclass mgr3, LG, NULL, DS
    

    The second parameter, LG, indicates that the first parameter is a login name. The third parameter, NULL, indicates that the association applies to any application that the login might be running. The fourth parameter, DS, indicates that the login is bound to the DS execution class.

The result of this example is that the technical support group (not bound to an engine group) is given access to more immediate processing resources than the managers.