ch17-updated-2019-03-08 Flashcards

(55 cards)

1
Q

What is a transaction?

A

A unit of program execution that accesses and possibly updates various data items.

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

What is the atomicity requirement in transactions?

A

Either all operations of the transaction are properly reflected in the database or none are.

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

What does the durability requirement state?

A

Once a transaction has completed, the changes must persist even if there are system failures.

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

Define the consistency requirement in transactions.

A

A transaction must see a consistent database, and execution must preserve the consistency of the database.

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

What is the isolation requirement?

A

Each transaction must be unaware of other concurrently executing transactions.

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

What are the ACID properties of transactions?

A
  • Atomicity
  • Consistency
  • Isolation
  • Durability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the possible states of a transaction?

A
  • Active
  • Partially committed
  • Failed
  • Aborted
  • Committed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a schedule in transaction processing refer to?

A

A sequence of instructions that specify the chronological order in which instructions of concurrent transactions are executed.

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

What is conflict serializability?

A

A schedule is conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting instructions.

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

What is view serializability?

A

A schedule is view serializable if it is view equivalent to a serial schedule.

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

What is the significance of a precedence graph in testing for conflict serializability?

A

A schedule is conflict serializable if and only if its precedence graph is acyclic.

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

What is a recoverable schedule?

A

If a transaction reads a data item previously written by another transaction, the commit operation of the first must appear before the commit operation of the second.

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

What is a cascading rollback?

A

A single transaction failure leads to a series of transaction rollbacks.

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

Define cascadeless schedules.

A

Schedules where cascading rollbacks cannot occur; the commit operation of a transaction appears before any transaction that reads its data.

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

What is the goal of concurrency control in databases?

A

To ensure that all possible schedules are either conflict or view serializable, and are recoverable and preferably cascadeless.

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

Fill in the blank: A transaction that cannot proceed due to a logical error is in the _______ state.

A

Failed

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

True or False: All conflict serializable schedules are also view serializable.

A

True

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

What happens if a transaction fails after step 3 and before step 6 in a fund transfer?

A

Money will be ‘lost’, leading to an inconsistent database state.

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

What is the benefit of executing multiple transactions concurrently?

A

Increased processor and disk utilization, leading to better transaction throughput.

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

What does the term ‘conflicting instructions’ refer to?

A

Instructions that access the same data item and at least one of which writes to that data item.

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

What is the main issue with erroneous transaction logic?

A

It can lead to an inconsistent database state.

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

What is the significance of ensuring isolation in transaction processing?

A

It prevents other transactions from accessing a partially updated database, maintaining consistency.

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

What algorithmic complexity is associated with cycle-detection in precedence graphs?

A

Order n^2 time, with better algorithms taking order n + e.

24
Q

Fill in the blank: A transaction that has successfully completed is in the _______ state.

25
What must be ensured about the final write operation in view equivalence?
The same transaction must perform the final write operation in both schedules.
26
What is the goal of developing concurrency control protocols?
To assure serializability ## Footnote Serializability ensures that transactions are executed in a way that the end result is the same as if they had been executed in some serial order.
27
What are the necessary characteristics of schedules for database consistency?
Must be conflict or view serializable, and recoverable, preferably cascadeless ## Footnote Cascadeless schedules prevent cascading rollbacks, which can lead to lost updates.
28
What is a policy that generates serial schedules?
Only one transaction can execute at a time ## Footnote This policy provides a poor degree of concurrency.
29
What do concurrency-control schemes trade off?
The amount of concurrency they allow and the amount of overhead they incur.
30
What types of schedules can some concurrency control schemes generate?
Conflict-serializable schedules and view-serializable schedules that are not conflict-serializable.
31
What do concurrency-control protocols ensure about schedules?
They are conflict/view serializable, recoverable, and cascadeless.
32
Do concurrency control protocols examine the precedence graph during creation?
No, they impose a discipline that avoids non-serializable schedules.
33
What is the purpose of tests for serializability?
To help understand why a concurrency control protocol is correct.
34
What is an example of a weak level of consistency?
Read-only transaction that wants an approximate total balance of all accounts.
35
What can be traded off for performance in weak consistency applications?
Accuracy.
36
What is the default level of consistency in SQL-92?
Serializable.
37
What does Repeatable Read level of consistency ensure?
Only committed records to be read; repeated reads of the same record must return the same value.
38
What allows successive reads of a record to return different values?
Read committed level of consistency.
39
What does Read Uncommitted allow?
Even uncommitted records may be read.
40
What do lower degrees of consistency allow?
Gathering approximate information about the database.
41
What is a warning regarding some database systems?
They do not ensure serializable schedules by default.
42
How does a transaction begin in SQL?
Implicitly.
43
What are the two ways a transaction in SQL can end?
* Commit work * Rollback work
44
What happens by default in almost all database systems when a SQL statement executes successfully?
Every SQL statement commits implicitly.
45
How can implicit commit be turned off?
By a database directive.
46
What can be set at the database level regarding transactions?
Isolation level.
47
What is an example of setting the isolation level in SQL?
set transaction isolation level serializable.
48
What is a method of implementing isolation levels?
Locking.
49
What are the two types of locks mentioned?
* Shared locks * Exclusive locks
50
What do timestamps help detect?
Out of order accesses.
51
What do multiple versions of each data item allow?
Transactions to read from a 'snapshot' of the database.
52
What is an example of a transaction in SQL?
select ID, name from instructor where salary > 90000.
53
What does tuple level locking detect?
Conflicts.
54
What phenomenon is illustrated by the example involving T1 and T2?
The phantom phenomenon.
55
What is key to detecting 'predicate' conflicts?
Use some form of 'predicate locking'.