Procedures added for disabling LOB compression [CR 352758]

In ESD #4, two stored procedures were added to control the compression (done when writing database buffers to disk) for columns of data type LOB. This functionality saves CPU cycles because certain data formats stored in a LOB column (e.g., jpg files) are already compressed and gain nothing from additional compression.


sp_iqsetcompression procedure

Function

Sets compression for LOB/CLOB data types (long binary and long varchar, respectively).

Syntax

call dbo.sp_iqsetcompressionowner, table, column, on_off_flag )

Permissions

Requires DBA authority.

Description

The sp_iqsetcompression system stored procedure lets you control compression of LOB/CLOB audiotape columns. The compression setting only applies to IQ base tables.

A side effect of sp_iqsetcompression is that a COMMIT occurs after the compression setting is changed.

Table 3: Columns in sp_iqsetcompression

Name

Data type

Description

owner

char(128)

Owner of the table for which you are setting compression.

table

char(128)

Table for which you are setting compression.

column

char(128)

Column for which you are setting compression.

on_off_flag

char(3)

Compression setting: ON enables compression, OFF disables compression.

Example

Example 3

For this example, assume the following table definition:

CREATE TABLE USR.pixTable (picID INT NOT NULL,
picJPG LONG BINARY NOT NULL);

To turn off compression on the LOB column picJPG, call the sp_iqsetcompression procedure using the following command (you must have DBA permission):

CALL sp_iqsetcompression('USR', 'pixTable', 'picJPG',
'OFF') ;

This command returns no rows.


sp_iqshowcompression procedure

Function

Displays compression settings for columns of LOB/CLOB data types (long binary and long varchar, respectively).

Syntax

call dbo.sp_iqshowcompressionowner, table, column )

Permissions

Requires DBA authority.

Description

Returns the column name and compression setting. Compression setting values are 'ON' (compression enabled) or 'OFF' (compression disabled).

Table 4: Columns in sp_iqshowcompression

Name

Data type

Description

owner

char(128)

Owner of the table for which you are setting compression.

table

char(128)

Table for which you are setting compression.

column

char(128)

Column for which you are setting compression.

Example

Example 4

For this example, assume the following table definition:

CREATE TABLE USR.pixTable (picID INT NOT NULL,
picJPG LONG BINARY NOT NULL);

To check the compression status of the columns in the pixTable table, call the sp_iqshowcompression procedure using the following command (you must have DBA permission):

CALL sp_iqshowcompression('USR', 'pixTable',
'picJPG') ;

This command returns one row:

'picJPG','ON'