Escolar Documentos
Profissional Documentos
Cultura Documentos
OpenEdge RDBMS
Internals
the
maximum rows per block,
create limit,
toss limit
parameters
block header
RM block header
row directory
free space
records
block header
RM block header
row directory expands
row directory
and shrinks as needed
records
block header
RM block header
row directory expands
row directory
and shrinks as needed
block header
RM block header
dir entry 0 RM block with 1 small record
free space
record 0
block header
RM block header
dir entry 0 RM block with 1 large record
free space
record 0
block header
RM block header
dir entry 0 RM block with 4 records
dir entry 1
dir entry 2 if maximum rows per block
dir entry 3 (rpb) is 4, then no more rows
can be added, no matter how
much free space there is
free space
record 3
record 2
record 1
record 0
block header
RM block header
dir entry 0 RM block with 4 records
dir entry 1
dir entry 2 create limit is minimum free
dir entry 3 space in block
create limit
purpose: provide (some) room
free space for expansion in case rows are
updated later
record 3
record 2 Must be set smaller than toss
record 1 limit
record 0
block header
RM block header
dir entry 0 RM block with 4 records, add
dir entry 1 one more
dir entry 2
dir entry 3 if ((free space - size of new row)
dir entry 4 > create limit), a new row can
create limit be added
free space
record 4
Now we have 5 rows, no space
record 3
record 2
record 1
record 0
block header
RM block header
dir entry 0 after deleting 3 records
dir entry 1 3 unused dir entries
dir entry 2
dir entry 3
dir entry 4 dir entry 4 can be removed
later if needed
free space
record 3
record 1
block header
RM block header
dir entry 0 RM block with 1 record,
lots of free space available
record 0
front back
front back
RM chain back
front
root
Block’s DBKEY Type Chain Backup Ctr
ooo
Free Space
internal
Next DBKEY in Chain Block Update Counter
Next DBKEY in Chain Block Update Counter Top Bot Index Reserved
No.
Top Bot Inde Reserved
Top Bot Index Reserved Num Bytes Dummy Entry . . .
x No.
Entries Dummy Entry
Used . . .
No. Num Bytes
Num Bytes Dummy Entry . . .Used . . . Compressed Index Entries . . .
Entries
Entries Used . . . Compressed Index Entries . . .
. . . Compressed Index Entries . . .
ooo
ooo
ooo
. . . Compressed Index Entries . . .
. . . Compressed Index Entries . . .
. . . Compressed Index Entries . . . Free Space
Free Space
Free Space
leaf
Top Bot Index Reserved No. Num Bytes Entry . . .
Block’s DBKEY Type Chain Backup Ctr Next DBKEY in Chain Block Update Counter
Num Bytes Entries Dummy UsedEntry . . . . . . Compressed Index Entries . . .
No.
Next DBKEY in Chain Block Update Counter Top Bot Inde Reserved . . . Compressed Index Entries . . .
Num Bytes Entries Dummy Entry Used...
Next DBKEY in Chain Block Update Counter Top Bot Index Reserved x No.
. . . Compressed Index Entries . . .
Top Bot Index Reserved No. Num Bytes Dummy Entry Entries
... Used
Num Bytes . . . Compressed Index Entries . . . ooo
Top Bot Index Reserved No. EntriesDummy Entry ...
Used
No. Num Bytes Entries DummyUsed Entry . . . . . . Compressed Index Entries . . . ooo
Num Bytes Entries DummyUsed Entry . . . . . . Compressed Index Entries . . . ooo
Entries Used . . . Compressed Index Entries . . . ooo . . . Compressed Index Entries . . .
. . . Compressed Index Entries . . . ooo . . . Compressed Index Entries . . .
ooo . . . Compressed Index Entries . . . Free Space
ooo . . . Compressed Index Entries . . . Free Space
ooo . . . Compressed Index Entries . . . Free Space
. . . Compressed Index Entries . . . Free Space
. . . Compressed Index Entries . . . Free Space
. . . Compressed Index Entries . . . Free Space
Free Space
Free Space
records
24 Practical OpenEdge RDBMS Essentials
Index Data (ix) Blocks
compressed compressed
index index
entries entries
when a block is split, about half the entries are moved to new block
27 Practical OpenEdge RDBMS Essentials
Applying this stuff
buffer
how do we locate a buffer we want?
we use the hash table and follow the chain
-hash parameter determines number of
Buffer entries in hash table
Hash
Table entries ordered by dbkey
Buffer
Hash if hash table (-hash) small compared to
Table number of buffers (-B), chains become long
and so do searches
default size is prime number close to -B / 4
Do NOT change unless you know how
31 Practical OpenEdge RDBMS Essentials
the
-lkhash
parameter
Free
List
Active & Queued (Waiting) Lock Entries
X SQ SQ SQ SQ
cluster 0
cluster 1
cluster 2
cluster 3
cluster 0
cluster 1
cluster 2
cluster 3
cluster 0
cluster 1
cluster 2
cluster 3
cluster 4
cluster 1
cluster 2
cluster 3
cluster 4
cluster 1
cluster 2
cluster 3
cluster 4
cluster 5
cluster 1
cluster 2
cluster 3
logical ordering:
follow the ring
ring ordered by “bi-clock” time
leftmost cluster is oldest
rightmost cluster is newest
physical ordering:
initial clusters match logical order on disk
leftmost cluster probably not first on disk
new cluster always added after existing on disk
can be anywhere in the ring
find _dbStatus
display _AreaStatus-Hiwater *
_dbStatus._DbStatus-BiBlkSize /
_dbStatus-BiClSize /
1024
.
transaction 1’s
T1: begin
actions
T1: action 1
T1: action 2 transaction 2’s
T2: begin
actions
T1: action 3
transaction 3’s
T3: begin
T1: action 4
actions
T3: action 1
T3: action 2
T2: action 1
T1: end
T2: action 2
T3: end
T2: action 3
T2: action 4
before-image log and after-image log get the same notes (almost)
45 Practical OpenEdge RDBMS Essentials
Transaction Log Records (aka “Notes”)
Prerequisites:
• After Imaging is enabled
• V10.1A and above works best because there is a bug in
the output of aimage scan verbose on older versions of
Progress. The transaction index (Trid) overflows to a
negative number when it reaches 32767. There is a
workaround (editing the PROMSGs file) described in
Progress Solution P72241.
• The AI logs being scanned are small enough that the
output of aimage scan verbose doesn’t use up all of your
available disk space
• -spin
– # retries before nap
• Set to 10,000 or …
• Can be changed online
• -nap
– Initial amount to nap (default 10 ms)
• -napmax
– Max amount to nap (default 5 sec)
• -napinc and -napstep
– Both obsolete and ignored
free memory
static data
code
heap
stacks
Shared-memory segment
static data
code