Database Block

Subhransu

Member
Hi,
I would like to know whether a database block only contains records of one table or different tables?

Thanks.
Subhransu
 
Greetings,

A database block is simply a row in the database.
Therefore the block of data is from the same table,
and is just the different field data in that table
 

RealHeavyDude

Well-Known Member
A database block may either contain records from a table or index data. If a database block is an index block it can always only contain data from one particular index.

Otherwise it depends whether the database block belongs to a type II (OpenEdge 10+) or type I storage area. In type II storage areas the database blocks are clustered and can only contain records of one table whereas in type I storage areas they are not clustered and may contain records from different tables. All of this may have a huge impact on performance - therefore it is recommended to use type II storage areas.

Heavy Regards, RealHeavyDude.
 

TomBascom

Curmudgeon
Greetings,
A database block is simply a row in the database.
Therefore the block of data is from the same table,
and is just the different field data in that table

This is not correct.

As RHD says db blocks come in two major varieties -- index blocks and record blocks.

Index blocks have always been specific to a particular index in a particular table.

Data blocks come in two distinct flavors -- type 1 and type 2.

Each storage area can have a "rows per block" defined for it. Row per block is a power of 2 from 1 to 256. Prior to 8.2 it was fixed at 32 rows per block. Starting with 8.2 variable block sizes were introduced and 8k blocks got 64 rows per block -- all others were 32. Starting with v9 and the introduction of multiple storage areas (v8 and below can be considered to have just 1 storage area) each area can have a different RPB (there is, however, only 1 block size allowed per database). Except the schema area. The schema area follows the v9 rules and is always a type 1 area.

Prior to OE10 all data blocks were "type 1". A type 1 block potentially contains records from whatever tables are assigned to its storage area.

Starting with OE10 storage areas may have a "blocks per cluster" attribute. 0 and 1 mean the same thing and indicate a type 1 area. 8, 64 and 512 indicate a type 2 area. In a type 2 area all of the data blocks in a cluster contain data from just one table. This is extremely beneficial in many ways but most especially when doing queries that return large result sets. If you are stuck on v9 you can fake type 2 storage areas by creating many areas and assigning individual tables to discrete areas.

Remember, the schema area is always type 1. This is why it should never have any data, indexes or LOBs in it. All data, indexes and LOBs should be in type 2 storage areas.
 
Top