1 / 9

The Query Compiler

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.

vadin
Download Presentation

The Query Compiler

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Query Compiler Varun Sud ID: 104

  2. Agenda • Parsing • Syntax analysis and Parse Trees. • Grammar for a simple subset of SQL • Base Syntactic Categories • The Preprocessor.

  3. 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.

  4. 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.

  5. Grammar for simple subset of SQL • Queries • <Query> ::= <SFW> • <Query> ::= (<Query>) • SFW: select from were • ::= means “can be expressed as.”

  6. Contd. • Select-From-Where Forms • <SFW> ::= SELECT <SelList> FROM <FromList> WHERE <Condition> • Select-Lists • <SelList> ::= <Attribute> ,<SelList> • <SelList> ::= <Attribute>

  7. Contd. • Conditions • <Condition> ::= <Condition> AND <Condition> • <Condition> ::= <Tuple> IN <Query> • <Condition> ::= <Attribute> = <Attribute> • <Condition> ::= <Attribute> LIKE <Pattern> • <Tuple> ::= <Attribute>

  8. The Preprocessor • Preprocessor is responsible for semantic checking. • Preprocessor must: • Check relation uses. • Check and resolve attribute uses • Check types.

  9. Thank You

More Related