xSQL Database Parameters

The xSQL configuration file can be used to define database parameters corresponding to the C API mco_db_params_t structure.

For an overview, see Configuration File Parameters.

The db_params section consists of a set of name : value pairs enclosed in braces. For example:

    db_params : {
        mem_page_size : 256,
        disk_page_size : 4096,
        db_max_connections : 100,
        ...
    }

The following options can be specified in the db_params section. Values shown with option names are examples, not necessarily defaults. The descriptions identify the corresponding C API fields and constants.

mem_page_size : 256,
In-memory page size (mco_db_params_t::mem_page_size), unsigned.
disk_page_size : 4096,
Disk page size (mco_db_params_t::disk_page_size), unsigned.
db_max_connections : 100,
Maximum number of connections (mco_db_params_t::db_max_connections), unsigned.
disk_max_database_size : 0,
Maximum size of the persistent database (mco_db_params_t::disk_max_database_size), unsigned.
file_extension_quantum : 0,
Allocation quantum used when extending the database file (mco_db_params_t::file_extension_quantum), unsigned.
db_log_type : redo,

Transaction log type (mco_db_params_t::db_log_type), one of the following:

  • no — NO_LOG.
  • redo — REDO_LOG.
  • undo — UNDO_LOG.
additional_heap_size : 3m,
Additional heap memory used for internal database operations (mco_db_params_t::additional_heap_size), including buffering during XML export/import and database save/load operations. This memory may also be needed when altering or dropping tables.
hash_load_factor : 100,
Hash table reallocation threshold, expressed as a percentage of used entries (mco_db_params_t::hash_load_factor), unsigned.
index_optimistic_lock_threshold : 100,
Maximum number of active write transactions allowed for optimistic locking of B-Tree indexes (mco_db_params_t::index_optimistic_lock_threshold).
log_params : {...}
Transaction log settings (mco_db_params_t::log_params). See Log Params below.
mode_mask : [],

Database open mode flags (mco_db_params_t::mode_mask), specified as an array containing any combination of the following values. For flag descriptions, see Database Open Modes.

  • mvcc_auto_vacuum — MCO_DB_MODE_MVCC_AUTO_VACUUM.
  • smart_index_insert — MCO_DB_MODE_SMART_INDEX_INSERT.
  • open_existing — MCO_DB_OPEN_EXISTING.
  • use_crc_check — MCO_DB_USE_CRC_CHECK.
  • transient — MCO_DB_TRANSIENT.
  • lazy_mem_initialization — MCO_DB_LAZY_MEM_INITIALIZATION.
  • mursiw_disk_commit_optimization — MCO_DB_MURSIW_DISK_COMMIT_OPTIMIZATION.
  • bulk_write_modified_pages — MCO_DB_BULK_WRITE_MODIFIED_PAGES.
  • index_preload — MCO_DB_INDEX_PRELOAD.
  • disable_nested_transactions — MCO_DB_DISABLE_NESTED_TRANSACTIONS.
  • disable_implicit_rollback — MCO_DB_DISABLE_IMPLICIT_ROLLBACK.
  • inmemory_protection — MCO_DB_INMEMORY_PROTECTION.
  • inmemory_compression — MCO_DB_INMEMORY_COMPRESSION.
  • inclusive_btree — MCO_DB_INCLUSIVE_BTREE.
  • separate_bitmap — MCO_DB_SEPARATE_BITMAP.
  • disable_btree_rebalance_on_delete — MCO_DB_DISABLE_BTREE_REBALANCE_ON_DELETE.
  • auto_rollback_first_phase — MCO_DB_AUTO_ROLLBACK_FIRST_PHASE.
  • mvcc_compatibility_mode — MCO_DB_MVCC_COMPATIBILITY_MODE.
  • disable_page_pool_reserve — MCO_DB_DISABLE_PAGE_POOL_RESERVE.
  • redo_log_optimization — MCO_DB_REDO_LOG_OPTIMIZATION.
  • disable_hot_updates — MCO_DB_DISABLE_HOT_UPDATES.
  • sql_autocheckpoint — MCO_DB_SQL_AUTOCHECKPOINT.
  • read_only — MCO_DB_MODE_READ_ONLY.
  • use_aio — MCO_DB_USE_AIO.
  • incremental_backup — MCO_DB_INCREMENTAL_BACKUP_ENABLED.
  • mvcc_table_level_locking — MCO_DB_MVCC_TABLE_LEVEL_LOCKING.
  • disable_smart_alloc — MCO_DB_DISABLE_SMART_ALLOC.
  • disable_disk_space_reserve — MCO_DB_DISABLE_DISK_SPACE_RESERVE.
min_conn_local_pages : 256,
Minimum number of pages in the per-connection allocator (mco_db_params_t::min_conn_local_pages), unsigned.
max_conn_local_pages : 1024,
Maximum number of pages in the per-connection allocator (mco_db_params_t::max_conn_local_pages), unsigned.
allocation_bitmap_caching_priority : 0,
Priority of allocation bitmap pages in the LRU page pool (mco_db_params_t::allocation_bitmap_caching_priority), integer.
index_caching_priority : 0,
Priority of index pages in the LRU page pool (mco_db_params_t::index_caching_priority), integer.
object_caching_priority : 0,
Priority of object (non-BLOB) pages in the LRU page pool (mco_db_params_t::object_caching_priority), integer.
cipher_key : "secret",
Database encryption key (mco_db_params_t::cipher_key), string. See Encryption and Compression for details.
dynamic_hash : true,
Enables dynamic extension of hash tables when the number of entries exceeds the load factor (mco_db_params_t::dynamic_hash), boolean.
license_key : "ABCABCABCABC",
eXtremeDB license key (mco_db_params_t::license_key), string.
ddl_dict_size : 64K,
Space reserved for the dictionary in the database header to support dynamic schema modifications (mco_db_params_t::ddl_dict_size), unsigned.
max_classes : 100,
Number of class slots reserved in the database header for dynamic table creation (mco_db_params_t::max_classes), unsigned.
max_indexes : 100,
Number of index slots reserved in the database header for dynamic index creation (mco_db_params_t::max_indexes), unsigned.
autocompact_threshold : 100k,
Object size threshold, in bytes, that triggers automatic compaction during transaction commit (mco_db_params_t::autocompact_threshold), unsigned.
trans_sched_policy : fifo

Scheduling policy for transactions with the same priority (mco_db_params_t::trans_sched_policy), one of the following:

  • fifo — MCO_SCHED_FIFO.
  • reader_favor — MCO_SCHED_READER_FAVOR.
  • writer_favor — MCO_SCHED_WRITER_FAVOR.
max_active_pages : 32,
Maximum number of pages accessed by a connection (mco_db_params_t::max_active_pages), unsigned.
page_hash_bundles : 8,
Number of bundles in the page hash used for encryption, protection, or compression (mco_db_params_t::page_hash_bundles), unsigned.
compression_level : 0,
Compression level (mco_db_params_t::compression_level), from 0 to 9. A value of 0 disables compression.
compression_mask : 0x1,
Bitmap specifying which types of pages should be compressed (mco_db_params_t::compression_mask), unsigned.
expected_compression_ratio : 10,
Expected compression ratio used to allocate the virtual page map (mco_db_params_t::expected_compression_ratio). The virtual database size cannot exceed the physical database size multiplied by this ratio.
btree_cursor_read_ahead_size : 3,
Number of keys read from a B-Tree leaf page on each access (mco_db_params_t::btree_cursor_read_ahead_size), unsigned. This value cannot exceed MCO_CFG_CURSOR_BUF_SIZE.
mvcc_bitmap_size
Size of the internal MVCC bitmap (mco_db_params_t::mvcc_bitmap_size). Must be a power of two; a value of 0 disables this feature.
cow_pagemap_size
Size of the copy-on-write MVCC page map, in bytes (one byte per disk page) (mco_db_params_t::cow_pagemap_size).
backup_map_size
Size of the backup counters array, in bytes (mco_db_params_t::backup_map_size). Must be a power of two. Ignored if disk_max_database_size is not set. Set backup_map_size to zero to disable incremental backup.
backup_min_pages
Number of pages processed in the final exclusive pass of the backup procedure (mco_db_params_t::backup_min_pages). Set to zero to disable this threshold.
backup_max_passes
Maximum number of non-exclusive passes before the final exclusive backup pass (mco_db_params_t::backup_max_passes).
backup_map_filename

Name of the file used to store backup metadata when mco_db_close() is called (mco_db_params_t::backup_map_filename). eXtremeDB uses the filesystem wrapper linked into the process to write this file. If the name is empty, the default is <persistent-storage>.bmap, located in the same directory as the persistent database file.

file_backup_delay
Delay between writing backup blocks, in milliseconds (mco_db_params_t::file_backup_delay), to reduce the impact on performance. The default is 0 (no delay). See File Backup.

The aio_queue_length option (for example, aio_queue_length : 20000) specifies the asynchronous I/O queue length. It belongs at the top level of the configuration file, outside db_params, and requires the use_aio open mode flag.

The C API field mco_db_params_t::iot_agent_id is configured through agent_id in the IoT Params section.

Log Params

The following options can be specified in the log_params subsection of db_params. Values shown with option names are examples, not necessarily defaults. The descriptions identify the corresponding fields in mco_log_params_t.

default_commit_policy : buffered,

Transaction commit policy (mco_log_params_t::default_commit_policy), one of the following:

  • sync_flush — MCO_COMMIT_SYNC_FLUSH.
  • buffered — MCO_COMMIT_BUFFERED.
  • delayed — MCO_COMMIT_DELAYED.
  • no_sync — MCO_COMMIT_NO_SYNC.
redo_log_limit : 16m,
REDO log checkpoint threshold (mco_log_params_t::redo_log_limit), unsigned. When the log reaches this size, the runtime flushes modified pages to persistent storage and truncates the log once all transactions have committed. This is not a strict maximum log size. The default is 16M.
delayed_commit_threshold : 0,
Size threshold for modified pages pinned in the page pool when using delayed commits (mco_log_params_t::delayed_commit_threshold), unsigned. Reaching this threshold triggers a commit of all delayed transactions. The default is one third of the cache size.
max_delayed_transactions : 100,
Maximum number of delayed transactions before a commit is triggered (mco_log_params_t::max_delayed_transactions), unsigned. The default is 0 (unlimited).
max_commit_delay : 1000
Maximum interval before delayed transactions are committed (mco_log_params_t::max_commit_delay), unsigned, measured in application-defined clock cycles (milliseconds by default).