Organizing files for performance Chapter 6. 6.1 Data compression Advantages of reduced file size Redundancy reduction: state code example Repeating sequences:

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Indexing.
Memory management In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. Memory management is achieved.
Chapter 6: Memory Management
February 1 & 31 Csci 2111: Data and File Structures Week4, Lectures 1 & 2 Organizing Files for Performance.
Comp 335 File Structures Reclaiming and Reusing File Space Techniques for File Maintenance.
Folk/Zoellick/Riccardi, File Structures 1 Objectives: To get familiar with: Data compression Storage management Internal sorting and binary search Chapter.
February 1 & 31 Files Organizing Files for Performance.
File Processing - Organizing file for Performance MVNC1 Organizing Files for Performance Chapter 6 Jim Skon.
Comp 335 File Structures Indexes. The Search for Information When searching for information, the information desired is usually associated with a key.
Sorting. Sorting Considerations We consider sorting a list of records, either into ascending or descending order, based upon the value of some field of.
Chap6. Organizing Files for Performance. Chapter Objectives(1)  Look at several approaches to data compression  Look at storage compaction as a simple.
Chapter 11: File System Implementation
CPSC 231 Organizing Files for Performance (D.H.) 1 LEARNING OBJECTIVES Data compression. Reclaiming space in files. Compaction. Searching. Sorting, Keysorting.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
Recap of Feb 27: Disk-Block Access and Buffer Management Major concepts in Disk-Block Access covered: –Disk-arm Scheduling –Non-volatile write buffers.
1 File Structure n File as a stream of characters l No structure l Consider students registered in a course Joe SmithSC Kathy LeeEN Albert.
Memory Management (continued) CS-3013 C-term Memory Management CS-3013 Operating Systems C-term 2008 (Slides include materials from Operating System.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Memory Management Chapter 5.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 13 Disk Storage, Basic File Structures, and Hashing.
B-Trees Chapter 9. Limitations of binary search Though faster than sequential search, binary search still requires an unacceptable number of accesses.
Chapter 7 Indexing Objectives: To get familiar with: Indexing
Folk/Zoellick/Riccardi, File Structures 1 Objectives: To get familiar with: Data compression Storage management Internal sorting and binary search Chapter.
The memory allocation problem Define the memory allocation problem Memory organization and memory allocation schemes.
Memory management. Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store.
File StructuresSNU-OOPSLA Lab.1 Chap6. Organizing Files for Performance 서울대학교 컴퓨터공학부 객체지향시스템연구실 SNU-OOPSLA-LAB 교수 김 형 주 File structures by Folk, Zoellick.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
File Organization Techniques
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 17 Disk Storage, Basic File Structures, and Hashing.
Indexed Files Part One - Simple Indexes All of this material is stolen from Dr. Foster's CSCI325 Course Notes.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
Chapter 4 Memory Management.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
1 Memory Management Basics. 2 Program P Basic Memory Management Concepts Address spaces Physical address space — The address space supported by the hardware.
Storage Structures. Memory Hierarchies Primary Storage –Registers –Cache memory –RAM Secondary Storage –Magnetic disks –Magnetic tape –CDROM (read-only.
File Structures. 2 Chapter - Objectives Disk Storage Devices Files of Records Operations on Files Unordered Files Ordered Files Hashed Files Dynamic and.
Evidence from Content INST 734 Module 2 Doug Oard.
Chapter 15 A External Methods. © 2004 Pearson Addison-Wesley. All rights reserved 15 A-2 A Look At External Storage External storage –Exists beyond the.
Chapter 5 Record Storage and Primary File Organizations
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
CS4432: Database Systems II
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
MEMORY MANAGEMENT. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Memory management.
Module 11: File Structure
CPSC 231 Organizing Files for Performance (D.H.)
CHP - 9 File Structures.
Indexing Goals: Store large files Support multiple search keys
Chapter 11: File System Implementation
Data Structures Interview / VIVA Questions and Answers
9/12/2018.
Subject Name: File Structures
Main Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Chapter 11: File System Implementation
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 3: Main Memory.
Chap6. Organizing Files for Performance
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
File Organization.
Chapter 7 Memory Management
CSE 542: Operating Systems
Page Main Memory.
Presentation transcript:

Organizing files for performance Chapter 6

6.1 Data compression Advantages of reduced file size Redundancy reduction: state code example Repeating sequences: run length encoding Variable length code –static (Morse code) –dynamic (Huffman code) Irreversible compression (e.g., jpeg) Unix routines (append.z to compressed files)

6.2 Reclaiming space “Holes” arise when –variable length records are updated –fixed or variable length records are deleted Compaction (for deleted records) –mark deleted records –allows undelete to be implemented –periodically run compaction program

6.2.2 Dynamic reclamation Simple approach: search sequentially until space is found to insert a new record; drawback: very slow Alternative uses linked list stack to allow immediate access to an empty slot, if available; stack may be kept in deleted record slots, with RRN of top in header record.

6.2.3 Variable length records Same scheme (linked list stack) may be used, except byte offset rather than RRN must be used as link Deleted records go on top of stack, but stack must be searched when adding records to find a space big enough to accommodate each new record

6.2.4 Fragmentation Internal –fixed length records –“unsophisticated” variable length scheme External: variable length records –smaller record is placed in a larger slot –leftover space is added to available list Coalescing holes (good test question)

6.2.5 Placement strategies First fit: first record slot that’s big enough Best fit: sort slots in ascending order by size, then use first fit Worst fit: sort in descending order –no need to search: just use first space if it’s big enough –leftover space may be enough for another record

6.3.2 Binary search relational ops for search key retrieval by RRN object-oriented presentation of algorithm –implementation with templates –compilation with class definitions

Search performance complexity for binary search is O(log 2 n), compared to O(n) for sequential search records must be sorted on search key disk sort is prohibitively expensive “internal sort” allows direct accesses in memory

6.3.5 Limitations number of disk accesses for binary search is still significant for large files keeping a file sorted can be less efficient than using sequential search; merge technique addresses this problem internal sort is limited to small files, that will fit entirely in memory

6.4 Keysort only keys are kept in memory each key is kept with its RRN (keynode) keynode array is sorted in memory data file can be sorted by reading records in order or sorted keynodes and writing them to a new file keynodes can be written as an index file

6.4.4 Pinned records available list (of deleted record slots) records whose physical locations are referenced in other records are pinned