 |
» |
|
|
 |
 |
 |

2.5 Explain the internals of a dbefile
Key points
- DBEFiles are also called chunks.
- Each DBEFile has a number, which is visible under the DBEFNUMBER column of
SYSTEM.DBEFILE.
isql => select DBEFNUMBER,* from SYSTEM.DBEFILE order by DBEFNUMBER;
-----------+--------------------+--------+-----------------------------
DBEFNUMBER |DBEFNAME |DBEFTYPE|FILEID
-----------+--------------------+--------+-----------------------------
0|PARTSDBE0 | 90|PartsF0
1|PURCHDATAF1 | 92|PurchDF1
2|PURCHINDXF1 | 91|PurchXF1
3|WAREHDATAF1 | 92|WarehDF1
4|WAREHINDXF1 | 91|WarehXF1
5|ORDERDATAF1 | 92|OrderDF1
6|ORDERINDXF1 | 91|OrderXF1
7|FILEDATA | 92|FileData
8|RECDATAF1 | 90|RecDF1
- In TurboIMAGE, each data set file can be thought of as a set of records.
Each record in the file corresponds to a record in the data set.
- In ALLBASE/SQL, each DBEFile can be thought of as a set of 4K pages. Each
page has a number. There are basically two types of pages, page table
pages and data pages. Each type of page has its own layout.
- A page table page (PTP) is basically a table of contents for the next 252
pages. For every 253 pages in the DBEFile, the first page is a page table
page, and the other 252 pages are data pages. Each page table page contains
252 entries: each entry consists of a pointer to one of the data pages, and an
object id that identifies the table or index stored on that page. Entry 1
points to data page 1, entry 2 points to data page 2, etc.
- A data page is used to store table data or index data, depending on the
type of the DBEFile. Rows for an SQL table are always stored on data pages,
in a special format understood by DBCORE. Up to 256 rows can be stored on a
single page, depending on the size of the rows.
- Each row inserted onto a page has a physical address (also known as the
TID, or tuple id). The form of a TID is
(DBEFile Number):(Page Number):SLOT.
Each row on the page has a different SLOT number (from 0 to 255).
The TID for a row on the page highlighted in DBEFile 0 might be: 0:2:128.
The TID for a row on the page highlighted in DBEFile 1 might be: 1:254:7.
- You can find out which pages your data is stored on by issuing the following
query in isql:
isql=> select tid(),* from owner.table order by 1;
EXAMPLE
isql=> select tid(),* from recdb.clubs order by 1;
-----------------------+---------------+---------+------------------
(TID) |CLUBNAME |CLUBPHONE|ACTIVITY
-----------------------+---------------+---------+------------------
8:5:0|Energetics | 1111| aerobics
8:5:1|Windjammers | 2222| sailing
8:5:2|Downhillers | 3333| skiing
8:5:3|Poker Faces | 4444| cards
8:5:4|Spikers | 5555| volleyball
8:5:5|Stingers | 6666| soccer
- DBCORE obtains information out of DBEFiles depending upon the type of
scan selected by SQLCORE. This process will be described in greater detail
at the end of this chapter.

Page last updated on November 29, 1995
|
|
|