Quiz 3 Flashcards
What is the purpose of indexing?
Speeds up data retrieval by avoiding full table scans.
What is a primary index?
Built on primary key; one entry per record; sorted.
What is a secondary index?
Built on non-primary key; may point to multiple records.
Define a dense index.
Every key value has an index entry.
Define a sparse index.
One index entry per block; fewer entries, more efficient for storage.
What is a multi-level index?
Index built over an index for scalability.
What is hashing?
Converts key to hash for fast lookup. Static or dynamic.
What are B+-Trees used for?
Balanced tree used for indexing; great for range queries.
How do you insert into B+-Trees?
Insert → Split if needed → Push middle key up.
What is a clustered index?
Physical data order matches index order; only one per table.
What is an unclustered index?
Logical ordering via pointers; table data unordered.
What is the SQL command for creating an index?
CREATE INDEX idx_name ON table(col);
What are best practices for indexing?
Index frequently queried columns, avoid over-indexing.
What is relational algebra (RA)?
Abstract way to write queries: σ (select), π (project), ⋈ (join).
What does logical plan equivalence refer to?
Two RAs are equivalent if same output for all valid inputs.
What are examples of equivalence in RA?
Selection pushdown, join associativity, commutativity.
What is cardinality estimation?
Predicting the number of rows a query step will return.
What is direct client access?
App directly connects to DB (less secure).
What is server access?
App uses a middle layer (more secure, scalable).
What does the CIA model stand for?
Confidentiality, Integrity, Availability.
What is authentication?
Verifying user identity.
What is authorization?
Verifying permissions.
What is role-based access control?
Permissions assigned to roles, roles assigned to users.
What is discretionary access control?
Data owner assigns access directly.