wiki/duckdb/duckdb_variables-en.md
[ AliSQL DuckDB 引擎参数 | DuckDB Engine Variables in AliSQL ]
duckdb_modeNONENONE | ONON enables DuckDB; NONE disables it. This variable is read-only and can only be set at startup.duckdb_require_primary_keyONON | OFFNotes:
- DuckDB tables do not actually create indexes. Uniqueness for PRIMARY KEY / UNIQUE KEY must be guaranteed by the user.
- When using a DuckDB node as a replica, you must enable this variable to ensure replication correctness.
duckdb_memory_limit00 ~ ULLONG_MAX0 means automatic (typically ~80% of physical memory).Note: When DuckDB is enabled, it is recommended to reduce
innodb_buffer_pool_sizeto free more memory for DuckDB.
duckdb_temp_directoryduckdb_max_temp_directory_size0 (uses 90% of available disk space)0 ~ ULLONG_MAXduckdb_temp_directory. 0 means automatic (typically ~90% of free disk space).duckdb_threads0 (auto)0 ~ 10485760 lets the system choose based on CPU cores.duckdb_use_direct_ioOFFON | OFFNote: DuckDB Direct I/O is currently unstable and is not recommended.
duckdb_scheduler_process_partialONON | OFFduckdb_merge_join_threshold46116860184273879040 ~ 4611686018427387904duckdb_convert_all_at_startupOFFON | OFFduckdb_convert_all_at_startup_ignore_errorOFFON | OFFduckdb_convert_all_at_startup_threads41 ~ 64duckdb_convert_all_skip_mtr_dbOFFON | OFFmtr during startup conversion. Typically used only for test purposes. This variable is read-only and can only be configured before startup.duckdb_force_no_collationOFFON | OFFON may improve performance.duckdb_source_set_insert_only_to_binlogOFFON | OFFinsert_only flag in the binlog to optimize replication performance.duckdb_explain_outputPHYSICAL_ONLYALL | OPTIMIZED_ONLY | PHYSICAL_ONLYEXPLAIN: all plans, optimized plan only, or physical plan only.duckdb_multi_trx_in_batchOFFON | OFFduckdb_multi_trx_timeout5000 ms0 ~ 100000duckdb_multi_trx_max_batch_length256MB0 ~ ULLONG_MAXduckdb_commit_multi_trx_due_to_readerONON | OFFduckdb_commit_multi_trx_due_to_rotateONON | OFFduckdb_commit_multi_trx_due_to_rotate_frequency10 ~ 1048576duckdb_commit_multi_trx_due_to_rotate is enabled, commit once per N binlog rotate events. 0 means never; 1 means every time. Effective only on replicas.duckdb_copy_ddl_threads40 ~ 64innodb_parallel_read_threads.duckdb_checkpoint_threshold268435456 (256MB)0 ~ ULLONG_MAXduckdb_use_double_for_decimalONON | OFFNote: This affects the actual column type and should not be changed after the instance is created.
duckdb_disabled_optimizers0 (empty set)EXPRESSION_REWRITER, FILTER_PULLUP, FILTER_PUSHDOWN, EMPTY_RESULT_PULLUP,CTE_FILTER_PUSHER, REGEX_RANGE, IN_CLAUSE, JOIN_ORDER, DELIMINATOR,UNNEST_REWRITER, UNUSED_COLUMNS, STATISTICS_PROPAGATION, COMMON_SUBEXPRESSIONS,COMMON_AGGREGATE, COLUMN_LIFETIME, BUILD_SIDE_PROBE_SIDE, LIMIT_PUSHDOWN,TOP_N, COMPRESSED_MATERIALIZATION, DUPLICATE_GROUPS, REORDER_FILTER,SAMPLING_PUSHDOWN, JOIN_FILTER_PUSHDOWN, EXTENSION, MATERIALIZED_CTE,SUM_REWRITER, LATE_MATERIALIZATIONduckdb_data_import_modeOFFON | OFFNotes:
- Intended for bulk import: merges multiple INSERT/DELETE operations into a single batch to improve performance.
- This variable cannot be changed inside a transaction.
- When
ON, the modified table must have a primary key.- When
ON, UPDATE is not supported; rewrite UPDATE as DELETE + INSERT.- When
ON, unsupported DML will raise an error.- This variable takes effect only when
duckdb_dml_in_batchis enabled.
duckdb_idempotent_data_import_enabledOFFON | OFFduckdb_data_import_mode=ON, enables idempotent data import. If enabled, re-importing the same data (e.g., after restart/recovery) will not create duplicates.Note: Enabling idempotent import may reduce import performance.
duckdb_appender_allocator_flush_threshold64MB0 ~ ULLONG_MAXduckdb_log_options0 (no logging)DUCKDB_MULTI_TRX_BATCH_COMMIT, DUCKDB_MULTI_TRX_BATCH_DETAIL, DUCKDB_QUERY, DUCKDB_QUERY_RESULTforce_innodb_to_duckdbOFFON | OFFduckdb_copy_ddl_in_batchONON | OFFduckdb_dml_in_batchONON | OFFNotes:
- When enabled on a DuckDB replica and the primary uses row-based binlog, DuckDB automatically batches DML during replay.
- When enabled on a DuckDB primary, INSERT can be batched; whether DELETE can be batched depends on
duckdb_data_import_modeand its constraints; UPDATE cannot be batched.
update_modified_column_onlyONON | OFF