Week 3 - Transactions and Concurrency Flashcards

1
Q

transactions - What is a schedule?

A

A schedule is
an organization of the transactions that
interleave the actions of these transactions from a database perspective.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Serial Schedule

A

schedule that does NOT interleave the actions of different transactions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Equivalent Schedule

A

For any database state, the effect of executing the first schedule is identical to the effect of executing the second schedule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Serializable Schedule

A

A schedule that is equivalent to some serial execution of the transactions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Two Schedule are in Conflict equivalent if (2 items)

A

1) Involve the same actions of the same transactions

2) Every pair of conflicting actions is ordered the same way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Schedule S is conflict serializable if ?

A

S is conflict equivalent to some serial schedule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a conflicting action

A

A conflicting action is when a transaction is
writing into something and the other transaction wants to read that data item.

Because that might lead to confusion,
might lead to inconsistency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When are two schedules conflict equivalent?

1) If they have the same actions of the same transactions.
2) If they have the same actions of two different transactions but are ordered the same in both schedules.
3) If they have the same actions of the same transactions, and every pair of conflicting actions has the same order in both schedules.

A

3) If they have the same actions of the same transactions, and every pair of conflicting actions has the same order in both schedules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Dependency Graph

A

Has transaction T2 written or read any item that has been last written by transaction T1

(bad banking example)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the result of the following database transaction if the initial values of both A and B is 100?

BEGIN

A=A+100A=A+100A=A+100

B=A+100B=A+100B=A+100

END

1) A=200, B=200
2) A=100, B=200
3) A=200, B=100
4) A=200, B=300

A

4) A=200, B=300

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Consider the following two database transactions with initial values of A=500 and B=500:

T1:A=A+100,B=A−100T1: A=A+100, B=A-100T1:A=A+100,B=A−100

T2:A=A∗1.06,B=B∗1.06T2: A=A1.06, B=B1.06T2:A=A∗1.06,B=B∗1.06

Assuming T1 arrives first, what will be the final values of A and B if the two transactions are processed using a serial schedule?

1) A=636, B=568.16
2) A=630, B=561.80
3) A=636, B=530
4) A=630, B=530

A

3) A=636, B=530

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Consider the following two database transactions with initial values of A=500 and B=500:

T1:A=A+100,B=A−100T1: A=A+100, B=A-100T1:A=A+100,B=A−100

T2:A=A∗1.06,B=B∗1.06T2: A=A1.06, B=B1.06T2:A=A∗1.06,B=B∗1.06

Assuming T1 arrives first, what will be the final values of A and B if the database management system interleaves transactions?

1) A=630, B=530
2) A=636, B=568.16
3) A=630, B=561.80
4) A=636, B=530

A

2) A=636, B=568.16

How well did you know this?
1
Not at all
2
3
4
5
Perfectly