Lecture-2
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
513
On Slideshare
513
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Advanced Database System CS 641 Lecture #2
  • 2. The memory hierarchy
    • Computer system contains different storage devices
      • Cache
      • Main memory
      • Secondary storage
      • Tertiary storage
    • Data capacities vary over seven orders of magnitude
    • Data access speeds ranging over seven or more orders of magnitude
    • Cost per byte also varies widely (three orders of magnitude)
  • 3.  
  • 4.  
  • 5. Caches
    • The lowest level
      • On-board cache
      • Level-2 cache
    • Write strategies
      • Write through
      • Write back
    • Size: up to 2Mbytes
    • Access speed
      • between the cache and processor
      • A few nanoseconds (10 -9 )
      • Between the cache and main memory
      • around 100 nanoseconds
  • 6. Main memory
    • Typical Size:
      • Personal computer: 1GB – 4GB
      • High-performance system: more than 10GB
    • Access speed:
      • 10 – 100 nanosecond
  • 7. Virtual memory
    • Programs use virtual memory address space.
      • In general, it is bigger than the physical memory
      • Most of its contents are in secondary storage
      • Blocks (pages) are transferred between main memory and secondary storage
    • main-memory database systems
      • Only useful when the data set is small.
  • 8. Secondary storage
    • Significantly slower and significantly larger
    • Disks, cds, zip disk, etc.
    • They are much cheaper than main memory
    • Moving blocks between disk and main memory are disk I/Os.
    • Access speed: 10 – 30 milliseconds (0.01 to 0.03 seconds)
    • Disk capacity: more than 100GB.
    • Buffer is used to reduce the affects of slow disk accesses.
    • To achieve better performance, DBMS have to manage buffers by itself.
  • 9. Tertiary storage
    • Tertiary storage devices are used to hold data volumes measured in terabytes.
    • Slower speed, larger capacity and cheaper price compare to disks.
    • E.g. tapes.
  • 10. Volatile and nonvolatile storage
    • Volatile device: forgets what is stored in it when the power turns off.
    • Nonvolatile devices: keep its contents for long period when the device is turned off or a power failure occurs.
    • Volatile: caches, main memory (DRAM)
    • Nonvolatile: disks, CDs, floppy disks, SRAM, flash memory.
  • 11. Moore’s Law
    • Goldon Moore: Integrated circuit follows an exponential curve that doubles about every 18 months
      • The speed of processors (after 2005, putting more processors on a single, fixed cost chip)
      • The cost of main memory per bit and the number of bits that can be put on one chip
      • The cost of disk per bit and the capacity of the largest disks
    • Some others do not follow
      • Memory access speed, and disk access speed
  • 12. Exercise
    • 13.1.1
  • 13. Mechanics of disks
    • Disk assembly:
      • Consists of one or more circular platters that rotate around a central spindle.
    • Head assembly:
      • Holds disk heads. For each surface there is one head.
    • Other concepts
      • Platter, surface, track, cylinder, sector (physical), block (logical), gap (10% of the total track)
  • 14. A typical disk
  • 15. Top view of a disk surface
  • 16. Disk controller
    • A small processor capable of:
      • Controlling the mechanical actuator that moves the head assembly
      • Selecting a surface from which to read or write, and selecting a sector from the track on that surface that is under the head
      • Transferring the bits read from the desired sector to the computer’s main memory or the bits to be written from main memory to the intended sector.
      • Buffering an entire track or more in local memory of the disk controller
  • 17. Schematic of a simple computer system
  • 18. Disk storage characteristics
    • Rotation speed of the disk assembly
    • Number of platters per unit
    • Number of tracks per surface
    • Number of bytes per track
  • 19. Typical numbers
    • Diameter: 1 inch  15 inches
    • Cylinders: 100  100,000
    • Surfaces: 1 (CDs) 
    • (Tracks/cyl) 2 (floppies)  1023
    • Sector Size: 512B  50K
    • Capacity: 360 KB (old floppy)
    •  1TB
  • 20. Example: Megatron 747
    • 8 platters
    • 65,536 tracks per surface
    • 256 sectors per track
    • 4096 bytes per sector
    • Capacity:
    • 8*2*65536*256*4096=2 40 B=1TB
  • 21. Density of bits
    • Assume Megatron has surface in 1.75 inch radius, inner 0.75 inch is not used.
    • Density of bits in the radius direction: 65,536/inch.
    • Density of bits around the track is far greater.
      • Outermost: 11inch, 420,000 bits/inch.
      • Innermost: 4.2inch, 1megabits/inch.
    • To solve this problem, using non-uniform distribution of bits
  • 22. Transfer data between main memory and disk
    • To read and write blocks:
      • The heads are positioned at the cylinder containing the track on which the block is located
      • The sectors containing the block move under the disk head as the entire disk assembly rotates.
  • 23. Disk access time block x in memory ? I want block X Latency : the time taken between the moment at which the command to read a block is issued and the time that the contents of the block appear in main memory.
  • 24. Disk latency
    • The time taken by the processor and disk controller to process the request (a fraction of a millisecond)
    • Seek time: position the head assembly at the proper cylinder (a few milliseconds per track, maximum: 10-40ms)
    • Rotational latency: the first sector containing the requested block reaches the head (average: 5ms)
    • Transfer time: the sectors of the block and any gaps between them to rotate past the head. (time depends)
  • 25. Calculation of disk latency
    • Time = Seek Time +
    • Rotational Delay +
    • Transfer Time +
    • Other (always ignored)
  • 26. Seek time
  • 27. Rotational latency
  • 28. Example
    • To read a 16,384-byte block from the Megatron 747 disk.
      • 7200RPM, one rotation: 8.33 ms
      • 10% gaps around a track
      • To move the heads between cylinders, 1ms to start and stop, and 1ms for every 4000 cylinders.
      • Thus, the maximum seek time: 17.38ms (for 65,536 cylinders)
    • Calculate the min, max and avg latency to read a block. (0.13ms,25.84ms,10.76ms)
  • 29. Writing blocks
    • The process of writing a block has the same min, max and avg time as read process.
    • If we want to verify if the write is correct, more processing time is needed to read the block
  • 30. Modifying blocks
    • Read the block into main memory.
    • Make changes in main memory
    • Write the new contents back to the disk
    • Verify the contents if needed.
  • 31. Exercises
    • 13.2.1