Lecture 5 Flashcards
What is a system catalog?
Contains metadata describing data the DMBS handles, stored in tables called catalog tables. Also called data dictonary.
What does the system catalog store for system wide information?
Size of buffer pool and size of a page
What does the system catalog store for a table?
Tables name and related files
Attributes and types of the table
tables index names
integrity constraints (key and foreign key)
What does the system catalog store for an index?
Index name and type
Search key attribute
What does the system catalog store for a view?
View name and definition
What does the system catalog store for statistics about tables and index?
-Number of tuples in table R
-Number of pages for R
-Number of distinct key values
- Number of pages for index I (leafs)
- Number of non-leaf levels
- Index Range
What are the advantages of storing catalogs as tables?
Catalog tables can be queries and we can use the techniques to manage tables for catalog tables
Why is sorting important for DMBS?
- returning answers in some order is easier
- Bulk loading
- Eliminating duplicate copies from a select is easier
- Join operation is easier
Why do we need external sorting?
We can’t use sort algorithms in databases, and most DB’s are too large to fit on main memory
In Two-Way Merge Sort, what is the number of passes, and what is the overall cost?
Where N is the number of pages:
- Passes: log2(N) + 1
- Cost: 2N(log2(N) + 1)