⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpi.txt

📁 uClinux下用的数据库
💻 TXT
字号:
Clustered Page Index formatCopyright 1998-1999 Hughes Technologies Pty Ltd.All Rights Reserved============================================================================Notes on the CPI format-----------------------CPI provides a key/data index mechanism where the key can be of anylength and of any "core" data type (int, uint, char, real, byte) and thedata is an unsigned int.  It has been designed as an external indexmechanism for mSQL data tables.CPI has been designed to be fast and efficient by virtue of it's "systemfriendly" design rather than by any academic elegance.  An index file iscreated in clusters of pages where there are X pages per cluster ofwhich X-1 of the pages contain data tuples and 1 contains page headers.Each data page has a page header located in the first page of thecluster.  Each header holds the minimum and maximum value of the keys inthe data page as well as the number of tuples in that page.  Byperforming a single disk access the page in which a value is located canbe determined.  A second disk access is then made to read the appropriatedata page.  If the key value is 4 bytes (an int for example) then anykey from a total of over 130,000 can be retrieved with at most 2 diskaccess (less if the pages are in the cache).The page header also contains the page number of the data page itrepresents.  Page 0 in each cluster is the "header page" for thecluster.  The number of data pages in a cluster is calculated when theindex is created based on the size of the key using 	CPI_PAGE_SIZE / ( 2 * keyLength + 2 * sizeof(u_int) )Using a 4096 byte page and a 4 byte key yields 256 data pages percluster (i.e. 256 header structures will fit into the header page).  Thephysical location of each page is offset by a super block located at thefront of the file and is calculated using 	CPI_PAGE_SIZE * pageNum + HTI_SBK_LENThe superblock holds information about the structure of the index fileincluding the keyType, keyLength, first block in the free list etc.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -