Mar 28: Storage, GP2 Scripts
Learning Objectives
After today's class, you should be able to:
- Summarize how tables and indexes are physically stored.
- Explain the contents of each script file required for GP2.
Lesson Outline¶
Data Storage [20 min]
Highlights from Chapter 5
-
- Data stored on disks, read in as blocks
- Blocks are usually row-oriented
- Column-oriented is sometimes faster
-
- Tables rows are usually stored unordered
- Tables can be sorted, hashed, or clustered
-
- Index file store values and pointers
- Selectivity – whether to use an index
-
- Large indexes stored in a tree structure
- B+trees are a balanced multi-level index
-
- Hash indexes good for equality queries
- Bitmap indexes for few distinct values
- Logical indexes store primary key values
- Function indexes store function results
-
5.6 Tablespaces and partitions
- Different tables can be stored on different disks
- The same table can be stored using multiple disks
-
- Physical design is independent of local design
CREATE INDEX
andEXPLAIN
statements- Physical design process (query profiling)
Lecture / Demo [35 min]
Working Time [20 min]
- Create stubs for each of the GP2 files
- Each group member create one file
git add
andgit commit
the file- Make sure everyone can
git pull