Chapter 1 Flashcards

1
Q

Schema

A
  • logical structure of the data
  • includes logical constraints such as table names, fields, data types and relationships between these entities
  • example: table or relation with columns for a student, course taken, and grade (only allowable grades are A, B, C, D, F)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Database

A
  • collection of information that exists over a long period of time
  • collection of data that is managed by a DBMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Database Management System (DBMS)

A
  • software for creating and managing large amounts of data efficiently and allowing it to persist over long periods of time
  • storing and retrieving data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

DBMS expected functions

A
  1. create new databases and specify their schemas using a specialized data-definition language
  2. Query and modify data using a query language or data-manipulation language
  3. Support large amounts of data
  4. Durability, or the recovery of the database in case of failures or intentional misuse
  5. Control access to data from many users at once: isolation and atomicity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Relational Database Systems

A
  • database systems should present the user with a view of data organized as tables called relations
  • programmer of a relational system would not be concerned with the storage structure
  • queries could be expressed in a high-level language
  • SQL(Structured Query Language) is most important query language based on the relational model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Information Integration

A
  • joining the information contained in many related databased into a whole
  • divisions of a company may use a different DBMS and different structures for information
  • popular approach is the creation of data warehouses, where info from legacy databases is copied periodically with the appropriate translation to a central database
  • another approach is to implement a middleware, whose function is to support an integrated model of the data of the various databased, while translating between this model and the actual models used by each database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Sources of commands to the DBMS

A
  1. Conventional users and application programs that ask or data or modify data
  2. Database administrator: person responsible for the structure or schema of the database
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Schema Altering Commands

A
  • schema-altering data-definition language (DDL) commands are parsed by a DDL processor and passed to the execution engine which then goes through the index/file/record manager to alter the metadata (schema information for the database)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Answering a Query

A
  • query is parsed and optimized by a query compiler
  • resulting query plan or sequence of actions the DBMS will perform to answer the query, is passed to the execution engine
  • execution engine requests for small pieces of data, typically records or tuples of a relation to a resource manager that know about data files, the format, and size of the records, index files (which help find elements of data files quickly)
  • request for data passed to buffer manager: brings data from secondary storage to the main memory buffers
  • buffer manager communicates with a storage manager to get data from the disk
  • query compiler->execution engine->resource manager->buffer manager->storage manager
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Transaction Processing

A
  • query and other DML actions are grouped into transactions (units that must be executed atomically and in isolation from one another)
  • execution of transactions must be durable, meaning that the effect of any completed transaction must be preserved even if the system fails in some way right after completion of the transaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Transaction Processor

A
  1. Concurrency-control manager, or scheduler: responsible for assuring atomicity and isolation of transactions
  2. Logging and recovery manager, responsible for the durability of transactions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Storage and Buffer Management

A
  • data of database resides in secondary storage, however, to perform operations on data, it must be in the main memory
  • storage manager controls the placement of data on disk and movement between disk and main memory
  • storage manager keeps track of the location of files on the disk and obtains the blocks containing a file on request from the buffer manager
  • buffer manager: responsible for the partitioning the available main memory into buffers, or page-sized regions into which disk blocks can be transferred
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Types of information

A
  1. Data: contents of the database itself
  2. Metadata: database schema that describes the structure of, and constraints on the database
  3. Log Records: information about recent changes to the database; these support durability of the database
  4. Statistics: information gathered and stored by the DBMS about data properties such as the size of, and values in, various relations and other components of the database
  5. Indexes: data structures that support efficient access to the data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Transaction manager

A
  • accepts transaction commands from an application, which will tell the transaction manager when transactions begin and end, as well as information about the expectations of the application (some many not wish to require atomicity)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Transaction Processor Tasks

A
  1. Logging: assure durability, every change in the database is logged separately on the disk
    - log manager assure that when a system fails or crash, the recovery manager will be able to examine the log of changes and restore the database to some consistent state
    - log manager initially writes the log in buffers and negotiates with the buffer manager to make sure that buffers are written to disk (where data can survive a crash)
  2. Concurrency control: transactions must appear to execute in isolation
    - scheduler maintains locks on certain pieces of the database
    - locks prevent two transactions from accessing the same piece of data in ways that interact badly
    - locks are stored in the main memory lock table
    - scheduler affects the execution of queries and other database operations by forbidding the execution engine from accessing lock parts of the database
  3. Deadlock resolution: transaction manager has the responsibility to intervene and cancel one or more transactions to let the others proceed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Query Processor

A
  • most affects the performance that the user sees
  • represented by two components:
    1. query compiler
    2. execution engine
17
Q

Query Compiler

A
  • translates the query into an internal form called query plan, or sequence of operations to be performed on the data
    a. query parser, builds a tree structure from the textual form of the query
    b. query preprocessor performs semantic checks on the query (making sure all relations mentioned by the query actually exist) and performs some tree transformations to turn the parse tree into a tree of algebraic operators representing the initial query plan
    c. query optimizer: transforms the initial query plan into the best available sequence of operations on the actual data
  • query compiler uses metadata and statistics about the data to decide which sequence is likely to be fastest (ex. the existence of an index, which is a data structure that facilitates access to data, given values for one or more components of that data, can make one plan much faster than another
18
Q

Execution Engine

A

executing each of the steps in the chosen query plan

  • interacts with the other components of the DBMS, either directly or through the buffers
  • must get the data from the database into buffers in order to manipulate data
  • needs to interact with the scheduler to avoid accessing data that is locked
  • interact with the log manager to make sure that all database changes are properly logged
19
Q

Relational Database

A
  • database that stores and provides access to data points that are related to one another
  • based on the relational model, representing data in tables, each row in the table is a record with a unique ID called the key
  • columns hold attributes of the data and each record usually has a value for each attribute