Collection Contents Index Java in the database Query optimization enhancements pdf/chap3.pdf

New Features and Upgrading Guide
   CHAPTER 3. New Features in Adaptive Server Anywhere 6.0     

Multi-processor support and improved multi-tasking


Previous releases of this software, most recently SQL Anywhere 5.5, are multi-user database management systems with full support for concurrent use by multiple connections. This section describes what is changed in Adaptive Server Anywhere to enable multi-processor support and improved multi-tasking.

Threads and CPUs 

SQL Anywhere Version 5 and other previous releases of the software have been able to handle multiple connections concurrently, but query processing has been carried out on only a single operating system thread. Consequently, even on multi-processor machines, only a single processor was used for query processing.

The data processing engine in Adaptive Server Anywhere can now run using multiple operating-system threads, and hence can take advantage of multiple processors. By default, Adaptive Server Anywhere uses the same number of operating system threads as the machine has CPU's.

What tasks can run on separate threads? 

Multi-processor support in Adaptive Server Anywhere enables transactions from separate connections to run simultaneously on separate CPU's. A single connection uses a single thread, and no single requests are split among CPUs.

Top of page  Goals of multi-processor support

Multi-processor support is implemented primarily to improve the performance of multi-user databases under a heavy load. It increases the size of database, number of users, and workload that Adaptive Server Anywhere can handle.

In short, multi-processor support raises the size of system that Adaptive Server Anywhere can handle.

Top of page  How threading works

To understand how multi-processor support works, you need to understand threads and requests.

Requests 

Suppose Adaptive Server Anywhere is being used concurrently by two users, or two connections from a single application. Each connection submits a query (or other SQL statement) to Adaptive Server Anywhere. Each of these SQL statements is a separate request to the server.

Internally Adaptive Server Anywhere, like previous versions of the software, has the ability to schedule these requests in a round robin fashion to handle multiple connections concurrently.

The figure shows a schematic illustration of two requests being processed by a single thread.

Threads 

Unlike SQL Anywhere Version 5, Adaptive Server Anywhere can also take advantage of machines that have several CPU's. Requests to Adaptive Server Anywhere are shared out among the available threads, and these operating system threads can run on the different processors at the same time.

For example, with three tasks and two threads you may get an execution schedule as follows:

No single request can be running on more than one thread at a time, but a request is not tied to a single thread. Thus, over time the load is shared evenly among the available threads.

Threads on UNIX 

On UNIX machines, each task is its own thread. That is, each thread runs just one task.

Top of page  Controlling threading behavior

There are three command-line options for the database server that control threading behavior. Not all are needed on every platform.

Top of page  Threads in SQL Anywhere Version 5

The scheduling of individual requests is a form of internal threading. In SQL Anywhere Version 5, the word threads was used to describe this internal scheduling. However, there was no multi-processor support for query processing in Version 5. The THREAD_COUNT option in Version 5 described the number of requests that could be processed concurrently.

SQL Anywhere Version 5 did use separate threads to handle network connections. However, the query-processing engine was not multi-threaded. In Version 6 the CPU-intensive query processing tasks are multi-threaded.

Top of page  Impact on single-processor machines

The changes that have been made to enable multi-processor support also have an impact on single-processor machines.

Databases being used by a single connection will see little effect from the multi-processor changes.

Multi-user databases on a single CPU will see two main effects:

Top of page  

Collection Contents Index Java in the database Query optimization enhancements pdf/chap3.pdf