mco_db_params_t)The runtime settings for a database opened by
mco_db_open_dev()are defined in themco_db_params_tstructure. (For common configuration examples, see the guides for in-memory or persistent databases.)The
mco_db_params_tstructure is defined inmco.has follows:typedef struct mco_db_params_t_ { mco_uint2 mark; /* Initialized by mco_db_params_init() */ mco_uint2 mem_page_size; /* Memory page size */ mco_uint4 disk_page_size; /* Disk page size (0 for in-memory DB) */ mco_uint4 db_max_connections; /* Maximum number of connections */ mco_offs_t disk_max_database_size; /* Max size of persistent database */ mco_offs_t file_extension_quantum; /* File extension quantum to reduce fragmentation */ MCO_LOG_TYPE db_log_type; /* Database logging method */ mco_uint2 connection_context_size; /* Recovery connection context size */ mco_uint2 hash_load_factor; /* Hash table load factor (%) */ mco_uint2 index_optimistic_lock_threshold; /* Max write transactions for B-Tree optimistic locking */ mco_log_params_t log_params; /* Initial log settings */ int mode_mask; /* Open mode mask */ int min_conn_local_pages; /* Min pages in per-connection allocator */ int max_conn_local_pages; /* Max pages in per-connection allocator */ int allocation_bitmap_caching_priority; /* Priority for allocator bitmap pages */ int index_caching_priority; /* Priority for index pages */ int object_caching_priority; /* Priority for object (non-BLOB) pages */ struct mco_ddl_dictionary_t_* ddl_dict; mco_size_t ddl_dict_size; int ddl_dict_flags; const char* cipher_key; /* Database encryption key */ const char* cipher_key_snapshot_tl; /* Encryption key for snapshots/TL */ mco_bool dynamic_hash; /* Enable dynamic hash table extension */ const char* license_key; /* eXtremeDB license key */ int max_classes; /* Space reserved for classes (for dynamic schema) */ int max_indexes; /* Space reserved for indexes (for dynamic schema) */ mco_size_t autocompact_threshold; /* Object size threshold for auto-compaction */ MCO_TRANS_SCHED_POLICY trans_sched_policy; /* Transaction scheduling policy */ mco_uint8 max_trans_time; /* Max transaction time (0 to disable) */ mco_uint8 max_ttl_objects; /* Max objects removed by TTL per transaction */ mco_bool ignore_ttl; /* Ignore all TTL policies */ int max_gc_versions; /* Max old versions reclaimed by GC */ int max_active_pages; /* Max pages accessed by a connection */ int page_hash_bundles; /* Bundles in page hash for encryption/compression */ int compression_level; /* Compression level (-1..9) */ int compression_mask; /* Bitmap of page kinds to compress */ int expected_compression_ratio; /* Expected compression ratio for page map allocation */ mco_uint1 btree_cursor_read_ahead_size; /* B-Tree cursor read-ahead size */ int mvcc_bitmap_size; /* MVCC bitmap size (power of two) */ int additional_heap_size; /* Heap for internal DB operations (e.g., save/load) */ mco_size_t cow_pagemap_size; /* Size of copy-on-write MVCC pagemap (bytes) */ mco_size_t backup_map_size; /* Size of backup counters array (bytes, power of two) */ unsigned int backup_min_pages; /* Pages for last exclusive backup pass */ unsigned int backup_max_passes; /* Max passes before exclusive backup pass */ char backup_map_filename[MCO_MAX_FILE_NAME]; /* Backup map filename */ mco_uint8 iot_agent_id; /* IoT agent identifier */ mco_uint2 iot_level; /* IoT level override */ mco_uint4 file_backup_delay; /* Delay between backup block writes (ms) */ void* filesys_media_ptr; /* System-dependent filesystem media pointer */ } mco_db_params_t;The fields of this structure are described below:
markInternal marker set bymco_db_params_init(). Applications must not modify this field.mem_page_sizeSize of a memory page for conventional or shared memory devices (MCO_MEMORY_CONV,MCO_MEMORY_NAMED). For persistent and mixed-mode databases, this value must be a power of two. (See Creating Databases)disk_page_sizeSize of a persistent storage page. Set to zero for all-in-memory databases. Must be a power of two.Note: While the general database configuration now allows
(See Creating Databases)disk_page_sizeandmem_page_sizeto be equal, theMCO_DB_SEPARATE_BITMAPopen mode requires the disk page size to be at least eight times the memory page size (i.e., a 1:8 ratio). If you enableMCO_DB_SEPARATE_BITMAPwith an incompatible page size configuration, the runtime will return an error.db_max_connectionsMaximum number of concurrent connections to the database. (See Creating Databases)disk_max_database_sizeMaximum size of the persistent database on disk. (See Creating Databases)file_extension_quantumAllocation block size used when extending the database file. This can help reduce file fragmentation.db_log_typeTransaction log type for persistent databases. Must be one of:REDO_LOG,UNDO_LOG, orNO_LOG. (See Log File Types and Persistent Media I/O)connection_context_sizeSize of the application-specific context attached to each connection. This data is copied from thecontextparameter ofmco_db_connect_ctx()and is used during recovery to verify that the connection's owner task is still alive. (See Recovery from Failed Processes)hash_load_factorThreshold (as a percentage) for hash index table reallocation. When the number of items exceeds this percentage of the table size, the table is extended. (See Hash Indexes)index_optimistic_lock_thresholdMaximum number of active write transactions allowed for optimistic locking on B-Tree indexes. (See MVCC Locking Optimization)log_paramsInitial settings for the transaction log, specified as anmco_log_params_tstructure.mode_maskBitmask of database open mode flags. Defined inmco.h. (See Database Open Modes)min_conn_local_pagesMinimum number of pages held by the per-connection allocator in MVCC mode. (See In-memory Page Allocation)max_conn_local_pagesMaximum number of pages held by the per-connection allocator in MVCC mode. (See In-memory Page Allocation)allocation_bitmap_caching_priorityCache priority for allocation bitmap pages. Higher values keep these pages in the LRU cache longer. (See Prioritized Cache)index_caching_priorityCache priority for index pages. Higher values keep these pages in the LRU cache longer. (See Prioritized Cache)object_caching_priorityCache priority for object (non-BLOB) pages. Higher values keep these pages in the LRU cache longer. (See Prioritized Cache)ddl_dictReserved for future use.ddl_dict_sizeSize of the DDL dictionary buffer. Used to reserve space in the database header for dynamic schema modifications (e.g., via SQLCREATE TABLE). This parameter is irrelevant for non-SQL applications.ddl_dict_flagsReserved for future use.cipher_keyPrimary encryption key for the database. Manages encryption for persistent files or in-memory pages. Ifcipher_key_snapshot_tlis also set, this key applies only to the main database storage. (See Database Encryption)cipher_key_snapshot_tlEncryption key specifically for database snapshots (created bymco_db_save()) and the transaction log (TL). If set to an empty string (""), snapshots and TL are not encrypted, even ifcipher_keyis provided. (See Database Encryption)dynamic_hashEnables dynamic extension of hash tables when the number of items exceeds thehash_load_factor. (See Hash Indexes)license_keyeXtremeDB license key.max_classesNumber of class slots to reserve in the database header to support dynamic schema creation (e.g., via SQLCREATE TABLE). Irrelevant for non-SQL applications.max_indexesNumber of index slots to reserve in the database header to support dynamic schema modification (e.g., via SQLALTER TABLE). Irrelevant for non-SQL applications.autocompact_thresholdObject size threshold (in bytes) that triggers automatic compaction (mco_autocompact()) during transaction commit. (See Automatic De-fragmentation of Dynamic Objects)trans_sched_policyScheduling policy for transactions with the same priority. (See MURSIW Transaction Scheduling Policies)max_trans_timeMaximum allowed transaction duration (in milliseconds). A value of 0 disables the limit. Note: This setting has no effect except in special debug builds of the eXtremeDB runtime.max_ttl_objectsMaximum number of objects that can be removed by Time-To-Live (TTL) policies in a single transaction.ignore_ttlIf set totrue, all Time-To-Live (TTL) policies are ignored. This setting can be changed at runtime.max_gc_versionsMaximum number of old object versions that the Garbage Collector (GC) can reclaim in a single operation.max_active_pagesMaximum number of pages a single connection can access. The default is 32. Relevant when encryption, protection, or compression is enabled. (See Database Encryption)page_hash_bundlesNumber of bundles in the internal page hash used for encryption, protection, or compression. (See Database Encryption)compression_levelCompression level:-1for default,0for no compression,1-9for increasing levels of compression. (See Database Compression)compression_maskBitmap specifying which types of pages should be compressed. (See Database Compression)expected_compression_ratioExpected compression ratio used to allocate the virtual page map. The default value is 10. It is not recommended to change this value. (See Database Compression)btree_cursor_read_ahead_sizeNumber of keys pre-fetched from a B-Tree leaf page on each access. Cannot exceedMCO_CFG_CURSOR_BUF_SIZE. (See B-Tree Read-Ahead Buffering)mvcc_bitmap_sizeSize of an internal bitmap used to accelerate MVCC performance. Must be a power of two. A value of 0 disables this feature. (See Accelerating MVCC Performance)additional_heap_sizeAdditional heap memory allocated for internal database operations, primarily for buffering during XML export/import and database save/load operations.cow_pagemap_sizeSize of the copy-on-write (COW) MVCC page map, in bytes (one byte per disk page).backup_map_sizeSize of the backup counters array, in bytes (must be a power of two). Ignored ifdisk_max_database_sizeis not set. Set to zero to disable the incremental backup feature. (See Incremental Backup Implementation)backup_min_pagesNumber of pages processed in the final exclusive pass of the backup procedure. Set to zero to disable this threshold. (See Incremental Backup Implementation)backup_max_passesMaximum number of non-exclusive passes performed before the final exclusive backup pass. (See Incremental Backup Implementation)backup_map_filenameName of the file used to store backup metadata onmco_db_close(). If left empty, the default name is<persistent-storage>.bmap, located in the same directory as the persistent database file. (See Incremental Backup Implementation)iot_agent_idIdentifier for the IoT agent.iot_levelIoT level that overrides the router's level defined in the MCO schema file.file_backup_delayDelay in milliseconds between writing backup blocks to minimize performance impact. The default is 0 (no delay). (See File Backup)filesys_media_ptrSystem-dependent pointer to the filesystem media. Used for custom I/O implementations.