Sunday, April 28, 2013

Teradata Request Processing

When a SQL query request is submitted to the Teradata Database Server, the following steps occur:
  1. Parsing Engine performs the following:
    1. Parser - Searches the Request Cache if the request is already there.
    2. Syntaxer - Checks the syntax of the request.
    3. Resolver - Resolves object names(Database,Table,etc.) to internal identifiers from the Data Dictionary
    4. Security - Checks the Data Dictionary for all the necessary privileges.
    5. Optimizer
      1. Optimize - It determines the most cost effective way to process the request.
      2. Lock - Optimizer checks the request whether to place locks on any object.
    6. Generator - Transforms the optimized parse tree into plastic steps and caches the steps into the Request Cache if needed.
    7. gncApply - Binds in parameterized data if exists and transforms plastic steps into concrete steps.
    8. Dispatcher performs the following:
      1. Receive - Receives concrete steps
      2. Dispatch - Places the first step on the BYNET and tells the BYNET whether this step is for one/several/all AMPs and waits for completion response.
      3. Response - Receives completion response from all the expected AMPs and places the next step on the BYNET. This continues until all steps are complete.
  2. AMPs - AMPs pick up the steps from the BYNET and processes the step.