Database Systems Flashcards

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

Flashcards based on lecture notes covering database hardware, RAID, data stores, indexing, query optimization, transactions, and normalization.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

Data independence

Changes can be made at one level of abstraction without impacting the others.

2
New cards

Mirroring

Duplicate disks used to protect against failure, requiring 2 writes to update.

3
New cards

Striping

Storing data across multiple disks for parallel access to speed up reads.

4
New cards

RAID

Reduces risk of disk failure; RAID-5 is optimal for high reads, low writes, RAID-1 is best for high writes.

5
New cards

Row store

Storing all data entries in one row in a block, ideal for easy updates and insertions.

6
New cards

Column store

Storing one column in each block, ideal for obtaining information about one attribute.

7
New cards

Buffer pool

A RAM cache for recently accessed data.

8
New cards

Log

A structure storing historical data (old/new values) used when a system fails; stores before-values for rollbacks.

9
New cards

Ordered index

Data sorted based on some value.

10
New cards

Clustered index

Sequentially ordered based on the search key (indexed value).

11
New cards

Unclustered index

Randomly ordered with no relation to search key. Requires seeks between each key.

12
New cards

B+ Tree

Leaf nodes ordered by search key (index) and chained, improving efficiency of range queries; access requires few I/Os.

13
New cards

Natural Join (R⋈S on R.A = S.A) - Case: one table (S) fits in RAM

Hash table with all records in S; for each record r in R, lookup r.A in table. Cost: |R| + |S|

14
New cards

Natural Join (R⋈S on R.A = S.A) - Case: neither table fits in RAM

Partition R and S into smaller pieces by hashing on A, matching records must be in same partition. Cost: 3|R| + 3|S|

15
New cards

Sort-merge join

Sort R and S on A, scan for A and merge upon match.

16
New cards

Block nested loops join (R⋈θS)

Compares all records, good for non-equijoins; divide outer table R into blocks, compare all records in S to each block. Cost: B * |S| + |R|

17
New cards

Index nested loops join (R⋈S where S has an index on A)

For all records in the outer table R, use the index on A in S to lookup r.A; ideal when indexed table is bigger than outer table

18
New cards

Left-deep trees

All joins occur on the left table; benefits: write output to disk, pipelining.

19
New cards

Query Optimization Process

Process of looking for opportunities to push selections, considering join orders, exploring left-deep plans, using dynamic programming, and comparing plans by estimating I/O cost.

20
New cards

Materialized views

Improves query performance for those that use view; cons: requires additional memory, must be initialized, needs maintenance.

21
New cards

Incremental view maintenance

Do work that’s proportional to the size of the UPDATE, not the entire table; only update what needs to be updated.

22
New cards

Transaction Properties

Atomicity, Consistency, Isolation, Durability.

23
New cards

Serial schedule

Transactions occur sequentially.

24
New cards

Serializable schedule

A schedule that is equivalent to when transactions occur sequentially, but may be interleaved.

25
New cards

Conflict equivalent schedule

When the order of conflicting operations in two schedules is the same.

26
New cards

Conflict serializable schedule

A conflict equivalent schedule that can be converted into a serial schedule.

27
New cards

Log (Transactions)

A persistent structure that stores all before/after values from transactions; important for database recovery.

28
New cards

Dependency graphs

Draw edge between nodes (transactions) to represent each conflict; all acyclic-directed graphs have a conflict-equivalent serializable schedule.

29
New cards

Locking

Shared lock requested for reads, exclusive lock requested for writes

30
New cards

Deadlock

Occurs when transactions are unable to be completed since they are infinitely waiting for each other’s resources; can be identified by a cycle.

31
New cards

2PL (Two-Phase Locking)

Characterized by gaining locks in a growing phase and releasing locks in a shrinking phase; avoids cascading aborts.

32
New cards

Timestamp-based Concurrency Control

Each action has a representative timestamp; goal: execute conflicting actions in timestamp order

33
New cards

Optimistic Concurrency Control

Assumes transactions will be able to finish execution and be validated at the end.

34
New cards

Recovery (ARIES) Phases

Analysis, Redo, Undo.

35
New cards

Update Anomaly

Causes inconsistencies across the database by updating only one instance of an attribute rather than all times it appears.

36
New cards

Insertion Anomaly

Missing/incorrect primary key or other identifier.

37
New cards

Functional dependency

A relationship between attributes that shows when one determines another.

38
New cards

Superkey

Attribute(s) that functionally determine all other columns.

39
New cards

Candidate key

Attribute(s) that can be used to identify other columns through functional dependencies.

40
New cards

Lossy/Lossless Decomposition

When information is lost after re-joining a decomposition; true if A ∩ B → A or A ∩ B → B.

41
New cards

BCNF (Boyce-Codd Normal Form)

A schema is in BCNF if for any A → B in F+ and for every table R: A → B is trivial or A is a superkey of R.

42
New cards

3NF (Third Normal Form)

A schema is in 3NF if for any A → B in F+ and every table R: A → B is trivial, A is a superkey of R, or each attribute of B - A is a part of some key for R.