ORDB Implementation Discussion. From RDB to ORDB Issues to address when adding OO extensions to DBMS system.

Slides:



Advertisements
Similar presentations
OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
Advertisements

Query Optimization Reserves Sailors sid=sid bid=100 rating > 5 sname (Simple Nested Loops) Imperative query execution plan: SELECT S.sname FROM Reserves.
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
2P13 Week 11. A+ Guide to Managing and Maintaining your PC, 6e2 RAID Controllers Redundant Array of Independent (or Inexpensive) Disks Level 0 -- Striped.
Database Management Systems 3ed, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 14, Part B.
Implementation of Other Relational Algebra Operators, R. Ramakrishnan and J. Gehrke1 Implementation of other Relational Algebra Operators Chapter 12.
Database Management Systems, R. Ramakrishnan and Johannes Gehrke1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
Xyleme A Dynamic Warehouse for XML Data of the Web.
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
ORDB Implementation Discussion. From RDB to ORDB Issues to address when adding OO extensions to DBMS system.
CS 4432lecture #61 CS4432: Database Systems II Lecture #6 Professor Elke A. Rundensteiner.
Memory Management 2010.
Physical Database Monitoring and Tuning the Operational System.
Object-Oriented Databases
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
ORDB Implementation Discussion. Ramakrishnan and Gehrke. Database Management Systems, 3 rd Edition. From RDB to ORDB Issues to address when adding OO.
1 Evaluation of Relational Operations: Other Techniques Chapter 12, Part B.
Query Execution Chapter 15 Section 15.1 Presented by Khadke, Suvarna CS 257 (Section II) Id
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Access Path Selection in a Relation Database Management System (summarized in section 2)
Memory Management Last Update: July 31, 2014 Memory Management1.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
IT The Relational DBMS Section 06. Relational Database Theory Physical Database Design.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Software School of Hunan University Database Systems Design Part III Section 5 Design Methodology.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Query Evaluation Chapter 12: Overview.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
Access Path Selection in a Relational Database Management System Selinger et al.
CSCE Database Systems Chapter 15: Query Execution 1.
Physical DB Issues, Indexes, Query Optimisation Database Systems Lecture 13 Natasha Alechina.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Query Optimization Arash Izadpanah. Introduction: What is Query Optimization? Query optimization is the process of selecting the most efficient query-evaluation.
1 CS 430 Database Theory Winter 2005 Lecture 17: Objects, XML, and DBMSs.
CPSC 404, Laks V.S. Lakshmanan1 Evaluation of Relational Operations: Other Operations Chapter 14 Ramakrishnan & Gehrke (Sections ; )
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
Optimization in XSLT and XQuery Michael Kay. 2 Challenges XSLT/XQuery are high-level declarative languages: performance depends on good optimization Performance.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
Event Data History David Adams BNL Atlas Software Week December 2001.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
1 CS457 Object-Oriented Databases Chapters as reference.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Storage Structures. Memory Hierarchies Primary Storage –Registers –Cache memory –RAM Secondary Storage –Magnetic disks –Magnetic tape –CDROM (read-only.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Relational Operator Evaluation. Overview Application Programmer (e.g., business analyst, Data architect) Sophisticated Application Programmer (e.g.,
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
Session 1 Module 1: Introduction to Data Integrity
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
The Object-Oriented Database System Manifesto Malcolm Atkinson, François Bancilhon, David deWitt, Klaus Dittrich, David Maier, Stanley Zdonik DOOD'89,
Lecture 15: Query Optimization. Very Big Picture Usually, there are many possible query execution plans. The optimizer is trying to chose a good one.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 Overview of Query Evaluation Chapter Outline  Query Optimization Overview  Algorithm for Relational Operations.
Hello world !!! ASCII representation of hello.c.
Completeness Criteria for Object- Relational Database Systems by Won Kim April 2002 Sang Ho Lee School of Computing, Soongsil University
Module 11: File Structure
Object-Oriented Databases
Database Performance Tuning and Query Optimization
Chapter 12 Outline Overview of Object Database Concepts
Physical Database Design
Chapter 11 Database Performance Tuning and Query Optimization
Evaluation of Relational Operations: Other Techniques
Query Optimization.
ORDB Implementation Discussion
Presentation transcript:

ORDB Implementation Discussion

From RDB to ORDB Issues to address when adding OO extensions to DBMS system

Layout of Data Deal with large data types : ADTs/blobs – special-purpose file space for such data, with special access methods Large fields in one tuple : –One single tuple may not even fit on one disk page –Must break into sub-tuples and link via disk pointers Flexible layout : –constructed types may have flexible sized sets,, e.g., one attribute can be a set of strings. –Need to provide meta-data inside each type concerning layout of fields within the tuple –Insertion/deletion will cause problems when contiguous layout of ‘tuples’ is assumed

Layout of Data More layout design choices (clustering on disk): –Lay out complex object nested and clustered on disk (if nested and not pointer based) –Where to store objects that are referenced (shared) by possibly several other and different structures –Many design options for objects that are in a type hierarchy with inheritance –Constructed types such as arrays require novel methods, like array chunking into (4x4) subarrays for non-continuous access

Why (Object) Identifier ? Distinguish objects regardless of content and location Evolution of object over time Sharing of objects without copying Continuity of identity (persistence) Versions of a single object

Objects/OIDs/Keys Relational keys: RDB human meaningful name (mix data value with identity) Variable name : PL give name to objects in program (mix addressability with identity) Object identifier : ODB system-assigned globally unique name (location- and data-independent )

OIDs System generated Globally unique Logical identifier (not physical representation; flexibility in relocation) Remains valid for lifetime of object (persistent)

OID Support OID generation : –uniqueness across time and system Object handling : –Operations to test equality/identify –Operations to manipulate OIDs for object merging and copying. –Deal with avoiding dangling references

OID Implementation By address (physical) –32 bits; direct fast access like a pointer By structured address –E.g., page and slot number –Both some physical and logical information By surrogates –Purely logical oid –Use some algorithm to assure uniqueness By typed surrogates –Contains both type id and object id –Determine type of object without fetching it

ADTs – Type representation : size/storage – Type access : import/export – Type manipulation : special methods to serve as filter predicates and join predicates – Special-purpose index structures : efficiency

ADTs Mechanism to add index support along with ADT: –External storage of index file outside DBMS –Provide “access method interface” a la: Open(), close(), search(x), retrieve-next() Plus, statistics on external index –Or, generic ‘template’ index structure Generalized Search Tree (GiST) – user-extensible Concurrency/recovery provided

Query Processing Query Parsing : –Type checking for methods –Subtyping/Overriding Query Rewriting: –May translate path expressions into join operators –Deal with collection hierarchies (UNION?) –Indices or extraction out of collection hierarchy

Query Optimization Core –New algebra operators must be designed : such as nest, unnest, array-ops, values/objects, etc. –Query optimizer must integrate them into optimization process : New Rewrite rules New Costing New Heuristics

Query Optimization Revisited –Existing algebra operators revisited : SELECT –Where clause expressions can be expensive –So SELECT pushdown may be bad heuristic

Selection Condition Rewriting EXAMPLE: (tuple.attribute < 50) –Only CPU time (on the fly) (tuple.location OVERLAPS lake-object) –Possibly complex CPU-heavy computations –May Involve both IO and CPU costs State-of-art: – consider reduction factor only Now, we must consider both factors: –Cost factor : dramatic variations –Reduction factor: unrelated to cost factor

Operator Ordering op1 op2

Ordering of SELECT Operators –Cost factor : now could be dramatic variations –Reduction factor: orthogonal to cost factor –We want maximal reduction and minimal cost: Rank ( operator ) = (reduction) * ( 1/cost ) –Order operators by increasing ‘rank’ –High rank : (good) -> low in cost, and large reduction –Low rank (bad) -> high in cost, and small reduction

Access Structures/Indices ( on what ?) Indices that are ADT specific Indices on navigation path Indices on methods, not just on columns Indices over collection hierarchies (trade-offs) Indices for new WHERE clause expressions not just =, ; but also “overlaps”,”similar”

Registering New Index (to Optimizer) What WHERE conditions it supports Estimated cost for “matching tuple” (IO/CPU) –Given by index designer (user?) –Monitor statistics; even construct test plans Estimation of reduction factors/join factors –Register auxiliary function to estimate factor –Provide simple defaults

Methods Use ADT/methods in query specification Achieves: – flexibility –extensibility

Methods Extensibility : Dynamic linking of methods defined outside DB Flexibility : Overwriting methods for type hierarchy Semantics : –Use of “methods” with implied semantics? –Incorporation of methods into query process may cause side-effects? –Performance of methods may be unpredictable ? –Termination may not be guaranteed?

Methods “Untrusted” methods : –corrupt server –modify DB content (side effects) Handling of “untrusted” methods : – restrict language; – interpret vs compile, –separate address space of DB server

Query Optimization with Methods Estimation of “costs” of method predicates –See earlier discussion Optimization of method execution: –Methods may be very expensive to execute –Idea: Similar as handling correlated nested subqueries Recognize repetition and rewrite physical plan. Provide some level of pre- computation and reuse

Strategies for Method Execution –1. If called on same input, cache that one result –2. If on full column, presort column first (groupby) –3. Or, in general use full precomputation: Precompute results for all domain values (parameters) Put in hash-table : fct (val ); During query processing lookup in hash-table val  fct (val) Or, possibly even perform a join with this table

Query Processing User-defined methods User-defined aggregate functions: –E.g., “second largest” or “most brightest picture” Distributive aggregates: – incremental computation

Query Processing: Distribute Aggregates For incremental computation of distributive aggregates: Provide: –Initialize(): set up state space –Iterate(): per tuple update the state –Terminate(): compute final result based on state; and cleanup state For example : “second largest” –Initialize(): 2 fields –Iterate(): per tuple compare numbers –Terminate(): remove 2 fields

Following Disk Pointers? Complex object structures with object pointers may exist (~ disk pointers) Navigate complex objects following pointers Long-running transaction like in CAD design may work with complex object for longer duration Question : What to do about “pointers” between subobjects or related objects ?

Following Disk Pointers: Options Swizzle : –Swizzle = Replace OIDs references by in-memory pointers –Unswizzle = Convert back to disk-pointers when flushing to disk. Issues : –In-memory table of OIDs and their state –Indicate in each object, pointer type via a bit. Different policies for swizzling: –never –on access –attached to object brought in

Persistence? We may want both persistent and transient data Why ? –Programming language variables –Handle intermediate data –May want to apply queries to transient data

Properties for Persistence? Orthogonal to types : –Data of any type can be persistent Transparent to programmer : –Programmer can treat persistent and non-persistent objects the same way Independent from mass storage: –No explicit read and write to persistent database

Models of Persistence Persistence by type Persistence by call Persistence by reachability

Model of Persistence : by type Parallel type systems: –Persistence by type, e.g., int and dbint –Programmer is responsible to make objects persistent –Programmer must make decision at object creation time –Allow for user control by “casting” types

Model of Persistence : by call Persistence by explicit call –Explicit create/delete to persistent space –E.g., objects must be placed into “persistent containers” such as relations in order to be kept around –Eg., Insert object into Collection MyBooks; –Could be rather dynamic control without casting –Relatively simple to implement by DBMS

Model of Persistence: by reachability Persistence by reachability : –Use global (or named) variables to objects and structures –Objects being referenced by other objects that are reachable by application, then they are also persistent by transitivity –No explicit deletes; rather need garbage collection to garbage the objects away once no longer referenced –Garbage collection techniques : mark&sweep : mark all objects reachable from persistent roots; then delete others scavenging : copy all reachable objects from one space to the other; but may suffer in disk-based environment due to IO overhead and distruction of clustering

Models of Persistence Different models of persistence for OODB implementations: Parallel type systems: –E.g., int and dbint –User must make decision at object creation time –Allow for user control by “casting” types Persistence by container management: –Objects must be placed into “persistent containers” such as relations in order to stay around –Eg., Insert o into Collection MyBooks; –Could be rather dynamic control without casting Persistence by reachability : –Use global variable names to objects and structures –Objects being referenced by other objects that are reachable by application, they by transitivity are also persistent. –need garbage collection

Tradeoffs Persistent/ transient By typeBy callBy reference Orthogonal to type At creation time/any time Can objects dynamically switch (flex) Transparent to use; DB independent Explicit control by user DBMS impl cost

Summary A lot of work to get to OO support : From physical database design/layout issues up to logical query optimizer extensions ORDB: Reuses existing implementation base and incrementally adds new features on (but relation is first-class citizen)