Guaranteed resource allocation (GRA)
You can use scheduler rules or resource group assignments to classify plans into different groups, then use guaranteed resource allocation (GRA) to arrange for each group to receive a different portion of system resources.
The net system resources are the system resources that are available to process user (including admin) jobs, that is, the total system resources minus those resources that are needed to process special, high-priority system jobs.
A resource group is a Netezza Performance Server group whose resource settings (that is, its resource minimum, resource maximum, and job maximum) determine what portion of the net system resources are to be allocated to plans that are associated with that group. For example, you might create three different resource groups for the plans of data analysts, users who produce query reports, and all other users, then arrange for each of these groups to receive a different fraction of the net system resources.
Each Netezza Performance Server system has at least one resource group. This group has the name Public and cannot be dropped. When a user is created, if the user is not explicitly assigned to a resource group, the user is assigned to the Public group by default. You can change a user's resource group assignment.
- Which user submitted the corresponding job
- Each user is assigned to exactly one resource group. Each time
a user submits a job, the plans for that job are automatically associated
with the user's resource group. You can use scheduler rules to override a plan's resource group association based on the submitting user. For example, the following scheduler rule associates all plans for jobs submitted by the user bob with the resource group rsg42, regardless of the resource group to which bob is assigned:
IF USER IS bob THEN EXECUTE AS RESOURCEGROUP rsg42
- The contents of the client information fields
- An administrator or application program can set the following
client information fields in a query:
- User ID
- The user ID under which the client is running.
- Application name
- The name of the client.
- Workstation name
- The host name of the workstation on which the client runs.
- Accounting string
- The value of the accounting string from the client information that is specified for the session.
IF CLIENT_APPLICATION_NAME IS Cognos THEN EXECUTE AS RESOURCEGROUP rsg12
- Cost estimates
- For each plan, the optimizer calculates the expected cost of processing
that plan. You can use scheduler rules to associate plans with different
resource groups based on their calculated cost estimates. For example,
the following scheduler rules associate plans with the resource groups
with the names "short", "medium", and "long" based on the plans' cost
estimates:
IF ESTIMATE < 4 THEN EXECUTE AS RESOURCEGROUP short IF ESTIMATE >= 4 ESTIMATE < 30 THEN EXECUTE AS RESOURCEGROUP medium IF ESTIMATE >= 30 THEN EXECUTE AS RESOURCEGROUP long
- The database that is to be accessed
- You can use scheduler rules to associate plans with different
resource groups based on which databases the plans access. If different
tenants access different databases exclusively, you can use this capability
to manage resource allocation based on tenancy. For example, the following
scheduler rules associate plans with different resource groups based
on which database they access:
IF DATABASE IS dbx1 THEN EXECUTE AS RESOURCEGROUP x1 IF DATABASE IS dbx2 THEN EXECUTE AS RESOURCEGROUP x2
- The table that is to be accessed
- You can use scheduler rules to associate plans with different
resource groups based on which tables the plans access. In this way,
a database administrator can influence resource allocation to applications
without changing the applications themselves. For example, the following
scheduler rule associates a plan with resource group x2 if it accesses
table tab1 or tab2:
IF TABLE IN (tab1,tab2) THEN EXECUTE AS RESOURCEGROUP x2
- Custom tags
- You can add any number of tags to sessions (see Tags).
All the plans that are within the scope of that session receive the
same tag. You can also create scheduler rules that add tags directly
to all plans that meet the conditions specified by the rule. You can
then use scheduler rules to associate plans with different resource
groups based on these tags. For example, the following scheduler rule
associates a plan with a resource group based on whether one or more
of the specified tags have been set for the plan or its session:
IF TAG IN (eod,eom,eoy) THEN EXECUTE AS RESOURCEGROUP endjobs