Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

SET PDQPRIORITY

The SET PDQPRIORITY statement allows an application to set the query priority level dynamically within a routine.

This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-SET PDQPRIORITY--+-DEFAULT-----------------------+----------><
                    +-LOW---------------------------+
                    |  (1)                          |
                    +--------OFF--------------------+
                    +-HIGH--------------------------+
                    +-resources---------------------+
                    |  (2)                          |
                    '------+-LOW--low--HIGH--high-+-'
                           +-MUTABLE--------------+
                           '-IMMUTABLE------------'
 
Notes:
  1. Dynamic Server only
  2. Extended Parallel Server only

Element Description Restrictions Syntax
high Integer value that specifies the desired resource allocation Must be in the range 1 to 100, and not less than the low value Literal Number, p. Literal Number
low Integer that specifies the minimum resource allocation Must be in the range 1 to 100, and not greater than the high value Literal Number, p. Literal Number
resources Integer that specifies the query priority level and the percent of resources to process the query Can range from -1 to 100. See also Allocating Database Server Resources. Literal Number, p. Literal Number

Usage

The SET PDQPRIORITY statement overrides the PDQPRIORITY environment variable (but has lower precedence than the MAX_PDQPRIORITY configuration parameter). The scope of SET PDQPRIORITY is local to the routine, and does not affect other routines within the same session.

The SET PDQPRIORITY statement is not supported in SPL routines.

In Dynamic Server, set PDQ priority to a value less than the quotient of 100 divided by the maximum number of prepared statements. For example, if two prepared statements are active, you should set the PDQ priority to less than 50.

In Extended Parallel Server, you can use SET PDQPRIORITY to set PDQ priority at runtime to a value greater than 0 when you need more memory for operations such as sorts, forming groups, and index builds. For guidelines on which values to use, see your IBM Informix Performance Guide.

For example, assume that the DBA sets the MAX_PDQPRIORITY parameter to 50. Then a user enters the following SET PDQPRIORITY statement to set the query priority level to 80 percent of resources:

SET PDQPRIORITY 80

When it processes the query, the database server uses the MAX_PDQPRIORITY value to factor the query priority level set by the user. The database server silently processes the query with a priority level of 40. This priority level represents 50 percent of the 80 percent of resources that the user specifies.

The following keywords are supported by the SET PDQPRIORITY statement.

Keyword
Effect
DEFAULT
Uses the setting of the PDQPRIORITY environment variable
LOW
Data values are fetched from fragmented tables in parallel. (In Dynamic Server, when you specify LOW, the database server uses no other forms of parallelism.)
OFF
PDQ is turned off (Dynamic Server only). The database server uses no parallelism. OFF is the default if you use neither the PDQPRIORITY environment variable nor the SET PDQPRIORITY statement.
HIGH
The database server determines an appropriate PDQPRIORITY value, based on factors that include the number of available processors, the fragmentation of the tables being queried, the complexity of the query, and others. IBM reserves the right to change the performance behavior of queries when HIGH is specified in future releases.
MUTABLE
PDQPRIORITY can be changed in a user session by the user.
IMMUTABLE
PDQPRIORITY cannot be changed in a user session.

The DBA typically specifies the MUTABLE or IMMUTABLE setting, which only Extended Parallel Server supports, in a sysdbopen( ) procedure.

Only Extended Parallel Server supports the HIGH and LOW keywords in the same statement, each followed by a value, to specify a range of resource levels. For more information, see Using a Range of Values.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]