CMU Intro to Database Systems Flashcards

1
Q

why do we not use flat file system for storage?

A

we cannot ensure the integrity of the database and by that we can find ourselves changing our application code multiple times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the relational model pillars?

A

1 - structure : the definition of the database relations and their contents
2 - integrity : ensures the database satisfy constraints
3 - manipulation : programming interface for accessing and modifying a database contents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

does database store it’s data on one file or more?

A

more than one file to not reach the max limit of file size on OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a storage manager?

A

it is responsible for maintaining database files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does a storage manager do?

A

it organizes database files as a collection pages

  • tracking data read/written pages
  • tracking the available space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a page?

A

it is a fixed sized of a block of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the characteristics of a page?

A

1 - it may contain anything from indexed, metadata , tuples
2 - most systems do not mix page types
3 - some systems required that each page is self contained meaning each page will have the meta data sufficient to interpret the page itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what does the DBMS do to map page ids to physical locations?

A

an indirection layer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are the notions of pages?

A

1 - hardware page
2- OS page
3 - Database Page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what are the ways that a DBMS organize pages on a disk?

A

1 - Heap Organization
2 - sequential or sorted file organization
3 - hashing file organization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is heap file organization?

A

is an unordered collection of pages where tuples are stored in random order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

why is heap file organization unordered?

A

because we use SQL to get the data so the data do not need to be ordered for us to get the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what are the ways to represent heap file organization?

A

1 - linked list

2 - page directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how do we use linked list to represent heap file organization?

A
  • we have a header that has two pointers
    1 - a pointer to free header list
    2 - a pointer to a data header list
    3 - each list is double linked so we can go forward and back
    4 - each page contains the amount of free slots it has
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

do we use linked list or page directory for heap file organization?

A

we use page directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do we use a page directory to represent heap file?

A

the directory keep track of the empty pages and data pages as a map

17
Q

what does a page have?

A

1 - header

2 - data

18
Q

what does a header of a page have?

A

meta data about the page
1 - checksum
2 - DBMS version
3- page size

19
Q

how are the data stored in a page?

A

1 - tuple oriented

2 - log structured