Compression Units

Hybrid Columnar Compression uses a logical construct called a compression unit to store a set of rows.

red hat certified specialist in red hat enterprise linux diagnostics and troubleshooting malaysia

When you load data into a table, the database stores groups of rows in columnar format, with the values for each column stored and compressed together. After the database has compressed the column data for a set of rows, the database fits the data into the compression unit.

red hat certified specialist in deployment and systems management malaysia

For example, you apply Hybrid Columnar Compression to a daily_sales table. At the end of every day, you populate the table with items and the number sold, with the item ID and date forming a composite primary key. The following table shows a subset of the rows in daily_sales.

red hat certified engineer rhce malaysia

Table 2-2 Sample Table daily_sales

Item_IDDateNum_SoldShipped_FromRestock
100001-JUN-182WAREHOUSE1Y
100101-JUN-180WAREHOUSE3N
100201-JUN-181WAREHOUSE3N
100301-JUN-140WAREHOUSE2N
100401-JUN-182WAREHOUSE1N
100501-JUN-181WAREHOUSE2N

Assume that this subset of rows is stored in one compression unit. Hybrid Columnar Compression stores the values for each column together, and then uses multiple algorithms to compress each column. The database chooses the algorithms based on a variety of factors, including the data type of the column, the cardinality of the actual values in the column, and the compression level chosen by the user.

red hat certified architect rhca malaysia

As shown in the following graphic, each compression unit can span multiple data blocks. The values for a particular column may or may not span multiple blocks.

Figure 2-4 Compression UnitDescription of Figure 2-4 follows
Description of “Figure 2-4 Compression Unit”

If Hybrid Columnar Compression does not lead to space savings, then the database stores the data in the DBMS_COMPRESSION.COMP_BLOCK format. In this case, the database applies OLTP compression to the blocks, which reside in a Hybrid Columnar Compression segment.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *