OnlineIndex

Description

Specifies that the Database painter should use the ONLINE keyword when you create or drop an index on a table so that the index can be created or dropped without locking the table.

When to specify OnlineIndex

You must specify the OnlineIndex parameter before connecting to the database.

Applies to

INF Informix

Syntax

OnlineIndex='value'

Parameter

Description

value

Specifies that the Database painter should use the ONLINE keyword when you create or drop an index. Values are:

  • 0

    The Database painter does not use the ONLINE keyword.

  • 1

    The Database painter uses the ONLINE keyword.


Default value

OnlineIndex=0

Usage

In IDS 10.0 and later, the SQL syntax of CREATE INDEX and DROP INDEX supports the ONLINE keyword to create or drop an index in an online environment where the database and its tables are continuously available. When you use the ONLINE keyword to create or drop an index, data definition language (DDL) operations execute without applying an exclusive lock on the table on which the specified index is defined.

If you use CREATE INDEX ONLINE to create an index on a table that other users are accessing, the index is not available until no users are updating the table. If you issue DROP INDEX ONLINE to drop an index, no users can reference the index, but concurrent data manipulation language (DML) operations can use the index until the operations terminate. Dropping the index is deferred until no users are using the index.

You can set the OnlineIndex static DBParm on the System tab page in the Database Profile Setup dialog box for INF connections to specify that the Database painter should use the ONLINE keyword when you create or drop an index.

Clustered index not supported

You cannot create a clustered index using online mode because it is not supported by IDS.

Examples

To specify that the Database painter use the ONLINE keyword when you create or drop an index in the Database painter:

  • Database profile

    Select the Create or Drop Non-Clustered Indexes Without Dropping Tables check box on the System page in the Database Profile Setup dialog box.

  • Application

    Type the following in code:

    SQLCA.DBParm="OnlineIndex=1"