Ghislain Fourny Information Systems for Engineers Fall 2018 · Drawn from the Phenomena of...

Post on 18-Jun-2020

1 views 0 download

transcript

Ghislain Fourny

Information Systems for Engineers Fall 20188. Views and Indices

Sample tablepublications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Some queries

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

Some queries

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

Some queries

SELECT *FROM publicationsWHERE author = 'Kurt Gödel'

Some queries

author title year

varchar(30) varchar(255) int

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1901

Kurt Gödel On intuitionistic arithmetic and number theory 1911

SELECT *FROM publicationsWHERE author = 'Kurt Gödel'

Some queriesSELECT title, yearFROM publications

Some queries

title year

varchar(255) int

Drawn from the Phenomena of Capillarity 1901

A Theory of the Foundations of Thermodynamics 1903

An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

On the General Molecular Theory of Heat 1904

Mechanical Intelligence 1992

On the Electrodynamics of Moving Bodies 1905

On the Theory of Brownian Motion 1906

Mathematical Logic 2001

On the Possibility of a New Test of the Relativity Principle 1907

On intuitionistic arithmetic and number theory 1933

The Theory of Relativity 1911

SELECT title, yearFROM publications

Some queries

SELECT title, yearFROM publicationsWHERE author = 'Albert Einstein'

Some queries

title year

varchar(255) int

Drawn from the Phenomena of Capillarity 1901

A Theory of the Foundations of Thermodynamics 1903

On the General Molecular Theory of Heat 1904

On the Electrodynamics of Moving Bodies 1905

On the Theory of Brownian Motion 1906

On the Possibility of a New Test of the Relativity Principle 1907

The Theory of Relativity 1911

SELECT title, yearFROM publicationsWHERE author = 'Albert Einstein'

Some queries

SELECT author, COUNT(title) AS countFROM publicationsGROUP BY author

Some queries

author count

varchar(255) int

Albert Einstein 7

Kurt Gödel 2

Alan Turing 2

SELECT author, COUNT(title) AS countFROM publicationsGROUP BY author

Sample table

Sample table

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Alan Turing Mechanical Intelligence 1992

Alan Turing Mathematical Logic 2001

SELECT *FROM publicationsORDER BY year

Sample table

SELECT *FROM publicationsORDER BY yearLIMIT 3 OFFSET 2

Sample table

publications

author title year

varchar(30) varchar(255) int

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

SELECT *FROM publicationsORDER BY yearLIMIT 3 OFFSET 2

Views

Use caseSELECT *FROM publicationsWHERE author = 'Albert Einstein'

COUNT(SELECT *FROM publicationsWHERE author = 'Albert Einstein')

SELECT DISTINCT yearFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

SELECT titleFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

WHERE year< 1905

Use caseSELECT *FROM publicationsWHERE author = 'Albert Einstein'

COUNT(SELECT *FROM publicationsWHERE author = 'Albert Einstein')

SELECT DISTINCT yearFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

SELECT titleFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

WHERE year< 1905

Some queries

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

Some queries

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

Some queries

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publicationsWHERE author = 'Albert Einstein'

Use caseSELECT *FROM publicationsWHERE author = 'Albert Einstein'

COUNT(SELECT *FROM publicationsWHERE author = 'Albert Einstein')

SELECT DISTINCT yearFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

SELECT titleFROM (SELECT *

FROM publicationsWHERE author = 'Albert Einstein')

WHERE year< 1905

Use caseSELECT *FROM publications_by_einstein

COUNT (SELECT * FROM publications_by_einstein)

SELECT DISTINCT yearFROM publications_by_einstein

SELECT titleFROM publications_by_einsteinWHERE year< 1905

Querying a view

SELECT titleFROM publications_by_einstein

Querying a view

title

varchar(255)

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

On the General Molecular Theory of Heat

On the Electrodynamics of Moving Bodies

On the Theory of Brownian Motion

On the Possibility of a New Test of the Relativity Principle

The Theory of Relativity

SELECT titleFROM publications_by_einstein

Renaming columns in a view

CREATE VIEW publications_by_einstein2 (t, y)AS SELECT title, year

FROM publicationsWHERE author = 'Albert Einstein'

Renaming columns in a view

publications_by_einstein

t y

varchar(255) int

Drawn from the Phenomena of Capillarity 1901

A Theory of the Foundations of Thermodynamics 1903

On the General Molecular Theory of Heat 1904

On the Electrodynamics of Moving Bodies 1905

On the Theory of Brownian Motion 1906

On the Possibility of a New Test of the Relativity Principle 1907

The Theory of Relativity 1911

CREATE VIEW publications_by_einstein2 (t, y)AS SELECT title, year

FROM publicationsWHERE author = 'Albert Einstein'

Kinds of relations

Kinds of relationspublications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Tables (persisted)

Kinds of relationspublications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Tables (persisted)

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Views (named)

Kinds of relationspublications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Tables (persisted)

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Views (named)

On-the-fly-relation

author title year

varchar(30) varchar(255) int

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Kinds of relations

Kind of relation Named Persisted

Table YES YES

View YES NO

On-the-fly NO NO

Updating a view

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publicationsWHERE author = 'Albert Einstein'

Updating a view

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

INSERT INTO publications_by_einsteinVALUES ('Albert Einstein', 'foo', '1920')

Updating a view

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Albert Einstein foo 1920

INSERT INTO publications_by_einsteinVALUES ('Albert Einstein', 'foo', '1920')

Updating a view

publications_by_einstein

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Albert Einstein foo 1920

INSERT INTO publications_by_einsteinVALUES ('Albert Einstein', 'foo', '1920')

But this is virtual! Can we persist it?

Sample tablepublications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Albert Einstein foo 1920

In some cases, yes!

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publicationsWHERE author = 'Albert Einstein'

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publicationsWHERE author = 'Albert Einstein'

We can do insertions, deletions, updates.

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publications, other_tableWHERE author = 'Albert Einstein'AND year = other_table.y

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT *

FROM publications, other_tableWHERE author = 'Albert Einstein'AND year = other_table.y

This view is not updatable.

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT title

FROM publicationsWHERE author = 'Albert Einstein'

Updating a view

CREATE VIEW publications_by_einsteinAS SELECT title

FROM publicationsWHERE author = 'Albert Einstein'

This view is not updatable.

Conditions for an updatable view

Conditions for an updatable view

Only one table name in the FROM clause.

Conditions for an updatable view

Only one table name in the FROM clause.

All attributes in the SELECT clause,except those that can be NULL or have a default value.

Conditions for an updatable view

Only one table name in the FROM clause.

All attributes in the SELECT clause,except those that can be NULL or have a default value.

No usage of R itself in the WHERE clause.

Indices

Selecting query

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

FullScan

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Selecting query

SELECT *FROM publicationsWHERE author = 'Albert Einstein'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

FullScan

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein On the General Molecular Theory of Heat 1904

Alan Turing Mechanical Intelligence 1992

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the Theory of Brownian Motion 1906

Alan Turing Mathematical Logic 2001

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein The Theory of Relativity 1911

Highly selective querySELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein The Theory of Relativity 1911

Can We Do Better?

First idea: sortingSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

First idea: sortingSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

First idea: sortingSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

But how come we were so fast with this sorted version?

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

>

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

<

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

>

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary SearchSELECT *FROM publicationsWHERE title = 'Mathematical Logic'

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

=

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

Binary Search: Underlying structureOn intuitionistic arithmetic

and number theory

Drawn from the Phenomena of Capillarity

A Theory of the Foundations of Thermodynamics

An Example of a New Type of Cosmological Solutions of Einstein's

Field Equations of Gravitation

Mechanical Intelligence

Mathematical Logic

On the Possibility of a New Test of the Relativity Principle

On the Electrodynamics of Moving Bodies

On the General Molecular Theory of Heat

On the Theory of Brownian Motion

The Theory of Relativity

publications

author title year

varchar(30) varchar(255) int

Albert Einstein A Theory of the Foundations of Thermodynamics 1903

Kurt Gödel An Example of a New Type of Cosmological Solutions of Einstein's Field Equations of Gravitation 1949

Albert Einstein Drawn from the Phenomena of Capillarity 1901

Alan Turing Mathematical Logic 2001

Alan Turing Mechanical Intelligence 1992

Kurt Gödel On intuitionistic arithmetic and number theory 1933

Albert Einstein On the Electrodynamics of Moving Bodies 1905

Albert Einstein On the General Molecular Theory of Heat 1904

Albert Einstein On the Possibility of a New Test of the Relativity Principle 1907

Albert Einstein On the Theory of Brownian Motion 1906

Albert Einstein The Theory of Relativity 1911

Binary Search: Underlying structure

We have just built an

index

100

Hash indices (the fastest)

100

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

101

Hash indices (the fastest)

101

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

102

Hash indices (the fastest)

102

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20h(20)=0

Scientists

103

Hash indices (the fastest)

103

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20h(20)=0

Scientists

104

Hash indices (the fastest)

104

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20h(20)=0

Scientists

105

Hash indices (the fastest)

105

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20

19h(19)=4

Scientists

106

Hash indices (the fastest)

106

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20

-419

h(-4)=3

Scientists

107

Hash indices (the fastest)

107

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

h(-6)=1

Scientists

108

Hash indices (the fastest)

108

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

h(20)=0Scientists

109

Hash indices (the fastest)

109

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

Scientists

110

Hash indices (the fastest)

110

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

SELECT *FROM scientistsWHERE century = 19

Scientists

111

Hash indices (the fastest)

111

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

SELECT *FROM scientistsWHERE century = 19

Scientists

h(19)=4

112

Hash indices (the fastest)

112

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

SELECT *FROM scientistsWHERE century = 19

Scientists

h(19)=4

113

Hash indices (the fastest)

113

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

SELECT *FROM scientistsWHERE century = 19

Scientists

h(19)=4

114

Hash indices (the fastest)

114

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Value Records20-6

-419

SELECT *FROM scientistsWHERE century = 19

Scientists

h(19)=4

Limitations of hash indices

Limitations of hash indices

No support for range queries

Limitations of hash indices

No support for range queries

Hash function not perfect in real life

Limitations of hash indices

No support for range queries

Hash function not perfect in real life

Space requirements for collision avoidance

Binary tree

Binary tree

2 children per node

Binary tree

Balanced

Binary tree

Imbalanced

Binary tree

Balanced

Binary tree

Imbalanced

Binary tree

Rebalancing

Binary treeo

j s

be not or to

Binary treeo

j s

be not or to

Pointers to records

Design choice 1: all nodes have valuesd

b f

a c e g

Design choice 2: only leaves have valueso

j s

be not or to

Design choice 2: [)-intervalsor

not to

be not or to

Design choice 2: [)-intervalsor

not to

be not or to

< or >= or

< not >= not < to >= to

B+-treeo

j s

be not or to

B+-treeo

j s

be not or to

We could allow more children

B+-treeo

j s

be not or to

m

let

B+-treeo

j s

be not or to

m

let

Disks block access

B+-tree example

almost carefully

fair

is Laertes

most

be

come hour mymerely

it takepossess

that

should

youupon yourthine

timethy to

this

possess

come is merely that thy upon

B+-tree example

almost carefully

fair

is Laertes

most

be

come hour mymerely

it takepossess

that

should

youupon yourthine

timethy to

this

possess

come is merely that thy upon

All leaves at same depth

B+-tree example

almost carefully

fair

is Laertes

most

be

come hour mymerely

it takepossess

that

should

youupon yourthine

timethy to

this

possess

come is merely that thy upon

All non-leaf nodes have between 3 and 5 children

4 4

2

B+-tree example

almost carefully

fair

is Laertes

most

be

come hour mymerely

it takepossess

that

should

youupon yourthine

timethy to

this

possess

come is merely that thy upon

4 4

2

But it's fine if the root has less.

B+-tree example

almost carefully

fair

is Laertes

most

be

come hour mymerely

it takepossess

that

should

youupon yourthine

timethy to

this

possess

come is merely that thy upon

Actual values only at the leaves

B+-tree example

General case: #children between d+1 and 2d+1

B+-tree example

3-5 B+-tree2-3 B+-tree1-1 B+-tree

4-7 B+-tree

General case: #children between d+1 and 2d+1

Warning: intervals!

1 2 31 2

3 children 4 children

2 keys 3 keys

1 2 3

5 children

4 keys

4

Insertion

1

Insertion

1 2

Insertion

1 2 3

Insertion

1 2 3 4

Insertion

1 2 3 4 5

More than 4 values!

Insertion

1 2 4 5

4

3 2

3

Insertion

1 2 4 5

4

3 6

Insertion

1 2 4 5

4

3 6 7

Insertion

1 2 4 5

4

3 6 7 8

Insertion

1 2 4 5

4

3 6 7 8

Insertion

1 2 4 5

4

7

7

83 6

Insertion

1 2 4 5

4

7

7

83 6 9

Insertion

1 2

4 7

3 4 5 7 86 9 10

Insertion

1 2

4 7

3 4 5 7 86 9 10 11

Insertion

1 2

4 7

3 4 5 7 86 9 10

10

11

Insertion

1 2

4 7

3

4 57 8

69 10

10

11

13

12

13 14 15 16

Insertion

1 2

4 7

3

4 57 8

69 10

10

11

13

12

13 14 15 16 17

Insertion

1 2

4 7

3

4 57 8

69 10

10

11

13

12

13 14 15 16 17

16

Insertion

1 2

4 7

3

4 57 8

69

10

13

11 12

13 14 15 16 17

16

10

163

Tree indices (logarithmic)

163

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

164

Tree indices (logarithmic)

164

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

20

165

Tree indices (logarithmic)

165

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

20

166

Tree indices (logarithmic)

166

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

19 20

167

Tree indices (logarithmic)

167

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

19 20-4

168

Tree indices (logarithmic)

168

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

-4 19 20

20

169

Tree indices (logarithmic)

169

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

-4 19 20

20

-6

170

Tree indices (logarithmic)

170

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

-6 -4 19 20

19

171

Tree indices (logarithmic)

171

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

Scientists

-6 -4 19 20

19

172

Tree indices (logarithmic)

172

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

SELECT *FROM scientistsWHERE century >= 19

Scientists

-6 -4 19 20

19

173

Tree indices (logarithmic)

173

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

SELECT *FROM scientistsWHERE century >= 19

Scientists

-6 -4 19 20

19

174

Tree indices (logarithmic)

174

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

SELECT *FROM scientistsWHERE century >= 19

Scientists

-6 -4 19 20

19

175

Tree indices (logarithmic)

175

Name Country CenturyEinstein Switzerland 20Gödel Austria 20Ramanujan India 19Euclid Greece -4Pythagoras Greece -6Turing UK 20

SELECT *FROM scientistsWHERE century >= 19

Scientists

-6 -4 19 20

19

176

Using an index

CREATE INDEX ByTitleON publications(title)

177

Using an index

CREATE INDEX ByTitleON publications(title)

SELECT *FROM publicationsWHERE title = 'Mathematical Logic'

178

Using an index

CREATE INDEX ByTitleON publications(title)

SELECT *FROM publicationsWHERE title = 'Mathematical Logic'

This query will take very little time!

179

Using an index

CREATE INDEX ByTitleON publications(title)

SELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

180

Using an index

CREATE INDEX ByTitleON publications(title)

SELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

This one as well!

181

Using an index

SELECT *FROM publicationsWHERE year > 1905

AND title = 'The Theory of Relativity'

CREATE INDEX ByYearON publications(year)

182

Using an index

SELECT *FROM publicationsWHERE year > 1905

AND title = 'The Theory of Relativity'This one as well (but require post-filtering by title)!

CREATE INDEX ByYearON publications(year)

183

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

184

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE title = 'The Theory of Relativity'

Not this one! (why?)

185

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE year > 1905

186

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE year > 1905

This one will be fast(er).

187

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE year > 1905 AND author = 'Albert Einstein'

188

Using an index

CREATE INDEX ByYearON publications(year)

SELECT *FROM publicationsWHERE year > 1905 AND author = 'Albert Einstein'

This one as well (but require post-filtering by author)!

189

Compromises to make

No index Index

190

Compromises to make

No index Index

191

Compromises to make

No index Index

Faster write

Slower read

192

Compromises to make

No index Index

Faster write

Slower read

Slower write

Faster read

193

Costs

One table.

Two indices: index 1 and index 2.

194

Costs

One table.

Two indices: index 1 and index 2.

Insertion 1: Insertion into the indexed table.

Query 1: Query on the index table using index 1

Query 2: Query in the index table using index 2

195

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1Cost of Q1Cost of Q2Average

196

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2Cost of Q1 10Cost of Q2 10Average

197

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4Cost of Q1 10 2Cost of Q2 10 10Average

198

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4Cost of Q1 10 2 10Cost of Q2 10 10 2Average

199

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average

200

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average

201

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average

With many queries (say, 1000)a: percentage of Q1b: percentage of Q21-a-b: percentage of I1

202

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average

2 * (1-a-b) + 10*a+10*b With many queries (say, 1000)a: percentage of Q1b: percentage of Q21-a-b: percentage of I1

203

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average

2 * (1-a-b) + 10*a+10*b= 2 + 8a + 8b

With many queries (say, 1000)a: percentage of Q1b: percentage of Q21-a-b: percentage of I1

204

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average 2+8a+8b 4-2a+6b 4+6a-2b 6-4a-4b

205

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average 2+8a+8b 4-2a+6b 4+6a-2b 6-4a-4b

When will we prefer to have two indices to none?

206

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average 2+8a+8b 4-2a+6b 4+6a-2b 6-4a-4b

2+8a+8b > 6 – 4a – 4b

When will we prefer to have two indices to none?

207

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average 2+8a+8b 4-2a+6b 4+6a-2b 6-4a-4b

2+8a+8b > 6 – 4a – 4b

12a+12b > 4

When will we prefer to have two indices to none?

208

Costs

No index Only index 1 Only index 2 Indices 1 and 2Cost of I1 2 4 4 6Cost of Q1 10 2 10 2Cost of Q2 10 10 2 2Average 2+8a+8b 4-2a+6b 4+6a-2b 6-4a-4b

2+8a+8b > 6 – 4a – 4b

12a+12b > 4

a+b > 33%

When will we prefer to have two indices to none?