Home | Previous Page | Next Page   SQL for the Optical Subsystem > CREATE OPTICAL CLUSTER (+, DB-Access, ESQL/C) >

Example

Assume that the CREATE TABLE statement for the catalog table in the stores_demo database specifies that the columns cat_descr and cat_picture are to be stored in the same optical family. In the following example, the CREATE OPTICAL CLUSTER statement creates cat_clstr, an optical cluster of 6,000 kilobytes. A new cat_clstr is allocated to store the data for cat_descr and cat_picture each time a row is inserted with a unique value for manu_code.

CREATE OPTICAL CLUSTER cat_clstr
     FOR catalog (cat_picture, cat_descr)
     ON (manu_code)
     CLUSTERSIZE 6000

If the stores_demo database contains six unique values for manu_code, the statement lays the groundwork for the optical-storage subsystem to create six optical clusters, one for each value. If the table contains ten rows for one manu_code, then the cat_clstr for that value contains the cat_descr and cat_picture data for all ten rows.

To create the cluster, the optical-storage subsystem reserves 6,000 kilobytes on the current volume. If the current volume is too full to accept the space reservation, the cluster is created on the next available volume in the family. The location and size of each cluster on the manu_code cluster key is tracked in an internal optical-cluster table. The name of the optical cluster, the number of its TEXT and BYTE data columns, and the cluster-key column numbers are stored in the sysopclstr table.

Related Information

Related statements: ALTER OPTICAL CLUSTER and DROP OPTICAL CLUSTER

For more information, see the CREATE TABLE statement in IBM Informix: Guide to SQL Syntax.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]