Tuesday 12 February 2013

9.Parsing Engine

The Parsing Engine

A
Parsing Engine (PE) is a virtual processor (vproc). It is made up of the
following software components: Session Control, the Parser, the
Optimizer, and the Dispatcher.
Once a valid session has been established, the PE is the component that
manages the dialogue between the client application and the RDBMS.
Each PE can handle up to 120 sessions, and each session can handle
multiple requests.

Session Control
The major functions performed by Session Control are logon and logoff.
Logon takes a textual request for session authorization, verifies it, and
returns a yes or no answer. Logoff terminates any ongoing activity and
deletes the session’s context.

Parser
The Parser interprets SQL statements, checks them for proper SQL
syntax and evaluates them semantically. The PE also consults the Data
Dictionary to ensure that all objects and columns exist and that the user
has authority to access these objects.

Optimizer
The
Optimizer is responsible for developing the least expensive plan to
return the requested response set. Processing alternatives are evaluated
and the fastest plan is chosen. This plan is converted to executable steps,
to be performed by the AMPs, which are then passed to the dispatcher. In
order to maximize throughput and minimize resource contention, the
optimizer must know about
system configuration, available units of
parallelism
(AMPs and PE's), and data demographics. The Teradata
Optimizer is robust and intelligent. The optimizer enables Teradata to
handle multiple complex, ad hoc queries efficiently. It is
parallel-aware
and
cost-based and uses full look-ahead capability.

Dispatcher
The Dispatcher controls the sequence in which the steps are executed
and passes the steps on to the BYNET. It is composed of executioncontrol
and response-control tasks. Execution control receives the step
definitions from the Parser and transmits them to the appropriate AMP(s)
for processing, receives status reports from the AMPs as they process the
steps, and passes the results on to response control once the AMPs have
completed processing. Response control returns the results to the user.
The Dispatcher sees that all AMPs have finished a step before the next
step is dispatched. Depending on the nature of the SQL request, a step
will be sent to one AMP, or broadcast to all AMPs.

No comments:

Post a Comment