cancel
Showing results for 
Search instead for 
Did you mean: 

Why is max_query_tasks a database option?

10-20-2011 12:00 PM
MCMartin Participant
4639 views 9 comments Go to solution
SAP Managed Tags
Subscribe

Why is max_query_tasks a database option?

I would have expected it to be a database server option, as allowing one database to use all available tasks can have side effects on other databases. So if I want to limit the number of parallel tasks which can be consumed by one query I would expect to do this for the whole engine whithout having to configure all databases which are run in one server instance individually.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Since worker threads are a server entity, you are right to question why something like max_query_tasks is a database option rather than a server option.

Our choice in favour of the database option was largely based on two premises:

  1. For the majority of customers, particularly where SQL Anywhere is embedded with the application, the server runs a single database.
  2. It was desirable to offer a mechanism that could be altered for a particular user or connection, so that some connections could, automatically, utilize additional parallelism but other connections would be restricted from doing so.

The solution for item (2) is the database option mechanism. Item (1) makes the use of the option mechanism more palatable. Moreover, with the automatic multiprogramming level self-tuning now available with Version 12, the database option provides restrictive control over the use of parallelism, while the server self-manages the number of worker threads to maximize the server's throughput across the board.

VolkerBarth
Contributor

BTW, what role does the priority option of a connection play here?

It seems to be a further means to influence the work of one particular connection (or one particular database when using the max_priority option) w.r.t. other connections...

Former Member
0 Likes

PRIORITY impacts the scheduling of requests to workers, but is somewhat orthogonal to the degree of parallelism.

VolkerBarth
Contributor
0 Likes

...so if I would like to use parallelism for a particular connection but would like to avoid to let it use all workers I could set that connections properties/options as following:

  1. set max_query_tasks to the MultiProgrammingLevel - 1 (though v12's auto tuning might increase the level automatically...) or

  2. leave the default max_query_tasks of 0 but set the priority to Below Normal or a lower level (assuming other connections work with Normal priority).

In my understanding, both would leave at least one worker for other connections. Is this correct?

Answers (0)