File Processing - Introduction MVNC1 File Processing BASIC CONCEPTS & TERMINOLOGY.

Slides:



Advertisements
Similar presentations
Components of a computer system
Advertisements

Databasteknik Databaser och bioinformatik Data structures and Indexing (II) Fang Wei-Kleiner.
Indexing Large Data COMP # 22
MEMORY popo.
Physical DataBase Design
Overview of Data Structures and Algorithms
CMPE 421 Parallel Computer Architecture MEMORY SYSTEM.
January 11, Csci 2111: Data and File Structures Week1, Lecture 1 Introduction to the Design and Specification of File Structures.
Managing data Resources: An information system provides users with timely, accurate, and relevant information. The information is stored in computer files.
CMPUT 291 File and Database Management Systems
CNG 3511 CNG 351 Introduction to Data Management and File Structures Müslim Bozyiğit (Prof. Dr.) Department of Computer Engineering METU.
Main Memory Lecture 2 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part A Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
Databases and Processing Modes. Fundamental Data Storage Concepts and Definitions What is an entity? An entity is something about which information is.
CS 524 (Wi 2003/04) - Asim LUMS 1 Cache Basics Adapted from a presentation by Beth Richardson
File StructuresFile StructureSNU-OOPSLA Lab1 Chap1. Introduction to File Structures 서울대학교 컴퓨터공학부 객체지향시스템연구실 (SNU-OOPSLA-LAB) 김 형 주 교수 File Structures by.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Bits and Data Storage. Basic Hardware Units of a Computer.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, VUW Indexing Large Data COMP
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
13.6 Representing Block and Record Addresses
January 11, Files – Chapter 1 Introduction to the Design and Specification of File Structures.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
CS1104: Computer Organisation School of Computing National University of Singapore.
Introduction to the course. Objectives of the course  To provide a solid introduction to the topic of file structures design.  To discuss a number of.
Virtual Memory CS Introduction to Operating Systems.
1 Chapter 17 Disk Storage, Basic File Structures, and Hashing Chapter 18 Index Structures for Files.
External data structures
Database Management Systems,Shri Prasad Sawant. 1 Storing Data: Disks and Files Unit 1 Mr.Prasad Sawant.
IDA / ADIT Databasteknik Databaser och bioinformatik Data structures and Indexing (I) Fang Wei-Kleiner.
CS246 Data & File Structures Lecture 1 Introduction to File Systems Instructor: Li Ma Office: NBC 126 Phone: (713)
FILE HANDLING IN C++.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
1 5. Abstract Data Structures & Algorithms 5.2 Static Data Structures.
An Introduction to Programming with C++ Sixth Edition Chapter 14 Sequential Access Files.
File Processing - Hash File Considerations MVNC1 Hash File Considerations.
Storage Structures. Memory Hierarchies Primary Storage –Registers –Cache memory –RAM Secondary Storage –Magnetic disks –Magnetic tape –CDROM (read-only.
File StructuresFile StructureSNU-OOPSLA Lab1 Chap1. Introduction to File Structures File Structures by Folk, Zoellick, and Riccardi.
Chapter 1 Introduction File Structures Readings: Folk, Chapter 1.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
2/20: Ch. 6 Data Management What is data? How is it stored? –Traditional management storage techniques; problems –DBMS.
FILE ORGANIZATION.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 15. Dictionaries (1): A Key Table Class.
Storage devices 1. Storage Storage device : stores data and programs permanently its retained after the power is turned off. The most common type of storage.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Chapter 14: Sequential Access Files
File Organization and Processing
INLS 623– Database Systems II– File Structures, Indexing, and Hashing
Indexing and hashing.
Databases Chapter 16.
Ramya Kandasamy CS 147 Section 3
Chapter 9 Database Systems
Physical Database Design and Performance
Ch. 8 File Structures Sequential files. Text files. Indexed files.
Appendix D: Network Model
CSCI 161: Introduction to Programming
Chapter 7.
File organization and Indexing
Chapter 11: Indexing and Hashing
MEMORY MANAGEMENT & their issues
FILE ORGANIZATION.
Introduction to Operating Systems
Introduction to Data Structure
Chapter 11: Indexing and Hashing
Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin.
Presentation transcript:

File Processing - Introduction MVNC1 File Processing BASIC CONCEPTS & TERMINOLOGY

File Processing - Introduction MVNC2

3 File Processing l What is it? l Why Learn It?

File Processing - Introduction MVNC4 Files & Data Bases - Differences Database File Access routines User App Database User App File Access routines Schema File

File Processing - Introduction MVNC5 Files & Data Bases - Differences l File System »Lower level, application specific. »collection of files along with programs for manipulating them »Physical organization & access techniques of data known to programmer

File Processing - Introduction MVNC6 Files & Data Bases - Differences l Database »generalized system for storage and retrieval of information »Generic, configurable »System configured with a database schema »Very flexible, but less efficient »physical organization and access technique hidden from application programmer. »A database uses a file system to actually store and retrieve physical data.

File Processing - Introduction MVNC7 Basic Terms l File, Record, Field l File »Collection of (homogenous) records l Record »element of a file (tuple) »contains information about a single entity »Consists of fields of information about entity

File Processing - Introduction MVNC8 Basic Terms l Field »attribute of an entity »May be of many "types" –string - “254 Niagra Street” –numeric value –logical value - True or False –structure (e.g. date) - 12/5/96

File Processing - Introduction MVNC9 Files, Records, and Fields Record Field File

File Processing - Introduction MVNC10 Example files: l consider records for: »real estate listings »student files »Books in library

File Processing - Introduction MVNC11 Records l Record type »record definition or template l Record instance »a particular record with specific data. ID FIRST LAST BOX 3241 Alice Smith William Butler

File Processing - Introduction MVNC12 File access and file organization l file access - technique used to store and retrieve particular records in a file. l file organization - characteristics of how a file is structured or actually stored on the disk.

File Processing - Introduction MVNC13 File access and file organization l Example: »Library (books are like records) –what is the file access? –what is the file organization? »file cabinet –what is the file access? –what is the file organization?

File Processing - Introduction MVNC14 File organizations l Two major underlying file organizations l Direct files »works like an array of records in memory »user selects records directly by its position in the file. l Sequential files »must be accessed in the order the records appear in the file. »"tape" metaphore.

File Processing - Introduction MVNC15 File access techniques l Two major underlying file access techniques l Direct access »can be used with direct files to randomly select records. »cannot be used with sequential file organization. l Sequential access »can be used with either direct or sequential organizations.

File Processing - Introduction MVNC16 File organization & access techniques l These techniques are basic, since directly supported by hardware. l All other (more complex) techniques built using direct & sequential. »Tree »Hashed »Indexed

File Processing - Introduction MVNC17 Primary vs. Secondary storage l Primary »Semiconductor memory »fast, but small, temporary, expensive »memory, registers l Secondary »Disks, Tapes »slow, but large, permanent, inexpensive »orders of magnitude slower then memory

File Processing - Introduction MVNC18 Motivation for File Structures l Primary Memory (RAM) »Small bytes to 10 8 bytes ( megabytes) »Fast - 120* seconds (120 nanoseconds) access time l Secondary Memory »Large bytes to bytes ( gigabytes) »Slow - 3*10 -3 seconds (30 millisecond) access time

File Processing - Introduction MVNC19 Motivation for File Structures l Consider a comparison with a bookself verses a library: »Bookshelf holds 100 books »Access time is 20 seconds l How many books does library hold? l How long does it take to get to library?

File Processing - Introduction MVNC20 Primary vs. Secondary storage l Tradeoffs - where should files and programs be kept? »primary - limited in size, loss occurs if power fails »secondary - much slower but nonvolatile

File Processing - Introduction MVNC21 Primary vs. Secondary storage l Balance »Consider the top of your desk vs. a file cabinet »keep what is likely to be needed soon in primary memory »keep in secondary memory information which hasn't been accessed recently, and isn't like to be needed soon. »Principles of temporal and spatial locality.

File Processing - Introduction MVNC22 Virtual Memory l some operating systems have built-in support to balance between primary and secondary storage. »They allow programs to be much larger then memory, and automatically "shuttle" information as needed between primary and secondary storage. »Keep recently accessed areas of code and data in primary memory »off-load segments not used for a while to secondary storage (or never load in the first place!) »Thus memory appears to be bigger then it actually is

File Processing - Introduction MVNC23 C++ Objects and File Processing l One of our goals is to use C++ objects to represent our file components. l Consider the following C++ class: class Person { public: // data members char LastName[20], FirstName[20], Address[16] char City[16], State[3], ZipCode[10]; // methods Person (); //Default constructor Person (const char *); // Construct from string Person (const Person&); // Copy constructor };

File Processing - Introduction MVNC24 C++ Objects and File Processing l “public” members are accessible by users of the object l “private” members are accessible from within the object only. Person p; // Automatic creation Person * p1_ptr = new person; // dynamic creation Person * p2_ptr = new person(“Smith”); cout << p.Lastname << “,“ << p.FirstName << endl; p_ptr->FirstName = p.FirstName; Person p2(p);

File Processing - Introduction MVNC25 C++ Objects and File Processing l Member functions Person::Person () { // set each field to an empty string LastName[0]= 0; FirstName[0]= 0; Address[0]= 0; City[0]= 0; State[0]= 0; ZipCode[0]= 0; } Person::Person (const char *LN) { // Make a Person with the Last name set strcpy(LastName,LN); FirstName[0]=0; Address[0]=0; City[0]=0; State[0]=0; ZipCode[0]=0; }

File Processing - Introduction MVNC26 C++ Objects and File Processing l Member functions Person::Person (const Person& p); // copy constuctor { // Make a Person with the Last name set strcpy(LastName,p.LastName); strcpy(FirstName,p.FirstName; strcpy(Address,p.Address; strcpy(City,p.City; strcpy(State,p.State; strcpy(ZipCode,p.ZipCode; }