Chapter 10 - 1 Nested Schemes Flat schemes often have replicated data values. Nested schemes allow us to collapse some of these replicated data values.

Slides:



Advertisements
Similar presentations
Chapter 23 Minimum Spanning Tree
Advertisements

CS 336 March 19, 2012 Tandy Warnow.
Register allocation Morgensen, Torben. "Register Allocation." Basics of Compiler Design. pp from (
Compiler Construction Sohail Aslam Lecture Finite Automaton of Items Then for every item A →  X  we must add an  -transition for every production.
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Chapter Secondary Storage Rough Speed Differentials –nanoseconds: retrieve data in main memory –microseconds: retrieve from disk cache or under a.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
FUNDAMENTAL PROBLEMS AND ALGORITHMS Graph Theory and Combinational © Giovanni De Micheli Stanford University.
NestedRelations: 1 Nested Relations Flat schemas often have replicated data values in their relations. Nested schemas allow us to collapse some of these.
Chapter Design Objectives Obtain the theoretically “best” design (normalize) –Remove redundancy and update anomalies –Remove nulls –Minimize the.
XNF: 1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Chapter Abstraction Concrete: directly executable/storable Abstract: not directly executable/storable –automatic translation (as good as executable/storable)
FDImplication: 1 Functional Dependencies (FDs) Let r(R) be a relation and let t  r, then the restriction of t to X  R, written t[X], is the projection.
Graphs and Trees This handout: Trees Minimum Spanning Tree Problem.
FileOrg: 1 Secondary Storage Rough Speed Differentials –nanoseconds: retrieve data in main memory –microseconds: retrieve from under a read head –milliseconds:
OSM—Normalize Then Map. ER Model Instance Type  RackRate Room Date  Guest Rate Discount Date  Discount Rate = (1 – Discount/100)  RackRate includes.
Producing XML Documents with Guaranteed “Good” Properties David W. Embley Brigham Young University Wai Y. Mok University of Alabama in Huntsville Sponsored.
Trees and Red-Black Trees Gordon College Prof. Brinton.
Chapter Database Design Purpose: organize to achieve efficiency, … Considerations –time/space tradeoff for application –balance application characteristics,
XNF-1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Chapter 9: Huffman Codes
Create, Insert, Delete, Update. Create Create database Create table Create index – Primary – Secondary.
Organizing files for performance Chapter Data compression Advantages of reduced file size Redundancy reduction: state code example Repeating sequences:
CostAnalysis: 1 Cost Analysis Rule-of-Thumb Guidelines As a guide, consider denormalizing if: –redundancy is minimal and update anomalies are not expected.
QueryRewriting: 1 Query Rewriting (for Query “Optimization”) Main Strategy: Make intermediate results small by applying selection and projection early.
Chapter Implementation Faithful translation of a design into a target environment Design should be free of target-environment dependencies Should.
Design Algorithm Essentials 1.Combine functional edges with the same tail object set(s) into a scheme. (The tail object set(s) and any others in a 1-1.
MVDs: 1 Join Dependencies—Example Let r = A B C = A B |  | A C 1 a x 1 a 1 x 1 a y 1 b 1 y 1 b x 2 a 2 y 1 b y 2 b 2 a y 2 b y Observe: r =  AB r | 
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
Chapter 61 Chapter 6 Index Structures for Files. Chapter 62 Indexes Indexes are additional auxiliary access structures with typically provide either faster.
7-1 Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall Network Flow Models Chapter 7.
Shortest Route, Minimal Spanning Tree and Maximal Flow Models
S EARCHING AND T REES COMP1927 Computing 15s1 Sedgewick Chapters 5, 12.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
Trees & Forests D. J. Foreman. A Forest A BC R ST DE F.
Chapter Algorithms 3.2 The Growth of Functions 3.3 Complexity of Algorithms 3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
Chapter 10 Designing the Files and Databases. SAD/CHAPTER 102 Learning Objectives Discuss the conversion from a logical data model to a physical database.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
RelAlg: 1 Relational Algebra An Algebra is a pair: (set of values, set of operations) Note that an algebra is the same idea as an ADT Relational Algebra:
COSC 2007 Data Structures II
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
SQL: 1 SQL Correspondence with Relational Algebra select A from r where B = 1 Assume r(AB) and s(BC). select B from r except select B from s select A as.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
Heaps, Heap Sort, and Priority Queues. Background: Binary Trees * Has a root at the topmost level * Each node has zero, one or two children * A node that.
Fibonacci Heaps. Fibonacci Binary insert O(1) O(log(n)) find O(1) N/A union O(1) N/A minimum O(1) O(1) decrease key O(1) O(log(n)) delete O(log(n) O(log(n))
Network Simplex Animations
Priority Queues Chuan-Ming Liu
Optimal Merging Of Runs
Normalisation Exercise
More Graph Algorithms.
Chapter 9: Huffman Codes
Optimal Merging Of Runs
Faloutsos & Pavlo SCS /615 Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization.
Minimum Spanning Tree.
CSE 373 Data Structures and Algorithms
CSE 373: Data Structures and Algorithms
Relational Database Design
Trees-2, Graphs Data Structures with C Chpater-6 Course code: 10CS35
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Chapter Nested Schemes Flat schemes often have replicated data values. Nested schemes allow us to collapse some of these replicated data values. NrBeds RoomNr NrBeds ( RoomNr )*

Chapter Redundancy in Nested Schemes The redundancy definition is the same as for flat relations. If a value change causes a constraint violation, the value is redundant. NrBeds (RoomNr (View)* )* 2 1 Sea Forest City 2 Sea Forest 3 City View (RoomNr NrBeds)* Sea Forest City

Chapter Algorithm 10.3 Input: a canonical, acyclic, binary ORM hypergraph. Output: a set of nested schemes with no potential redundancy. Repeat Mark an unmarked node in as the first attribute in a new nested scheme. While an unmarked edge is incident on a marked node A: Mark the edge. If A  B: Add B with A; Mark B. If A  B: Add B with A; Mark B if all B’s incident edges are marked. If A  B: Nest B under A; Mark B. Else (A – B): Nest B under A; Mark B if all B’s incident edges are marked. Until all nodes have been marked

Chapter Nested Scheme Generation Example 1. NrBeds (RoomNr, RoomName, Cost (View)* (GuestNr, GuestName)* )* 2. RoomNr, RoomName, Cost, NrBeds (View)* (GuestNr, GuestName)* 3. GuestNr GuestName RoomNr RoomNr, RoomName, Cost, NrBeds (View)*

Chapter Redundancy Prevention xa1yb2zxa1yb2z A ( BC )* ax1 y1 by1 z2 This replication... … causes this redundancy.

Chapter Generalization of Algorithm 10.3 for N-ary Relationship Sets “Composite nodes” can be treated as a node (in Algorithm 10.3). –B C (A)* (D)* –D (B C)*; A B C NNF (see Exercise 10.35), basically: –Schemes should be constructed along hypergraph paths. –Schemes should not violate the natural 1-many hierarchical structure.

Chapter Guidelines for Selecting Nested Schemes Select “important nodes” as the initial nodes for nested-scheme generation – e.g., Scheme 3 or 2 in earlier Bed-&-Breakfast example. Maximize the size of schemes. –Select nodes included in the largest number of FD closures (i.e., when Algorithm 10.3 requires a new node to be arbitrarily selected, compute the set of unmarked nodes in the FD closure of every unmarked node and choose a node included in at least as many sets as any other node) – e.g., Scheme 1 in earlier example. –When possible, adjust these generated maximal schemes by placing the most important node first – e.g., Scheme 2 in earlier example.

Chapter Cost Analysis for Nested Schemes Nested schemes impose variable-length records. Recall variable-length record implementation strategies: –Reserve enough space for maximum. –Chain each nested record. –Reserve space for the expected number and chain the rest. Insertion, deletion, modification, retrieval tradeoffs.