The query compiler
Download
1 / 9

The Query Compiler - PowerPoint PPT Presentation


  • 141 Views
  • Uploaded on

The Query Compiler. Varun Sud ID: 104. Agenda. Parsing Syntax analysis and Parse Trees. Grammar for a simple subset of SQL Base Syntactic Categories The Preprocessor. Parsing. Three steps of query processor Parse SQL query into parse tree. Transform parse tree into expression tree.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' The Query Compiler' - vadin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
The query compiler

The Query Compiler

Varun Sud

ID: 104


Agenda
Agenda

  • Parsing

    • Syntax analysis and Parse Trees.

    • Grammar for a simple subset of SQL

    • Base Syntactic Categories

    • The Preprocessor.


Parsing
Parsing

  • Three steps of query processor

    • Parse SQL query into parse tree.

    • Transform parse tree into expression tree.

    • Transform logical query plan into physical query plan.


Syntax analysis and parse trees
Syntax analysis and parse trees

  • Parser converts SQL text to parse tree

    • Nodes of trees correspond to:

      • Atoms: lexical elements such as keywords, names of attributes or relations etc

      • Syntactic categories, which are names of families of query subparts.


Grammar for simple subset of sql
Grammar for simple subset of SQL

  • Queries

    • <Query> ::= <SFW>

    • <Query> ::= (<Query>)

  • SFW: select from were

  • ::= means “can be expressed as.”


Contd
Contd.

  • Select-From-Where Forms

    • <SFW> ::= SELECT <SelList> FROM <FromList> WHERE <Condition>

  • Select-Lists

    • <SelList> ::= <Attribute> ,<SelList>

    • <SelList> ::= <Attribute>


Contd1
Contd.

  • Conditions

    • <Condition> ::= <Condition> AND <Condition>

    • <Condition> ::= <Tuple> IN <Query>

    • <Condition> ::= <Attribute> = <Attribute>

    • <Condition> ::= <Attribute> LIKE <Pattern>

    • <Tuple> ::= <Attribute>


The preprocessor
The Preprocessor

  • Preprocessor is responsible for semantic checking.

  • Preprocessor must:

    • Check relation uses.

    • Check and resolve attribute uses

    • Check types.



ad