Week-2 - Major Storage Layouts Flashcards
List the 5 layers of computer memory
1) CPU - Registers
2) L1 Cache
3) L2 Cache
4) Main Memory
5) Hard Disk - secondary storage
Why is the processing speed of a traditional computer hard disk lower than a modern solid state drive (SSD)?
1) Because a hard disk can only read pages in sequence.
2) Because solid state drive is a mechanical device.
3) Because the size of a solid state drive is bigger than that of a hard disk.
4) Because hard disk is a mechanical device.
4) Because hard disk is a mechanical device.
Contrary to solid state drives, a hard disk has to spin and spend
DB data is stored as a file organized as a?
A set of Page(s) on the Hard Disk
DB File Organization
Method of arranging a file of records on external storage organized by Record ID (rid) like a primary ID
What is a Buffer Manager
The buffer manager is a software component that loads
the pages from disk into the main memory of the computer system, so that the database system can process this information.
Why did we use Buffers
you cannot load everything into the main memory at once,
you load it just a bit page by page
The file and index layer makes call to?
Buffer Manager to ask for data to be retrieved form the Hard Disk
Heap Files System
A heap file is an unordered set of records, stored on a set of pages. This class provides basic support for inserting, selecting, updating, and deleting records. Temporary heap files are used for external sorting and in other relational operators.
Easy insert of data (append)
Sorted File System
Sorted File Method –In this method, As the name itself suggest whenever a new record has to be inserted, it is always inserted in a sorted (ascending or descending) manner. Sorting of records may be based on any primary key or any other key.
Indexes File System
Data structure to organize records via a trees or hashing
Heap Files use what data structure
Linked List with Pointers
Best cost measure of accessing a file
Number page accesses (using I/O costs)
Three Advantages of a heap file
Efficient
1) Bulk load data
2) Small relations/tables don’t need overhead of indexing
3) Good for queries fetching large proportion of stored records
Two Disadvantages of heap file
Not Efficient
1) for selective queries
2) for storing
Benefits of Indexes
1) Fast Queries