2020-06-07 13:00
Page 1

Databases

Lecture 10: Indexes, Transactions, Authorization

Page 2

Indexes

Example

Page 3
Indexes

What is an index?

Page 4
Indexes

B-Tree

Page 5
Indexes

What indexes are there?

Page 6
Indexes

Live Demo

Using Internet Movie Database data (introduced last time)

Page 7
Indexes

What operations benefits from the use of an index

Page 8
Indexes

What search conditions can be optimized using an index?

Page 9
Indexes

What are the drawbacks of adding an index?

Page 10
Indexes

SQL Syntax summary

Page 11

Transactions

Atomicity

Page 12
Transactions → Atomicity
Page 13
Transactions

Update = Read + Write

Page 14
Transactions

Concurrent transactions

What if at the same time Bob wants to transfer 1000kr to Carl?

Page 15
Transactions

Arbitrarily interleaved access

Page 16
Transactions

Interference problems

Page 17
Transactions → Interference problems

Dirty Read

Page 18
Transactions → Interference problems

Non-repeatable Read

Page 19
Transactions → Interference problems

Phantom

Page 20
Transactions → Interference problems

Isolation levels

Page 21
Transactions → Interference problems

Another summary of isolation levels

Page 22
Transactions

The ACID properties

Database transactions are expected to have the following properties

Page 23
Transactions

Implementation techniques

Page 24
Transactions

SQL Syntax summary

Page 25
Transactions

Transactions with JDBC in Java

Page 26

Authorization and privileges

Intro

Page 27
Authorization and privileges

Databases vs file systems privileges/permissions

Page 28
Authorization and privileges
Page 29
Authorization and privileges

Roles

Page 30
Authorization and privileges

Examples

Page 31
Authorization and privileges

Granting the privilege to grant

Page 32
Authorization and privileges

Grant diagrams

Example

Page 33
Authorization and privileges

SQL Syntax summary

Page 34
Authorization and privileges → SQL Syntax summary
Page 35

Further reading