ch8 - Chapter 8 Decomposition and Data Localization Chapter...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 8 Decomposition and Data Localization Chapter 8 Decomposition and Data Localization The first two layers of the laying scheme of last chapter. 81 QUERY DECOMPOSITION Four steps: (1) normalization; (2) analysis; (3) elimination of redundancy; and (4) rewriting. 8.11 Normalization For SQL statement, this is the normalization on predicates in WHERE clause, which may be arbitrarily complex, quantifier-free predicate, preceded by necessary quantifier ( , ) 2200 5 . Two type of normal forms: conjunctive or disjunctive . Conjunctive normal form: ( ... ) ... ( ... ) P P P P P P n m m mk 11 12 1 1 2 Disjunctive normal form: ( ... ) ... ( ... ) P P P P P P n m m mk 11 12 1 1 2 Transformation rules 1 Chapter 8 Decomposition and Data Localization 1. P P P P 1 2 2 1 2. P P P P 1 2 2 1 3. P P P P P P 1 2 3 1 2 3 ( ) ( ) 4. P P P P P P 1 2 3 1 2 3 ( ) ( ) 5. ) ( ) ( ) ( 3 1 2 1 3 2 1 P P P P P P P 6. P P P P P P P 1 2 3 1 2 1 3 ( ) ( ) ( ) 7. ( ) P P P P 1 2 1 2 8. ( ) P P P P 1 2 1 2 9. ( ) P P 1 1 The conjunctive normal form is more practical. (?) Example: SELECT ENAME FROM E, G WHERE E.EN=G.ENO AND G.JNO= J1 AND (DUR=12 OR DUR=24) The conjunctive normal form ) 24 12 ( " 1 " . . . = = = = D U R D U R J JN O G G N O G EN O E 2 Chapter 8 Decomposition and Data Localization 8.12 Analysis Objective: reject type incorrect or s emantically incorrect queries. Type incorrect undefined relation, attribute, wrong type mapping etc. Example: SELECT E# ! undefined attribute FROM E WHERE ENAME>200 ! type mismatching Semantically incorrect-- a query has some components not contributing to the query result. Fact its impossible to determine the semantic correctness of a general query. But it is possible to do so for queries not containing and . Tool of analysis query graph defined by one node representing the result relation o other nodes to represent operand relations, 3 Chapter 8 Decomposition and Data Localization and a edges of two classes-- an edge to represent a join if neither of its two nodes is the result-- an edge to represent a projection if one of its node is the result node Nodes and edges may be labeled by predicates for selection, projection or join....
View Full Document

This note was uploaded on 12/23/2009 for the course DBST 663 taught by Professor Tba during the Spring '09 term at MD University College.

Page1 / 20

ch8 - Chapter 8 Decomposition and Data Localization Chapter...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online