Compress Data in a Table

Technote (FAQ)


Question

How to compress data in a table?

Answer

Storage optimization by way of compressed data was made available as of 11.50.XC4. You can compress a table or table fragments using SQL Admin API commands. Either “task” or “admin” API functions can be used to execute SQL Admin API command. In this document we will use the task function.

As user informix or a user with connect permission to the sysadmin database, perform the following steps to compress data in a table:

1. Connect to sysadmin database

      DATABASE sysadmin;  

2. Before 11.50.xC6, compression has to be enabled in order to use it. This is done using the command:
      EXECUTE FUNCTION task(“enable compression”);

3. You can perform data compression for a table or table fragments. Compression can be performed in one step or two steps. A compressed table requires a compression dictionary and the compression operation in order to complete the compression task. When the operation is done in one step, the operation will automatically create the compression dictionary, if it not already created.
Table compression syntax:
      EXECUTE FUNCTION task("table compress",
         " TableName" , " DatabaseName",   "OwnerName" );
      TableName
        The name of the table that needs to compress
      DatabaseName
        The name of the database that contains the table
      OwnerName
        The name of the database owner

Table fragmenting syntax:
      EXECUTE FUNCTION task("fragment compress",
          "PartnumList" );
      PartnumList
        The list of partition numbers that belong to the same table
        Use space as a delimiter

Related information

Working with Compression on 11.50 and 11.70

Rate this page:

(0 users)Average rating

Document information


More support for:

Informix Servers

Software version:

11.5, 11.7

Operating system(s):

AIX, HP-UX, Linux, Mac OS X, Solaris, Windows

Software edition:

Ultimate

Reference #:

1381306

Modified date:

2013-08-30

Translate my page

Machine Translation

Content navigation