mco_db_params_t) in eXtremeDB/rtThe runtime settings for a database opened by
mco_db_open_dev()in eXtremeDB/rt are defined in themco_db_params_tstructure.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 disk_max_file_size; /* max size of database file */ mco_offs_t file_extension_quantum; /* File extension quantum to reduce fragmentation */ mco_uint2 connection_context_size; /* Recovery connection context size */ mco_uint2 hash_load_factor; /* Hash table load factor (%) */ unsigned int mode_mask; /* Open mode mask */ unsigned int min_conn_local_pages; /* Min pages in per-connection allocator */ unsigned 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 pages */ char* cipher_key; /* Database encryption key */ mco_bool dynamic_hash; /* Enable dynamic hash table extension */ unsigned int max_classes; /* Space reserved for classes (for dynamic schema) */ unsigned 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) */ unsigned int max_active_pages; /* Max pages accessed by a connection */ unsigned int page_hash_bundles; /* Bundles in page hash for encryption/compression */ unsigned int expected_compression_ratio; /* Expected compression ratio for page map allocation */ mco_uint1 btree_cursor_read_ahead_size; /* B-Tree cursor read-ahead size */ unsigned int additional_heap_size; /* Heap for internal DB operations (e.g., save/load) */ 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 */ mco_uint4 file_backup_delay; /* Delay between backup block writes (ms) */ unsigned int max_pi_readers; /* Max parallel read-only transactions (PI TM) */ mco_offs_t sync_threshold; /* Data amount to trigger fsync (avoid write storms) */ mco_offs_t flush_range; /* Range for sync_file_range (0 disables) */ mco_size_t tlb_cache_lines; /* TLB cache lines (for mcoxfile, if no MCO_DB_INMEM_PAGE_MAP) */ mco_size_t tlb_cache_ways; /* TLB cache ways */ mco_size_t meta_cache_lines; /* Metadata cache lines (for mcoxflash) */ mco_size_t meta_cache_ways; /* Metadata cache ways */ int flash_gc_ratio; /* Flash garbage collection aggressiveness */ mco_size_t rollback_buf_size; /* Size of copy-on-write rollback buffer */ } 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. For persistent and mixed-mode databases, this value must be a power of two.disk_page_sizeSize of a persistent storage page. Set to zero for all-in-memory databases. Must be a power of two.db_max_connectionsMaximum number of concurrent connections to the database.disk_max_database_sizeMaximum size of the persistent database on disk.Maximum size of the database file. The default is MCO_INFINITE_DATABASE_SIZE. This value should be larger thandisk_max_database_sizeplus the minimum size of a transaction.file_extension_quantumAllocation block size used when extending the database file. This can help reduce file fragmentation.connection_context_sizeSize of the application-specific context attached to each connection, used during recovery to verify that the connection's owner task is still alive.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.mode_maskBitmask of database open mode flags. Defined inmco.h.min_conn_local_pagesMinimum number of pages held by the per-connection allocator.max_conn_local_pagesMaximum number of pages held by the per-connection allocator.allocation_bitmap_caching_priorityCache priority for allocation bitmap pages. Higher values keep these pages in the LRU cache longer.index_caching_priorityCache priority for index pages. Higher values keep these pages in the LRU cache longer.object_caching_priorityCache priority for object (non-BLOB) pages. Higher values keep these pages in the LRU cache longer.cipher_keyEncryption key for the database.dynamic_hashEnables dynamic extension of hash tables when the number of items exceeds thehash_load_factor.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.trans_sched_policyScheduling policy for transactions with the same priority (e.g.,Fifo,ReaderFavor).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/rt runtime.max_active_pagesMaximum number of pages a single connection can access. The default is 32. Relevant when encryption, protection, or compression is enabled.page_hash_bundlesNumber of bundles in the internal page hash used for encryption, protection, or 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.btree_cursor_read_ahead_sizeNumber of keys pre-fetched from a B-Tree leaf page on each access. Cannot exceedMCO_CFG_CURSOR_BUF_SIZE.additional_heap_sizeAdditional heap memory allocated for internal database operations, primarily for buffering during XML export/import and database save/load operations.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.backup_min_pagesNumber of pages processed in the final exclusive pass of the backup procedure. Set to zero to disable this threshold.backup_max_passesMaximum number of non-exclusive passes performed before the final exclusive backup pass.file_backup_delayDelay in milliseconds between writing backup blocks to minimize performance impact. The default is 0 (no delay).max_pi_readersMaximum number of parallel read-only transactions supported by the Priority Inheritance (PI) transaction manager, which is the default in eXtremeDB/rt.sync_thresholdAmount of data written (in bytes) that triggers anfsync()call to avoid a "write storm" and long delays during transaction commit.flush_rangeRange (in bytes) for thesync_file_range()system call to prevent long blocking infsync(). A value of 0 disables this feature.tlb_cache_linesNumber of lines in the TLB (Translation Lookaside Buffer) cache for themcoxfiledriver. Used only when theMCO_DB_INMEM_PAGE_MAPmode is not set.tlb_cache_waysNumber of ways (associativity) in the TLB cache for themcoxfiledriver.meta_cache_linesNumber of lines in the metadata cache for themcoxflashdriver.meta_cache_waysNumber of ways (associativity) in the metadata cache for themcoxflashdriver.flash_gc_ratioAggressiveness of the flash garbage collection process. Controls how much free space is maintained to ensure wear leveling and performance.rollback_buf_sizeSize of the buffer used by the copy-on-write (COW) implementation for transaction rollbacks.
disk_max_file_sizeParameter SpecificsThe
disk_max_file_sizeparameter is used exclusively with the xfile library. It defines the maximum physical size of the database file on disk, which includes the file header, page maps, allocation ring buffer (if present), and physical data pages. By default, this parameter is set toMCO_INFINITE_DATABASE_SIZE. When configured this way, the physical file size can scale to approximately twice the logical database size specified by thedisk_max_database_sizeparameter, roughly equating toheader_size + page_map_size * 2 + alloc_buffer_size + disk_max_database_size * 2. This parameter is validated during initialization to ensure that the allocated file size is sufficient to execute transactions of minimum size.