DataStorage Flashcards
What is a database page (block)?
A fixed-size block of data that serves as the fundamental unit of data storage and transfer in a DBMS
What is the typical size range of database pages?
512 bytes to 32 kilobytes
What are the three key rules for database pages?
1) Pages contain only one type of data 2) A record cannot span multiple pages 3) No record is larger than a page
What are fixed-length records?
Records where all fields have a predefined fixed size
What is the main advantage of fixed-length records?
Simplicity in record access and management
What are the two main problems with fixed-length records?
1) Records may cross block boundaries 2) Difficult to delete records
What is a slotted page header?
A header containing number of record entries end of free space and location/size of each record
What are the two components of variable-length record storage?
1) Initial part with fixed-length information 2) Contents of variable-length attributes
How are variable-length attributes represented?
Using a pair (offset length) where offset shows where data begins and length shows size in bytes
What is a null-value bitmap?
A bitmap that indicates which attributes have NULL values in a record
What are the two main solutions for storing Large Objects (LOBs)?
1) Segmentation (breaking into smaller pieces) 2) File System Storage
What is heap file organization?
Records are placed anywhere in the file where space is available
What is sequential file organization?
Records are stored in sequential order based on a search key
What is multitable clustering file organization?
Records from multiple related tables are stored in the same file
What is a free-space map?
Array with one entry per block indicating the fraction of block that is free
Why is writing free-space map to disk periodically better than immediately?
Writing immediately for every update would be very expensive
What are the five main types of file organization?
Heap Sequential B+-tree Hashing Multitable clustering
What is table partitioning?
Dividing records into smaller relations typically based on attribute values
What is the data dictionary?
System catalog that stores metadata about the database
What are the main components of a database buffer system?
Buffer (portion of main memory) and Buffer manager (subsystem for allocation)
What is a pinned block?
A block that cannot be evicted from buffer because it’s being read by a process
What is the difference between S and X locks?
S (shared) locks for reading X (exclusive) locks for updating only one process can get X lock
What is LRU replacement policy?
Removes the block that hasn’t been accessed for the longest time
What is MRU replacement policy?
Removes the most recently used block