• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/71

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

71 Cards in this Set

  • Front
  • Back

Database is usually stored in the form of

records

Each record consists of a collection of related data _______

values or items

Each data value corresponds to a particular ______ of the record

Field

Records usually describe

entities and their attributes

A collection of field names and their corresponding data types constitutes a _________ _________ definition.

record type or record format

What does a data type specify?

The types of values a field can take.

Four main categories of data types:

numeric, string of characters, boolean, and sometimes specially coded date and time data types

What is a BLOB?

Binary large objects. Large unstructured objects that may represent images, digitized video, or audio streams.

How is a BLOB data item typically stored?

Separately from its record in a pool of disk blocks.


(Note: also includes a pointer to the BLOB in the record)

________ is a sequence of records.

A file

What are fixed-length records?

When every record in the file has exactly the same size.

What are variable-length records?

When different records in the file have different sizes.

What are four reasons a file may have variable-length records?

1. The file records are of the same type but one or more fields are of varying size.


2. Files have same record type but one or more fields have multiple values for individual records (repeating fields or repeating groups)


3. Same record type but one or more fields are optional


4. File contains different record types (mixed file) (page 595-596)

When do we use special separator characters (ex: ?, %, $)?

To terminate variable-length fields. Used to determine the bytes within a particular record that represent each field.

When do we assign a short field type code (ex: an integer number) to each field?

With optional fields. Used to record a sequence of pairs.

When do we use record type indicators?

For a file that includes records of different types.

What does a repeating field need to separate?

A separator character to separate the repeating values of the field and another to indicate termination of the field.

What is a block?

The unit of data transfer.

Records of a file must be allocated to ____________.

disk blocks.

What is blocking factor (bfr)?

Block size/records


(bfr=b/r)

What does it mean when records are spanned?

When records can span more than one block.

How do pointers function in blocks?

A pointer at the end of the first block points to the block containing the remainder of the record on another in case it's not the next consecutive block on disk.

What does it mean when records are unspanned?

When records are not allowed to cross block boundaries.

What is contagious allocation?

The file blocks are allocated to consecutive disk blocks.


(This makes reading the file very fast using double buffering, but makes expanding the file difficult.)

What is linked allocation?

Each file block contains a pointer to the next block.


(This makes it easy to expand the file but slow to read.)

What is a combination between linked and contiguous allocation called?

Clusters.


(Clusters are linked.)

What is another term for a cluster?

File segments or extents.

What is indexed allocation?

One or more index blocks contain pointers to the actual file blocks.

What does a file header or file descriptor do?

Contains information about a file needed by the system programs that access the file records. It also includes information to determine the disk address and information to record format descriptions (like field length).

When do you need a linear search?

If the address of the block that contains the record is not known.

What is heap or pile file organization?

When records are placed in the file in the order in which they are inserted.

True or false. Inserting a new record is very efficient.

True

How do you insert and delete records?

See page 602

What is a deletion marker?

An extra byte or bit stored with each record. A record is deleted by setting the deletion marker to a certain value.

What is the purpose of periodic reorganization?

Reclaim unused space of deleted records.

What are relative or direct files?

Can easily be accessed directly by their relative positions.

What is the ordering field?

The field we use to physically order the records of a file on a disk. This leads to an ordered or sequential file.

What is a key field?

A field guaranteed to have a unique value in each record.

What if the ordering field is a key field?

Then the field is the ordering key for the file.

What are the advantages to having ordered records?

Efficiency in reading, usually requires no additional block accesses because next record in same block as previous one, using a search condition is faster when binary search technique is used.

What is a binary search?

See page 603

True or false: Inserting and deleting files are expensive operations for an ordered file because the records must remain in order.

True

What is an overflow or transaction file?

A temporary unordered file.

What is a main or master file?

When an overflow file is added, the ordered file becomes the main or master file. New records inserted at end of overflow and then periodically the overflow will be sorted.

Ordered files are rarely used in db applications unless an additional access path called a ______________ is used.

primary index

Using a primary index results in a ______________ file.

index-sequential

If the ordering attribute is not a key, this results in a ____________ file.

clustered

What is a hash file?

Type of file organization based on hashing.

The search condition must be an equality condition on a single field called the __________

hash field

Typically the hash field is also a key field of the file called the ________ ________

hash key

What does a hash function (or randomizing function) do?

It is applied to the hash field value of a record and yields the address of the disk block in which the record is stored. Search can be carried out in main memory buffer.

Hashing is typically implemented as a __________

hash table

What is folding?

A hash technique that involves applying an arithmetic function to different portions of the hash field to calculate the hash address.

What is the hash field space?

The number of possible values a hash field can take.

True or false: The hash field space is smaller than the address space.

FALSE

What is the address space?

The number of available addresses for records

What is a collision?

When the hash field value of a record that is being inserted hashes to an address that already contains a different record.

What is collision resolution?

The process of finding another position in a collision.

What is open addressing?

Collision resolution strategy. Checks subsequent positions in order until an unused (empty) position is found.

What is chaining?

Collision resolution strategy. Various overflow locations are kept. Pointer field is added to each record location. Collision is resolved by placing the new record in an unused overflow location and setting the pointer of the occupied hash address to the address of the overflow location.

What is multiple hashing?

Collision resolution strategy. Applies a second hash function if the first results in a collision. If another collision results, the program uses open addressing OR a third hash function and then open addressing as necessary.

What is the goal of a good hashing function?

To distribute the records uniformly over the address space so to minimize collisions while not leaving many unused locations.

What is external hashing? What is the target address space made of.

Hashing for disk files. Buckets. Review pg 609.

What do record pointers include?

A block address and a relative record position within the block.

What do order preserving hash functions do?

They maintain records in order of hash field values.

What is static hashing?

Hashing with a fixed number of buckets. Major drawbacks due to fixed hash address space.

What is dynamic hashing?

Uses an access structure based on binary tree data structures.

Hash access structure is built on ______ representation of the hashing function result.

binary

What is the global depth of a 2^d bucket addresses?

d. Value can be increased or decreased one at a time doubling or halving the number of entries in the directory array.

What is the difference between global and local depth.

Local stored with each bucket and specifies the number of bits on which the bucket contents are based.

What is a file?

Sequence of records.