CMU Intro to Database Systems Flashcards
why do we not use flat file system for storage?
we cannot ensure the integrity of the database and by that we can find ourselves changing our application code multiple times
what are the relational model pillars?
1 - structure : the definition of the database relations and their contents
2 - integrity : ensures the database satisfy constraints
3 - manipulation : programming interface for accessing and modifying a database contents
does database store it’s data on one file or more?
more than one file to not reach the max limit of file size on OS
what is a storage manager?
it is responsible for maintaining database files
what does a storage manager do?
it organizes database files as a collection pages
- tracking data read/written pages
- tracking the available space
what is a page?
it is a fixed sized of a block of data
what are the characteristics of a page?
1 - it may contain anything from indexed, metadata , tuples
2 - most systems do not mix page types
3 - some systems required that each page is self contained meaning each page will have the meta data sufficient to interpret the page itself
what does the DBMS do to map page ids to physical locations?
an indirection layer
what are the notions of pages?
1 - hardware page
2- OS page
3 - Database Page
what are the ways that a DBMS organize pages on a disk?
1 - Heap Organization
2 - sequential or sorted file organization
3 - hashing file organization
what is heap file organization?
is an unordered collection of pages where tuples are stored in random order
why is heap file organization unordered?
because we use SQL to get the data so the data do not need to be ordered for us to get the data
what are the ways to represent heap file organization?
1 - linked list
2 - page directory
how do we use linked list to represent heap file organization?
- we have a header that has two pointers
1 - a pointer to free header list
2 - a pointer to a data header list
3 - each list is double linked so we can go forward and back
4 - each page contains the amount of free slots it has
do we use linked list or page directory for heap file organization?
we use page directory