Type 1 and type 2

TomBascom

Curmudgeon
Type 1 storage areas are ancient and obsolete but still supported. No user data, indexes or LOBs should be in type 1 storage.

Type 2 areas are the foundation for all modern features of the OpenEdge database. All user data, indexes and LOBs should be in type 2 storage.

A type 1 data block mixes data from multiple sources. Customers, orders and order-lines might, for instance, all be together in a block. In type 2 blocks all data is from a single table. This is much more performing.

Type 2 areas have a “cluster size”. 8, 64 or 512 blocks are allocated per cluster rather than just one with a type 1 area. This also greatly improves performance.

All of your data should always be in type 2 areas. There are no exceptions.
 

Gowtham Raj

New Member
A type 1 data block mixes data from multiple sources. Customers, orders and order-lines might, for instance, all be together in a block. In type 2 blocks all data is from a single table. This is much more performing.

Hello Tom,

Could you please explain this in a brief? Still, I am not getting this point clearly.
 

RealHeavyDude

Well-Known Member
The point is that with a storage area of type I you don't have any control over what is stored in the blocks. To be precise, records from different tables can and will be stored in one database block. In a storage area of type II only records from one table a stored in a database block. Plus, those blocks are clustered with a cluster size of at least 8 blocks.

In practice that means that with storage area type II you will have at least 8 continues blocks on disk of which is guaranteed that they belong to one particular table or index. With storage area type I you don't know to which table the next record in the block belongs unless you inspect it. That nature of storage area type I database blocks for one introduces additional overhead relevant to many operations on database blocks and, equally or more important, excludes them from many enterprise features buit into the database engine beginning with OpenEdge 10 onward.
 

TomBascom

Curmudgeon
"Physically" the database is organized in blocks. Each block is the same same size and the block size is chosen when you create the db. 4k and 8k are the two reasonable choices. (It is possible to create 1k and 2k databases - but that is a bad idea. Choose 4 or 8. 4 is the default on most systems, 8 is usually slightly better from a performance point of view. 1 and 2 are very bad for performance and should never be used.)

Each storage area can then specify "rows per block". This is the maximum number of rows that can be stored in that block. The value of rows per block can be different for each storage area. But the block size is always the same within a database.

When a record is stored it goes into one or more blocks. If the record is larger than the block size it will need to be split (this is known as "fragmentation"). If there is not enough room left in the block it may also need to be fragmented.

When the db is searching for a place to store a record in a type 1 area it can use *any* data block. Thus "customer" records might be mixed together with "order" records.

When the db is searching for space in a type 2 area it will only store records from the same table in the same block. There will be no mixing.
 
Top