【CSCI3170学习笔记】Storage and Index
来源:互联网 发布:绿色版软件加入注册表 编辑:程序博客网 时间:2024/06/05 16:40
/*This is a study note written by Edward HUANG
* in order to study CSCI3170 introduction to database better.
* Many of the content are from professor Wong's lecture notes.
*/
1. What is the time for accessing a disk block?
- time = seek time + rotational delay + transfer time
- Most of the contribution are fromseek time and rotational delay.
2. What are 'disk block' & 'disk Sector'
- Data are stored and retrieved in units called disk blocks or pages
- Block size is multiple of sector size.
- A sector is a sequence of bytes.
3. What is 'Page'?
Each page has a fixed size. It contains a sequences of record.
4. Concept of 'Buffer Management'
- Occurs when the page is requested for operation and it is not yet in the buffer.
- Replacement Policy
- Dirty Bit
------------------------------------------------------------------------------------
5. What is the format of a record?
There are two kinds of formats of a record.
- Fixed length Record
- Information about field types are same for all records in a file.
- Information about field types are stored insystem catalogs.
- Variable length Record (number of field is fixed)
- Either fields are delimited by special symbols
- Number of fields|field 1$ field 2$ field 3$ field 4
- Or Record begins with array of field (byte) offsets
- |byte1|byte2|byte3|byte4|byte5|byte6|byte7|byte8|byte9|byte10 |byte11 |
- |0x5 |0x7 |0x9 |0xA |0xB |0x1 |0x2 |0x3 |0x3 |0x1 |0x2 |
- | field1 | field 2 |filed 3|filed 4|
- Either fields are delimited by special symbols
6. What is the format for a Page?
- Fixed length
|Slot 1| or unpacked |Slot 1|
|Slot 2| |Free Slot|
|Slot 3| |Slot 3|
|Slot 4| |Slot 4|
|Free Slot| |Free Slot|
Record id = <page id, slot#>
- Variable length
*Pages or block is okay when doing I/O, but higher levels of DBMS operate on records, and files of records.
------------------------------------------------------------------------------------
7.What is File?
- It's a collection of pages, each containing a collection of record.
- File should support insertion, deletion, modification.
- File should be able to read a particular record.
- File should be able to scan all records (in every pages).
8.Three kinds of file format
Heap File
- Using List
- Header page and data page
- Using page directory
- Much smaller than linked list of all Heap File pages.
- Header page and data page
- Much smaller than linked list of all Heap File pages.
Sorted Files
Best if records must be retrieved in some order, or only a 'range' of records is needed.
Indexes
- Data structures to organize records via trees or hashing.
- They speed up searches for a subset of records, based on values in certain fields.
- Updates are much faster than in sorted files.
Functionality: An index on a file speeds up selections on the search key fields for the index.
Index must support efficient retrieval of data entries k* with a given key value k.
Structure: Anindex contains a collection of 'data entries'.
What is data entry? Adata entry is denoted ask*, wherek is a search key value and* tells where to find the record containingk.
Structure of data entry
- <k, data record with search key value k>
- <k, record id of date record with search key value k>
- <k, list of record id with search key value k>
Generally speaking,file contains pages, and page contains records.
- file = {page 1, page 2, page 3, .....page N}.
- page1 = {record 1, record 2, record 3, ......record M}.
- 【CSCI3170学习笔记】Storage and Index
- Web Storage 学习笔记
- SQL Server 2005: SQL Server Storage and Index Structures
- USB Mass Storage学习笔记
- [SAE学习笔记]Storage尝鲜
- USB Mass Storage学习笔记
- Btree Index storage internal
- Btree Index storage internal .
- z-index基础学习笔记
- Elasticsearch学习笔记:index,mapping
- Silverlight 的 Isolated Storage 学习笔记
- Inside.MySQL_InnoDB.Storage.Engine 学习笔记
- Android学习笔记<20140113> Internal Storage
- Azure学习笔记:Storage(3)
- [Android新手学习笔记34]-Storage-SharedPreferences
- [Android新手学习笔记35]-Storage-SQLite
- [Android新手学习笔记36]-Storage-LitePal
- Ionic3学习笔记(七)Storage
- 浅析Android下的Android.mk文件
- 来自百度知道,json-default与struts-default
- Arcgis for Androd API开发系列教程(一)——地图显示与GPS定位
- Xcode Groups vs. Folder References
- UNIX 的 find 命令
- 【CSCI3170学习笔记】Storage and Index
- Why are Oracle’s Read Events “Named Backwards”?
- Mysql中limit的用法详解
- javascript字符串替换及字符串分割举例
- 项目管理概谈
- 联通发布“沃云”品牌 推出云计算产品
- web service(SOAP)与HTTP接口的区别(转载)
- 关于IIS的IUSER和IWAM帐户
- linux管道原理与应用