arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

ColumnStore System Variables

Reference for MariaDB ColumnStore system variables, with each variable's scope, default, dynamic flag, and description — including insert-cache controls and other tuning options.

hashtag
Variables

hashtag
columnstore_cache_inserts

Scope: Global Dynamic: No (requires restart) Command Line: --columnstore-cache-inserts[={0|1}] Default: OFF Description: The feature can be enabled or disabled at the global level. When enabled, INSERT operations are directed to a memory‑optimized Aria cache table, which serves as a temporary buffer before the data is flushed into ColumnStore storage.

hashtag
columnstore_cache_flush_threshold

Scope: Global / Session Dynamic: Yes Command Line: --columnstore-cache-flush-threshold=# Default: 500000 Description: Specifies the number of cached rows that trigger an automatic flush from the Aria cache table to the ColumnStore table. For tuning guidance, see .

hashtag
columnstore_cache_use_import

Scope: Global Dynamic: Yes Command Line: --columnstore-cache-use-import[={0|1}] Default: OFF Description: When the insert cache is enabled, flush operations utilize the cpimport utility to achieve improved performance. When the feature is disabled, flushes are executed using ColumnStore’s internal batch processing mode. For details on performance trade-offs, see .

hashtag
columnstore_diskjoin_force_run

  • Controls whether disk joins are forced to run even if they are not estimated to be the most efficient execution plan. This can be useful for debugging purposes or for situations where the optimizer's estimates are not accurate.

  • Scope: global, session

  • Data type:

hashtag
columnstore_diskjoin_max_partition_tree_depth

  • Sets the maximum depth of the partition tree that can be used for disk joins. A higher value allows for more complex joins, but may also increase the memory usage and execution time.

  • Scope: global, session

  • Data type:

hashtag
columnstore_max_allowed_in_values

  • Sets the maximum number of values that can be used in an IN predicate on a ColumnStore table. This limit helps to prevent performance issues caused by queries with a large number of IN values.

  • Scope: global, session

  • Data type:

hashtag
columnstore_max_pm_join_result_count

  • Sets the maximum number of rows that can be returned by a parallel merge join on a ColumnStore table. This limit helps to prevent memory issues caused by joins that return a large number of rows.

  • Scope: global, session

  • Data type:

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 2

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 8

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 100

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 0

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 0

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: OFF

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 7

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 17

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 0

hashtag
infinidb_ordered_only

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: OFF

hashtag
infinidb_string_scan_threshold

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 10

hashtag
infinidb_stringtable_threshold

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 20

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 0

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: OFF

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: ON

hashtag
infinidb_varbin_always_hex

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: ON

hashtag

  • Command line: Yes

  • Scope: global, session

  • Data type:

  • Default value: 1

hashtag
Compression Mode

MariaDB ColumnStore has the ability to compress data. This is controlled through a compression mode, which can be set as a default for the instance or set at the session level.

To set the compression mode at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance:

where n is:

  1. compression is turned off. Any subsequent table create statements run will have compression turned off for that table unless any statement overrides have been performed. Any alter statements run to add a column will have compression turned off for that column unless any statement override has been performed.

  2. compression is turned on. Any subsequent table create statements run will have compression turned on for that table unless any statement overrides have been performed. Any alter statements run to add a column will have compression turned on for that column unless any statement override has been performed. ColumnStore uses snappy compression in this mode.

hashtag
ColumnStore Decimal-to-Double Math

MariaDB ColumnStore has the ability to change intermediate decimal mathematical results from decimal type to double. The decimal type has approximately 17-18 digits of precision, but a smaller maximum range. Whereas the double type has approximately 15-16 digits of precision, but a much larger maximum range.

In typical mathematical and scientific applications, the ability to avoid overflow in intermediate results with double math is likely more beneficial than the additional two digits of precisions. In banking applications, however, it may be more appropriate to leave in the default decimal setting to ensure accuracy to the least significant digit.

hashtag
Enable/Disable Decimal-to-Double Math

The infinidb\_double\_for\_decimal\_math variable is used to control the data type for intermediate decimal results. This decimal for double math may be set as a default for the instance, set at the session level, or at the statement level by toggling this variable on and off.

To enable/disable the use of the decimal to double math at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance:

where n is:

  • off (disabled, default)

  • on (enabled)

hashtag
ColumnStore Decimal Scale

ColumnStore has the ability to support varied internal precision on decimal calculations. infinidb_decimal_scale is used internally by the ColumnStore engine to control how many significant digits to the right of the decimal point are carried through in suboperations on calculated columns. If, while running a query, you receive the message ‘aggregate overflow’, try reducing infinidb_decimal_scale and running the query again.

Note that, as you decrease infinidb_decimal_scale, you may see reduced accuracy in the least significant digit(s) of a returned calculated column. infinidb_use_decimal_scale is used internally by the ColumnStore engine to turn the use of this internal precision on and off. These two system variables can be set as a default for the instance or at session level.

hashtag
Enable/Disable Decimal Scale

To enable/disable the use of the decimal scale at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance:

where n is off (disabled) or on (enabled).

hashtag
Set Decimal Scale Level

To set the decimal scale at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance.

where n is the amount of precision desired for calculations.

hashtag
Disk-Based Joins

hashtag
Introduction

Joins are performed in memory. When a join operation exceeds the memory allocated for query joins, the query is aborted with an error code IDB-2001.

Disk-based joins enable such queries to use disk for intermediate join data in case when the memory needed for join exceeds the memory limit. Although slower in performance as compared to a fully in-memory join, and bound by the temporary space on disk, it does allow such queries to complete.

circle-info

Disk-based joins does not include aggregation and DML joins.

The following variables in the HashJoin element in the ColumnStore.xml configuration file relate to disk-based joins. ColumnStore.xml resides in /usr/local/mariadb/columnstore/etc/.

  • AllowDiskBasedJoin – Option to use disk-based joins. Valid values are Y (enabled) or N (disabled). Default is disabled.

  • TempFileCompression – Option to use compression for disk join files. Valid values are Y (use compressed files) or N (use non-compressed files).

  • TempFilePath – The directory path used for the disk joins. By default, this path is the tmp directory for your installation (i.e., /usr/local/mariadb/columnstore/tmp). Files (named infinidb-join-data*) in this directory will be created and cleaned on an as needed basis. The entire directory is removed and recreated by ExeMgr at startup.)

circle-info

When using disk-based joins, it is strongly recommended that the TempFilePath reside on its own partition as the partition may fill up as queries are executed.

hashtag
Per user join memory limit

In addition to the system wide flags, at SQL global and session level, the following system variables exists for managing per user memory limit for joins.

  • infinidb_um_mem_limit - A value for memory limit in MB per user. When this limit is exceeded by a join, it will switch to a disk-based join. By default, the limit is not set (value of 0).

For modification at the global level: In my.cnf file (typically /usr/local/mariadb/columnstore/mysql):

where value is the value in MB for in memory limitation per user.

For modification at the session level, before issuing your join query from the SQL client, set the session variable as follows.

hashtag
Batch Insert Mode for INSERT Statements

hashtag
Introduction

MariaDB ColumnStore has the ability to utilize the cpimport fast data import tool for non-transactional and SQL statements. Using this method results in a significant increase in performance in loading data through these two SQL statements. This optimization is independent of the storage engine used for the tables in the select statement.

hashtag
Enable/Disable Using cpimport for Batch Insert

The infinidb_use_import_for_batchinsert variable is used to control if cpimport is used for these statements. This variable may be set as a default for the instance, set at the session level, or at the statement level by toggling this variable on and off.

To enable/disable the use of the use cpimport for batch insert at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance.

where n is:

  • 0 (disabled)

  • 1 (enabled)

hashtag
Changing Default Delimiter for INSERT SELECT

  • The infinidb_import_for_batchinsert_delimiter variable is used internally by MariaDB ColumnStore on a non-transactional INSERT INTO SELECT FROM statement as the default delimiter passed to the cpimport tool. With a default value ascii 7, there should be no need to change this value unless your data contains ascii 7 values.

To change this variable value at the at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance.

where ascii_value is an ASCII value representation of the delimiter desired.

Note that this setting may cause issues with multi byte character set data. It is recommended to utilize UTF8 files directly with cpimport.

hashtag
Version Buffer File Management

If the following error is received, most likely with a transaction LOAD DATA INFILE or INSERT INTO SELECT, it is recommended to break up the load into multiple smaller chunks, increase the VersionBufferFileSize setting, consider a nontransactional LOAD DATA INFILE, or use cpimport.

The VersionBufferFileSize setting is updated in the ColumnStore.xml typically located under /usr/local/mariadb/columnstore/etc. This dictates the size of the version buffer file on disk which provides DML transactional consistency. The default value is '1GB' which reserves up to a 1 Gigabyte file size. Modify this on the primary node and restart the system if you require a larger value.

hashtag
Local PrimProc Query Mode

MariaDB ColumnStore has the ability to query data from just a single node instead of the whole cluster. In order to accomplish this, the infinidb_local_query variable in the my.cnf configuration file is used and maybe set as a default at system wide or set at the session level.

hashtag
Enable Local PrimProc Query During Installation

Local PrimProc query can be enabled system wide during the install process when running the install script postConfigure. Answer 'y' to this prompt during the install process:

hashtag
Enable Local PrimProc Query System-Wide

To enable the use of the local PrimProc query at the instance level, specify infinidb_local_query =1 (enabled) in the my.cnf configuration file at /usr/local/mariadb/columnstore/mysql. The default is 0 (disabled).

hashtag
Enable/Disable Local PrimProc Query at the Session Level

To enable/disable the use of the local PrimProc query at the session level, the following statement is used. Once the session has ended, any subsequent session will return to the default for the instance:

where n is:

  • 0 (disabled)

  • 1 (enabled)

At the session level, this variable applies only to executing a query on an individual . The PrimProc must be set up with the local query option during installation.

hashtag
Local PrimProc Query Examples

hashtag
Example 1 - SELECT from a single table on local PrimProc to import back on local PrimProc:

With the infinidb_local_query variable set to 1 (default with local PrimProc Query):

hashtag
Example 2 - SELECT involving a join between a fact table on the PrimProc node and dimension table across all the nodes to import back on local PrimProc:

With the infinidb_local_query variable set to 0 (default with local PrimProc Query):

Create a script (i.e., extract_query_script.sql in our example) similar to the following:

The infinidb_local_query is set to 0 to allow query across all PrimProc nodes.

The query is structured so PrimProc gets the fact table data locally from the PrimProc node (as indicated by the use of the function), while the dimension table data is extracted from all the PrimProc nodes.

Then you can execute the script to pipe it directly into cpimport:

hashtag
Operating Mode

ColumnStore has the ability to support full MariaDB query syntax through an operating mode. This operating mode may be set as a default for the instance or set at the session level. To set the operating mode at the session level, the following command is used. Once the session has ended, any subsequent session will return to the default for the instance.

where n is:

  1. a generic, highly compatible row-by-row processing mode. Some WHERE clause components can be processed by ColumnStore, but joins are processed entirely by MySQL using a nested loop join mechanism.

  2. (the default) query syntax is evaluated by ColumnStore for compatibility with distributed execution and incompatible queries are rejected. Queries executed in this mode take advantage of distributed execution and typically result in higher performance.

  3. auto-switch mode: ColumnStore will attempt to process the query internally, if it cannot, it will automatically switch the query to run in row-by-row mode.

This page is: Copyright © 2025 MariaDB. All rights reserved.

Default value: OFF
  • Range: ON, OFF

  • Introduced in: MariaDB Enterprise Server 10.6

  • Default value: 10
  • Introduced in: MariaDB Enterprise Server 10.6

  • Default value: 10000
  • Introduced in: MariaDB Enterprise Server 10.6

  • Default value: 1000000
  • Introduced in: MariaDB Enterprise Server 10.6

  • Range: 0,2

    Range: OFF, ON

    Range: 0,1

    Range: OFF, ON

    Range: OFF, ON

    Range: OFF, ON

    Range: OFF, ON

    Range: 0,1,2

    SET infinidb_compression_type = n
    SET infinidb_double_for_decimal_math = on
    SET infinidb_use_decimal_scale = on
    SET infinidb_decimal_scale = n
    [mysqld]
    ...
    infinidb_um_mem_limit = value
    SET infinidb_um_mem_limit = value
    SET infinidb_use_import_for_batchinsert = n
    SET infinidb_import_for_batchinsert_delimiter = ascii_value
    ERROR 1815 (HY000) at line 1 in file: 'ldi.sql': Internal error: CAL0006: IDB-2008: The version buffer overflowed. Increase VersionBufferFileSize or limit the rows to be processed.
    NOTE: Local Query Feature allows the ability to query data from a single Performance
          Module. Check MariaDB ColumnStore Admin Guide for additional information.
    
    Enable Local Query feature? [y,n] (n) >
    SET infinidb_local_query = n
    mcsmysql -e 'select * from source_schema.source_table;' –N | /usr/local/Calpont/bin/cpimport target_schema target_table -s '\t' –n1
    SET infinidb_local_query=0;
    SELECT fact.column1, dim.column2 
    FROM fact JOIN dim USING (KEY) 
    WHERE idbPm(fact.KEY) = idbLocalPm();
    mcsmysql source_schema -N < extract_query_script.sql | /usr/local/mariadb/columnstore/bin/cpimport target_schema target_table -s '\t' –n1
    SET infinidb_vtable_mode = n
    insert cache
    ColumnStore Insert Cache
    ColumnStore Insert Cache
    infinidb_compression_type
    infinidb_decimal_scale
    infinidb_diskjoin_bucketsize
    infinidb_diskjoin_largesidelimit
    infinidb_diskjoin_smallsidelimit
    infinidb_double_for_decimal_math
    infinidb_import_for_batchinsert_delimiter
    infinidb_import_for_batchinsert_enclosed_by
    infinidb_local_query
    infinidb_um_mem_limit
    infinidb_use_decimal_scale
    infinidb_use_import_for_batchinsert
    infinidb_vtable_mode
    PrimProc
    idbLocalPm()
    spinner
    enumeration
    numeric
    numeric
    numeric
    numeric
    numeric
    numeric
    numeric
    numeric
    enumeration
    numeric
    numeric
    enumeration
    enumeration
    numeric
    numeric
    numeric
    enumeration
    enumeration
    enumeration
    enumeration
    LOAD DATA INFILE
    INSERT INTO SELECT FROM