# 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 page Configuration File Parameters

> The `db_params` section consists of a set of "name : value" pairs enclosed within braces. For example:

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

> The following table lists the possible options for the `db_params` section with the corresponding C API structures and values specified in the comment:

> Option name : example value | Comment
> --- | ---
> 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, | Max number of connections (`mco_db_params_t::db_max_connections`), unsigned
> disk_max_database_size : 0, | Max size of persistent database (`mco_db_params_t::disk_max_database_size`), unsigned
> file_extension_quantum : 0, | Quantum of increase in the size of the database file (`mco_db_params_t::file_extension_quantum`), unsigned
> db_log_type : redo, | Database logging method (`mco_db_params_t::db_log_type`), one of `no` (`NO_LOG`), `redo` (`REDO_LOG`) or `undo` (`UNDO_LOG`)
> aio_queue_length : 20000, | Asynchronous I/O queue length (default is 10007)
> additional_heap_size : 3m, | Additional heap memory (this can be necessary when altering or dropping tables)
> hash_load_factor : 100, | Criteria of hash reallocation in percent of used items (`mco_db_params_t::hash_load_factor`), unsigned
> index_optimistic_lock_threshold : 100, | Maximum number of active write transactions when optimistic locking of B-Tree indexes can be performed
> log_params: {...} | Log settings (`mco_db_params_t::log_params`) (See below Log Params )
> mode_mask : [], | Open mode mask (`mco_db_params_t::mode_mask`), combination of `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)`, `mvcc_table_level_locking (MCO_DB_MVCC_TABLE_LEVEL_LOCKING)`
> min_conn_local_pages : 256, | Minimum number of pages in per-connection allocator (`mco_db_params_t::min_conn_local_pages`), unsigned
> max_conn_local_pages : 1024, | Maximum number of pages in per-connection allocator (`mco_db_params_t::max_conn_local_pages`), unsigned
> allocation_bitmap_caching_priority : 0, | Priority of allocator bitmap pages in LRU page pool (`mco_db_params_t::allocation_bitmap_caching_priority`), integer
> index_caching_priority : 0, | Priority of index pages in LRU page pool (`mco_db_params_t::index_caching_priority`), integer
> object_caching_priority : 0, | Priority of object (non-blob) pages in 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 page Encryption and Compression for details.)
> dynamic_hash : true, | Dynamically extend hash table when number of items exceeds 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, | # Used to reserve space for the dictionary in the database header to allow dynamic table creation (`mco_db_params_t::ddl_dict_size`), unsigned
> max_classes : 100, | Used to reserve space for classes in the database header to allow dynamic table creation (`mco_db_params_t::max_classes`), unsigned
> max_indexes : 100, | Used to reserve space for indexes in the database header to allow dynamic table creation (`mco_db_params_t::max_indexes`), unsigned
> autocompact_threshold : 100k, | Size of object after reaching which `mco_w_compact()` is called 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 `fifo` (`MCO_SCHED_FIFO`), `reader_favor` (`MCO_SCHED_READER_FAVOR`) or `writer_favor` (`MCO_SCHED_WRITER_FAVOR`)
> max_active_pages: 32, | Maximum number of pages accessed by connection (`mco_db_params_t::max_active_pages`), unsigned
> page_hash_bundles: 8, | Number of bundles in encryption / protection / compression page hash (`mco_db_params_t::page_hash_bundles`), unsigned
> compression_level: 0, | Compression level (`mco_db_params_t::compression_level)`, 0..9, 0 = no compression
> compression_mask: 0x1, | Bitmap of page kinds which should be compressed, (`mco_db_params_t::compression_mask`), unsigned
> expected_compression_ratio: 10, | Used to allocate page map: virtual database space can not be larger than physical size * compression ratio, (`mco_db_params_t::expected_compression_ratio`), unsigned
> btree_cursor_read_ahead_size : 3, | Number of keys taken from a leaf B-Tree page at each access, cannot be larger than `MCO_CFG_CURSOR_BUF_SIZE`, (`mco_db_params_t::btree_cursor_read_ahead_size`), unsigned
> mvcc_bitmap_size | MVCC bitmap size (should be power of two)
> additional_heap_size | Heap memory used by various internal DB functionalities, mostly for buffering during heap memory used by various internal DB functionalities
> cow_pagemap_size | Size of copy-on-write MVCC pagemap (in bytes, one byte per disk page)
> backup_map_size | Size of backup counters array, bytes, power of two, ignored if `disk_max_database_size` set to zero to disable backup feature
> backup_min_pages | Number of pages for last exclusive pass of backup procedure (set to zero to disable threshold)
> backup_max_passes | Max number of passes before exclusive pass of backup procedure
> backup_map_filename | Name of a file will be used to store backup temporary data on `mco_db_close()` call eXtremeDB will use file system wrapper linked into the process to store the data optional (set zero for default "<persistent-storage>.bmap" file located at the same location as persistent storage file)
> iot_agent_id | The IoT agent Identifier
> file_backup_delay | The delay in milliseconds between writing backup blocks; to minimize backup impact on performance; default is 0 - no delay. (See File Backup)

> ## Log Params

> The following table lists the possible options for the `log_params` section with the corresponding C API structures and values specified in the comment:

> Option name : example value | Comment
> --- | ---
> default_commit_policy : buffered, | Transaction commit policy (`mco_log_params_t::default_commit_policy`), one of : `sync_flush` (`MCO_COMMIT_SYNC_FLUSH`), `buffered` (`MCO_COMMIT_BUFFERED`), `delayed` (`MCO_COMMIT_DELAYED`) or `no_sync` (`MCO_COMMIT_NO_SYNC`)
> redo_log_limit : 16m, | Redo log file size limit (`mco_log_params_t::redo_log_limit`), unsigned
> delayed_commit_threshold : 0, | Delayed commit threshold (`mco_log_params_t::delayed_commit_threshold`), unsigned
> max_delayed_transactions : 100, | Delayed commit transactions (`mco_log_params_t::max_delayed_transactions`), unsigned
> max_commit_delay : 1000 | Delay for commit (`mco_log_params_t::max_commit_delay`), unsigned