21.2.2 Example

For this example, I used Borland's TDUMP again, as I did for the earlier chapter on Record Format. This is what a page looked like:

Address Values in Hexadecimal

Values in ASCII

0D4000: 00 00 00 00 00 00 00 35 FF FF FF FF FF FF FF FF

.......5........

0D4010: 00 00 00 00 00 00 E2 64 45 BF 00 00 00 00 00 00

.......dE.......

0D4020: 00 00 00 00 00 00 00 05 02 F5 00 12 00 00 00 00

................

0D4030: 02 E1 00 02 00 0F 00 10 00 00 00 00 00 00 00 00

................

0D4040: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00

................

0D4050: 00 02 16 B2 00 00 00 00 00 00 00 02 15 F2 08 01

................

0D4060: 00 00 03 00 89 69 6E 66 69 6D 75 6D 00 09 05 00

.....infimum....

0D4070: 08 03 00 00 73 75 70 72 65 6D 75 6D 00 22 1D 18

....supremum."..

0D4080: 13 0C 06 00 00 10 0D 00 B7 00 00 00 00 04 14 00

................

0D4090: 00 00 00 09 1D 80 00 00 00 2D 00 84 41 41 41 41

.........-..AAAA

0D40A0: 41 41 41 41 41 41 41 41 41 41 41 1F 1B 17 13 0C

AAAAAAAAAAA.....

...

??

...

??

0D7FE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 74

...............t

0D7FF0: 02 47 01 AA 01 0A 00 65 3A E0 AA 71 00 00 E2 64

.G.....e:..q...d

Let's skip past the first 38 bytes, which are Fil Header. The bytes of the Page Header start at location 0d4026 hexadecimal:

Location

Name

Description

00 05

PAGE_N_DIR_SLOTS

There are 5 directory slots.

02 F5

PAGE_HEAP_TOP

At location 0402F5, not shown, is the beginning of free space. Maybe a better name would have been PAGE_HEAP_END.

00 12

PAGE_N_HEAP

There are 18 (hexadecimal 12) records in the page.

00 00

PAGE_FREE

There are zero free (deleted) records.

00 00

PAGE_GARBAGE

There are zero bytes in deleted records.

02 E1

PAGE_LAST_INSERT

The last record was inserted at location 02E1, not shown, within the page.

00 02

PAGE_DIRECTION

A glance at page0page.h will tell you that 2 is the #defined value for PAGE_RIGHT.

00 0F

PAGE_N_DIRECTION

The last 15 (hexadecimal 0F) inserts were all done "to the right" because I was inserting in ascending order.

00 10

PAGE_N_RECS

There are 16 (hexadecimal 10) user records. Notice that PAGE_N_RECS is smaller than the earlier field, PAGE_N_HEAP.

00 00 00 00 00 00 00

PAGE_MAX_TRX_ID

??

00 00

PAGE_LEVEL

Zero because this is a leaf page.

00 00 00 00 00 00 00 14

PAGE_INDEX_ID

This is index number 20.

00 00 00 00 00 00 00 02 16 B2

PAGE_BTR_SEG_LEAF

??

00 00 00 00 00 00 00 02 15 F2

PAGE_BTR_SEG_TOP

??

Immediately after the page header are the infimum and supremum records. Looking at the "Values In ASCII" column in the hexadecimal dump, you will see that the contents are in fact the words "infimum" and "supremum" respectively.

Skipping past the User Records and the Free Space, many bytes later, is the end of the 16KB page. The values shown there are the two trailers.

  • The first trailer (00 74, 02 47, 01 AA, 01 0A, 00 65) is the page directory. It has 5 entries, because the header field PAGE_N_DIR_SLOTS says there are 5.

  • The next trailer (3A E0 AA 71, 00 00 E2 64) is the fil trailer. Notice that the last four bytes, 00 00 E2 64, appeared before in the fil header.


User Comments
Sign Up Login You must be logged in to post a comment.