ALTER TABLE SET PARAM

ALTER TABLE SET PARAM sets table parameters via SQL.

note
  • Checking table metadata can be done via the tables() and table_columns() functions, as described in the meta functions documentation page.

Syntax

Flow chart showing the syntax of the ALTER TABLE keyword Flow chart showing the syntax of the ALTER TABLE SET PARA keywords

maxUncommittedRows - defines the maximum number of uncommitted rows per-table to keep in memory before triggering a commit for a specific table.

The purpose of specifying maximum uncommitted rows per table is to reduce the occurrences of resource-intensive commits when ingesting out-of-order data.

The global setting for the same parameter is cairo.max.uncommitted.rows.

Example

The values for maximum uncommitted rows can be changed per each table with the following SQL:

Altering out-of-order parameters via SQL
ALTER TABLE my_table SET PARAM maxUncommittedRows = 10000

Checking the values per-table may be done using the tables() function:

List table metadata
SELECT id, name, maxUncommittedRows FROM tables();
idnamemaxUncommittedRows
1my_table10000

For more details on retrieving table and column information, see the meta functions documentation.

Syntax

Flow chart showing the syntax of the ALTER TABLE keyword Flow chart showing the syntax of the ALTER TABLE SET PARA with commit lag keywords

commitLag allows for specifying the expected maximum lag of late-arriving records when ingesting out-of-order data. The purpose of specifying a commit lag per table is to reduce the occurrences of resource-intensive commits when ingesting out-of-order data. Incoming records will be kept in memory until for the duration specified in lag, then all records up to the boundary will be ordered and committed.

commitLag expects a value with a modifier to specify the unit of time for the value:

unitdescription
usmicroseconds
sseconds
mminutes
hhours
ddays

To specify commitLag value to 20 seconds:

ALTER TABLE my_table SET PARAM commitLag = 20s;