Top Banner
The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth
30

The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Dec 24, 2015

Download

Documents

Felix Gilmore
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Next - Generation Database Management System

Michael StonebrakerGreg Kemnitz

Presented by: Nirav S. Sheth

Page 2: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Services offered by DBMS are of 3 kinds

• Traditional Data Management– Simple data type

• Object Management– Nontraditional data types, e.g. bitmaps, icons, text,

polygons…• Knowledge Management

– Store and enforce a collection of rules that are a part of a semantics of an application

Page 3: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Example

An application that stores and manipulates text and graphics to facilitate the layout of Newspaper copy

• Data: customer information

• Object: text, pictures and icons

• Rules: control newspaper layout

Page 4: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The Postgres Data Model and query Language

• Three criteria guided the design of a new data model and query language for Postgres

- Orientation toward database access from a query language

- Orientation toward multilingual access

- Small number of concepts

Page 5: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Orientation toward database access from a query language

• Postgres users interact with database by using the set oriented query language-POSTQUEL

• Postgres gives each record a unique identifier

• Postgres allows a user to define functions(methods) to the DBMS

Page 6: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Orientation toward multilingual access

• Postgres could have tightly been coupled to the compiler and the run time environment of a specific language

• But most databases are accessed by programs written in several different languages

• Postgres is Multilingual

• POSTGRES is programming language neutral

Page 7: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Small number of concepts

• As few concepts as possible so that users have minimum complexity to contend with

• Four constructs:• Class

• Inheritance

• Type

• Function

Page 8: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Data Model - Class

• Class: a named collection of instances of objects

• Instances: has the same collection of attributes and each attribute is of specific type

• Users can create a new class by specifying the class name, along with all attribute names and their types

Page 9: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Data Model - Inheritance

• A class can inherit data elements from other classes

• Multiple inheritance – only create objects without ambiguity

Page 10: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Three kinds of classes

• Real: instances are stored in the database• Derived(view or virtual class): instances are not

physically stored but are materialized only when necessary

• Version: store differential relative to its base class– Initially has all instances of the base class– Updates to the version do not affect the base

class– Updates to the base class are reflected in the

version

Page 11: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Data Model - Types

• Postgres contains an abstract data type(ADT) facility whereby any user can construct arbitrary new base types such as bits, bitstrings, encoded character strings, bitmaps, compressed integers, etc.

• Array of base types supported by Postgres

• Composite types allow to construct complex objects i.e. attributes which contain other instances as or all of their value

Page 12: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Composite Types

• Two kinds are:

- Zero or more instances of any class is automatically a composite type

- Set, whose value is a collection of instances from all classes

Page 13: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

POSTGRES notion of Functions

• Three different kinds of Functions are known to Postgres

- C functions

- Operators

- POSTQUEL functions

Page 14: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

C Functions

• These are Arbitrary C procedures

• Arguments of C functions are base or composite types

• C functions can be defined to POSTGRES while the system is running and are dynamically loaded when required during query execution

• Inherited down the class hierarchy

• Can not be optimized by the POSTGRES

Page 15: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Operators

• Operators utilize indexes

• Functions with one or two operands

• It is imperative that a user be able to construct new access methods to provide efficient access to instances of non traditional base types. Operators allow this

Page 16: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

POSTQUEL

• Set-oriented query language that resembles a superset of a relational query language

• Support nested queries

• Transitive closure

• Support for inheritance

• Support for time travel

Page 17: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Reasons for FAST PATH

• There are a variety of decision support applications in which the end user is given a specialized query language

• It is necessary for the run time system to assign a unique identifier to every persistent object it constructs

Page 18: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The Rules System

• Requirements:

– Referential integrity

– View management

– Triggers

– Integrity constraints

– Protection

– Version control

Page 19: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Implementation of Rules

• Two implementations for Postgres rules:

• Through record level processing

• Query rewrite module

Page 20: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Record Level Processing

• Rules system is called when individual records are accessed, deleted, inserted or modified

• Place a marker on the record – this marker contains the identifier of the corresponding rule and the types of events to which it is sensitive

• Efficient if there are large number of rules and each covers only a few instances

Page 21: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Query rewrite module

• Perform poorly if there are large number of small scope rules

• Performs admirably if there are small number of large scope rules

Page 22: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Rule Activation Policies

• Immediate-same transaction

• Immediate-different transaction

• Deferred-same transaction

• Deferred-different transaction

• Postgres only implements the first option

Page 23: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Storage System

• Postgres implements the idea of “no-overwrite” storage manager

• Old record remains in the database whenever an update occurs and servers the purpose normally performed by a write ahead log

• Postgres log is two bits per transaction indicating whether each transaction committed, aborted, or is in progress

Page 24: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Storage System – contd.

• Two features can be exploited in a no-overwrite system

• Instantaneous crash recovery• Time travel• Stable main memory required• Trade-off is that a POSTGRES database at any

given time will have committed instances intermixed with instances that were written by aborted transactions

Page 25: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Storage System – contd.

• To support time travel, Postgres maintains two different physical collections of records, one for current data and one for historical data, each with it’s own indexes

• A demon know as vacuum cleaner runs in the background which moves records that are no longer valid from the current database to historical database

Page 26: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Implementation

• Aspects of the implementation that deserve special mention are: the process structure; extendibility; dynamic loading; and the rule wake-up

• Process Structure – Postgres runs as one process for each active user but all users share the Postgres code, buffer pool and lock table but they have private data segments

Page 27: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

The POSTGRES Implementation-contd.

• Extendibility – has been accomplished by making the parser, optimizer and execution engine entirely table driven.

• Data types, operators and functions can be added and subtracted dynamically i.e. when the system is running

• Maintains a cache of currently loaded functions and dynamically moves functions into the cache and then ages them out.

Page 28: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

POSTGRES Performance

• Better than UCB-INGRES

Page 29: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

POSTGRES Performance

Page 30: The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.

Conclusion

• POSTGRES allows an application designer to trade off performance for data independence

• Imports only specific user functions into its address space