Term 
        
        | What are the main elements of the DBMS memory hierarchy? |  
          | 
        
        
        Definition 
        
        
- Cache
 
- Main Memory
 
- Secondary Storage
 
- Tertiary Storage
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are the characteristics of the Cache? |  
          | 
        
        
        Definition 
        
        
- Volatile Storage
 
- Very Fast, Very Expensive, Limited Capacity
 
- Hierarchical
 
- Typical capacities and access times
 
- Registers - 10 bytes 1 cycle
 
- L1 - ~10^4 bytes < 5 cycles
 
- L2 - ~10^5 bytes 5-10 cycles
 
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are the characteristics of Main Memory? |  
          | 
        
        
        Definition 
        
        
- Volatile storage
 
- Fast affordable, medium capacity
 
- Typical Capacity 10^11 - 10^12 bytes
 
- Typical access time 10^-8s (20-30 cycles)
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are the characteristics of Secondary Storage? |  
          | 
        
        
        Definition 
        
        
- Non Volatyle storage
 
- Slow, cheap, large capacity
 
- Typical capacity: 10^11 - 10^12 bytes
 
- Typical access time: 10^-3s (10^6 cycles)
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some characteristics of Tertiary Storage? |  
          | 
        
        
        Definition 
        
        
- Non-volatile storage
 
- Very slow, very cheap, very large capacity
 
- Typical capacity: 10^13 - 10^17 bytes
 
- Typical access time: 10 - 100 seconds
 
 
   |  
          | 
        
        
         | 
        
        
        Term 
        
        | What is the visual disk structure |  
          | 
        
        
        Definition 
        
        
- A - Track
 
- B - Geometrical Sector
 
- C - Track Sector
 
- D - Cluster
 
 
[image]  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What is the zone bit recording? |  
          | 
        
        
        Definition 
        
        
- Tracks closer to the disc edge are longer than those closer to the axis
 
- Bit densities vary in order to ensure a constant number of bits per sector
 
 
- Instead we can vary the number of sectors per track (Depending on track location)
 
- Improves overall storage density
 
 
 
   |  
          | 
        
        
         | 
        
        
        Term 
        
        | What is Disk Access Time break down to? |  
          | 
        
        
        Definition 
        
        Access time = 
Seek Time + Rotational Delay + Transfer Time  |  
          | 
        
        
         | 
        
        
        Term 
         | 
        
        
        Definition 
        
        Time taken for head assembly to move to a given track 
Avg: 4ms for high end drives; 15ms for mobile devices  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What is rotational delay? |  
          | 
        
        
        Definition 
        
        Time required for addresed area of disk to rotate into a position where it is accessible by the read/write head. 
   |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are typical transfer times? |  
          | 
        
        
        Definition 
        
        Transfer time = block size/ transfer rate 
  
Transfer rate ranges from  
- up to 1000 Mbit/sec
 
- 432 Mbit/sec 12x Blu-Ray disk
 
- 1.23 Mbits/sec 1x CD
 
- for SSDs, limited interface. e.f. SATA 3000 Mbit/s
 
 
   |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some characteristics of sequential access? |  
          | 
        
        
        Definition 
        
        
- Sequential i/o is much less expensive than random i/o
 
- RAM = what about reading "next" block?
 
- Access time = (block size/transfer rate) + negligible costs
 
- negligible costs: skip inter-block gap, switch track, switch to adjacent cylinder
 
 
   |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some characteristics for disk access time for writing? |  
          | 
        
        
        Definition 
        
        
- Costs similar to those for reading, unless we wish to verify data
 
- Verifying requires that we read the block we've just writen, so:
 
 
Access Time = 
Seek Time + 
Rotational Delay (1/2 rotation) + 
Transfer Time (for writing) + 
Rotational Delay (full rotation) + 
Transfer time (For verifying)  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are the characteristics of modifying? |  
          | 
        
        
        Definition 
        
        
- Read block
 
- Modify in memory
 
- Write Block
 
- Verify Block (optional)
 
 
Access Time = 
Seek Time + 
Rotational Delay (1/2 rotation) + 
Transfer Time (for writing) + 
Rotational Delay (full writing) + 
Transfer time (For verifying) + 
[ Rotational delay (full rotation) + 
Transfer time (for verifying) ]  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are the characteristics for Block Addressing? |  
          | 
        
        
        Definition 
        
        
- Cylinder-head-sector
 
- Physical location of data on disk
 
- ZBR causes problems (sectors vary by tracks)
 
 
- Logical Block addressing
 
- Blocks located by integer index
 
- HDD firmware maps LBA addresses to physical locations on disk
 
- Allows remapping of bad blocks
 
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some key points of Block Size Selection? |  
          | 
        
        
        Definition 
        
        
- The size of blocks affects i/o efficiency:
 
- Big blocks reduce costs of access
 
- fewer seeks (seek tiem + rotational delay) for the same amount of data
 
 
- Big blocks also increase the amount of irrelevant data read
 
- If you're trying to read a single record in a block, larger blocks force you to read more data
 
 
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | Explain the 5 minute rule |  
          | 
        
        
        Definition 
        
        Say a page is accessed every X seconds 
CD = cost if we keep that page on disk 
- D = cost of disk unit
 
- I = numbers IOs that unit can perform
 
- in X seconds, unit can do I*X IOs so:
 
 
Say a page is accessed every X seconds 
CM = cost if we keep that page on RAM 
- M = cost of 1MB of RAM
 
- P = numbers of pages in 1MB RAM
 
 
Say page is accessed every X seconds - if CD < CM, then keep page on disk, else keep in memory. 
Break even point when CD = CM, or X = (D*P)/(I*M)   |  
          | 
        
        
         | 
        
        
        Term 
        
        | Give an example of the 5 minute rule |  
          | 
        
        
        Definition 
        
        P = 128 pages/MB (8KB pages) 
I = 64 accesses/sec/disk 
D = 2000 dollars/disk (9GB + controller) 
M = 15 dollars/MB of DRAM 
  
X = 266 seconds(about 5 minutes)  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some key points of Data Items? |  
          | 
        
        
        Definition 
        
        
- They are either fixed length or variable length
 
- May also include type of data item (Tells how to interpret, size, etc)
 
- The object to store (Salary, name, date, etc)
 
- Stored in bytes
 
- Numbers can be represented as Integers (2bytes) Real Numbers (IEEE754 floating point), etc
 
- Characters can be represented with various coding schemes: ASCII, utf-8, etc
 
- Booleans represented by one byte or one bit
 
- Dates/Times representation: Integer, ISO8601 dates, etc
 
- Representation of strings (Null terminated, Length given, Fixed length)
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some key characteristics of Records? |  
          | 
        
        
        Definition 
        
        
- Collection of related data items/fields (employee record contains name field, salary field, etc)
 
- Records may have fixed or variable formats and lengths
 
- Contains record headers
 
- Data at begining of record that describes it
 
- Type (points to schema)
 
- length
 
- Timestamp
 
 
- Intermediate between fixed and variable format
 
 
  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some points and an example of fixed format records? |  
          | 
        
        
        Definition 
        
        
- Fixed Formats - schema describes structure of records
 
- Number of fields
 
- Types of fields
 
- Order in record
 
- Meaning of each field
 
 
 
[image]  |  
          | 
        
        
         | 
        
        
        Term 
        
        | What are some points and an example of variable format records? |  
          | 
        
        
        Definition 
        
        
- Schema-less format
 
- Record itself contains format: "Self-describing"
 
 
- Useful for sparse records, repeating fields, evolving formats
 
- May waste space compared to a fixed format records
 
 
[image]  |  
          | 
        
        
         |