Skip to main content

Configuration

SereneDB has a number of configuration options that can be used to change the behavior of the system. The defaults listed here are a server's; serened shell keeps DuckDB's defaults for some options, such as integer_division (false), preserve_identifier_case (true) and the default schema (main).

The configuration options can be set using either the SET statement or the PRAGMA statement. They can be reset to their original values using the RESET statement.

The values of configuration options can be queried via the current_setting() scalar function or the pg_settings view. For example:

SQL
SELECT current_setting('memory_limit') AS memlimit;
 memlimit
----------
 (varies)

Or:

SQL
SELECT setting AS memlimitFROM pg_settingsWHERE name = 'memory_limit';

Examples​

Set the memory limit of the system to 10 GB.

SQL
SET memory_limit = '10GB';

Configure the system to use 1 thread.

SQL
SET threads TO 1;

Turn logging on and set the logging level to debug. For additional details on logging levels, see Log Level.

SQL
SET enable_logging = true;
SET logging_level = 'debug';

Write a single log message with the debug level and a connection scope:

SQL
SELECT write_log('A new client has connected.', level := 'debug', scope := 'connection');
 write_log
-----------
 NULL

Write a single log message with a debug level and a connection scope and a custom log_type:

SQL
SELECT write_log(        'A new client has connected to SereneDB.',        level := 'debug',        scope := 'connection',        log_type := 'serenedb.docs.example'    );
 write_log
-----------
 NULL

Check logs with the DEBUG log level:

SQL
SELECT * FROM sdb_logs WHERE log_level = 'DEBUG';

Check logs with the QueryLog type:

SQL
SELECT * FROM sdb_logs WHERE type = 'QueryLog';

Check current logging settings:

SQL
SELECT * FROM sdb_settings() WHERE name LIKE '%logging%';

Enable printing of a progress bar during long-running queries:

SQL
SET enable_progress_bar = true;

Set the default null order to NULLS LAST:

SQL
SET default_null_order = 'nulls_last';

Return the current value of a specific setting:

SQL
SELECT current_setting('threads') AS threads;
 threads
----------
 (varies)

Query a specific setting:

SQL
SELECT *FROM sdb_settings()WHERE name = 'threads';

Show a list of all available settings:

SQL
SELECT *FROM sdb_settings();

Reset the memory limit of the system back to the default:

SQL
RESET memory_limit;

Secrets Manager​

SereneDB has a Secrets manager, which provides a unified user interface for secrets across all backends (e.g., AWS S3) that use them.

Configuration Reference​

Configuration options come with different default scopes: GLOBAL and LOCAL. Each scope is listed below, grouped by the part of the system the option affects.

To search the reference rather than read it, query the catalog — every option on this page is a setting object:

sql
SELECT name, summary FROM sdb_docs.objects
WHERE kind = 'setting' AND name LIKE 'compaction%';

Global Configuration Options​

Search and indexing​

Background maintenance of inverted indexes, and the knobs the search and vector operators read.

NameDescriptionTypeDefault value
cleanup_interval_stepNumber of commit ticks between background unreferenced-file cleanup passes for newly created inverted indexes. Per-index WITH (cleanup_interval_step = ...) overrides. 0 disables cleanup. Default: 1.UINTEGER1
compaction_floor_segment_bytesInverted-index segments below this size count as equal-sized for compaction candidate selection. Per-index WITH (compaction_floor_segment_bytes = ...) overrides. Default 2097152 (2MB).UBIGINT2097152
compaction_intervalBackground compaction interval (ms) for newly created inverted indexes. Per-index WITH (compaction_interval = ...) overrides. 0 disables the compaction task. Default: 1000.UINTEGER1000
compaction_max_segmentsMaximum inverted-index segments merged by one background compaction. Per-index WITH (compaction_max_segments = ...) overrides. Default 10.UINTEGER10
compaction_max_segments_bytesByte budget of one background inverted-index compaction (the tier target size). Per-index WITH (compaction_max_segments_bytes = ...) overrides. Default 5368709120 (5GB).UBIGINT5368709120
refresh_intervalBackground refresh interval (ms) for newly created inverted indexes. Per-index WITH (refresh_interval = ...) overrides. 0 disables the refresh task. Default: 1000.UINTEGER1000
reindex_intervalPeriodic reindex interval (ms) for newly created VIEW-backed inverted indexes: every tick runs the ordinary REINDEX road (up_to_date / delta / rebuild) as the index owner. Per-index WITH (reindex_interval = ...) overrides; ALTER INDEX SET retunes a live loop. 0 disables the task. Hint-less iceberg sources refresh from the background only when the GLOBAL unsafe_enable_version_guessing is set. Default: 0.UINTEGER0
sdb_disable_top_k_optimizationWhen true, the optimizer skips pulling ORDER BY <scorer>(...) DESC LIMIT k into the inverted-index scan, so block-max score pruning never engages. Default: false (optimization on).BOOLEANoff
sdb_hnsw_ef_searchSearch-time beam width (ef) for HNSW vector indexes. Higher values improve recall at the cost of latency. The beam is also the result ceiling: a value below the query's LIMIT returns fewer rows than asked for. Default 64.INTEGER64
sdb_ivf_max_search_fanoutMaximum number of IVF centroid-tree children expanded per node while descending to the probed clusters. Decouples the descent width from sdb_ivf_search_nprobe: lower values cut centroid work on deep (multi-level) trees at some recall cost. The width applies per node and so compounds over the tree's levels; it is raised when smaller than the width whose compounded value reaches sdb_ivf_search_nprobe, so the descent can always supply the requested number of clusters. Default 16.INTEGER16
sdb_ivf_posting_sizeTarget IVF posting-list size (leaf cap t), captured into the index config at CREATE INDEX. Smaller values force deeper multi-level centroid trees (useful for testing). Default 1024.INTEGER1024
sdb_ivf_sample_factorFraction of rows used to train the IVF centroid tree (sample_size = sample_factor * N), captured into the index config at CREATE INDEX. Any value in (0, 1]. Default 0.2.DOUBLE0.2
sdb_ivf_search_nprobeNumber of IVF cluster lists scanned per vector-similarity query. Higher values improve recall at the cost of latency. Default 8.INTEGER8
sdb_levenshtein_max_termsThe maximum number of dictionary terms a fuzzy predicate (ts_levenshtein) expands to per index segment. Terms closest to the query survive; the rest neither match nor contribute to scoring. Higher values improve recall on wide expansions at the cost of per-query work. 0 removes the cap, so every term within the edit distance matches. Default 50.INTEGER50
sdb_pattern_cache_sizeBytes of compiled search patterns (ts_regexp, ts_like, LIKE and fused alternations over an inverted index) kept across queries, so a pattern is compiled once per server rather than once per query. The least recently used patterns are dropped first; a pattern in use by a running query stays alive until it finishes. 0, the default, keeps nothing: each query compiles its own patterns. Server-global.UBIGINT0
sdb_rerank_factorMultiplier applied to LIMIT k to size the candidate pool re-scored with exact distances for a quantized IVF vector-similarity query (pool = ceil(sdb_rerank_factor * k)). Higher values improve recall at the cost of latency; 0 disables reranking (top-k picked by the approximate quantized distance). Fractional values are allowed, but a nonzero factor below 1 is rejected because the pool must cover k. Default 4. Unquantized (quant = 'none') indexes never rerank, regardless of this setting.DOUBLE4
segment_docs_maxDocument count at which an inverted-index segment writer rolls over to a new on-disk segment. Per-index WITH (segment_docs_max = ...) overrides. 0 = unlimited (memory limit governs).UINTEGER0
segment_memory_maxIn-memory bytes an inverted-index or search-table segment writer fills before rolling over to a new on-disk segment (also the CREATE INDEX backfill commit cadence, and half of it is the write buffer a serial search-table statement fills before it starts feeding the index as it goes). Per-object WITH (segment_memory_max = ...) overrides. Default 268435456 (256MB). See Write memory.UBIGINT268435456

AI functions​

Secrets, retries and quotas of the AI functions.

NameDescriptionTypeDefault value
sdb_ai_allow_insecure_endpointWhen false, AI functions refuse a secret whose base_url sends requests over plain http:// to a host other than localhost, 127.0.0.0/8 or ::1, because the prompts and the API key would travel unencrypted. Default: false.BOOLEANfalse
sdb_ai_embedding_default_secretName of the openai secret used by ai_embed and ai_similarity when the call does not pass secret_name. Default: '' (no default).VARCHAR
sdb_ai_embedding_max_batch_sizeMaximum number of texts ai_embed and ai_similarity send in one embeddings request. Default: 100.UINTEGER100
sdb_ai_max_api_calls_per_queryMaximum number of AI provider requests a single query may send. 0 = unlimited. Default: 0.UINTEGER0
sdb_ai_max_concurrent_requestsMaximum number of AI provider requests a query has in flight, across all of its AI calls and threads. Requests run on DuckDB's async I/O threads (async_threads) and on the threads that evaluate the calls. Default: 16.UINTEGER16
sdb_ai_max_output_tokens_per_queryMaximum number of output tokens, as reported by the provider, a single query may consume; checked before each request, so requests already in flight may exceed it. 0 = unlimited. Default: 0.UINTEGER0
sdb_ai_max_retriesHow many times an AI provider request is retried after a connection error or HTTP 408, 429, 5xx or 529. Default: 3.UINTEGER3
sdb_ai_request_timeoutTimeout of a single AI provider request, in seconds. Default: 120.UINTEGER120
sdb_ai_retry_initial_delay_msDelay before the first AI provider retry, in milliseconds; each further retry doubles it, up to 60 seconds. A Retry-After response header overrides it, up to 60 seconds. Default: 500.UINTEGER500
sdb_ai_system_one_default_secretName of the typesafe secret used by ai_system_one when the call does not pass secret_name. Default: '' (no default).VARCHAR
sdb_ai_text_default_secretName of the openai secret used by ai_generate, ai_classify, ai_classify_labels, ai_extract, ai_filter, ai_translate, ai_redact, ai_score, ai_rerank, ai_agg and ai_summarize_agg when the call does not pass secret_name. Default: '' (no default).VARCHAR
sdb_ai_throw_on_errorWhen true, a row whose AI function request fails fails the query; when false, that row returns NULL. Authentication, not-found, validation (422) and exhausted-quota (429 insufficient_quota) errors always fail the query. Default: true.BOOLEANtrue
sdb_ai_throw_on_quota_exceededWhen true, exceeding sdb_ai_max_api_calls_per_query or sdb_ai_max_output_tokens_per_query fails the query; when false, the remaining rows return NULL. Default: true.BOOLEANtrue

Memory and threads​

How much memory the engine may use and how many threads it runs.

NameDescriptionTypeDefault value
allocator_background_threadsWhether to enable the allocator background thread.BOOLEANfalse
allocator_bulk_deallocation_flush_thresholdIf a bulk deallocation larger than this occurs, flush outstanding allocations.VARCHAR512.0 MiB
allocator_flush_thresholdPeak allocation threshold at which to flush the allocator after completing a task.VARCHAR128.0 MiB
async_threadsThe number of total async threads used by the system for tasks like I/O; a session or transaction value caps the async threads its queries use (see SET).BIGINT64
block_allocator_memoryPhysical memory that the block allocator is allowed to use (this memory is never freed and cannot be reduced).VARCHAR0 bytes
max_memoryThe maximum memory of the system (e.g. 1GB).VARCHAR80% of RAM
max_temp_directory_sizeThe maximum amount of data stored inside the 'temp_directory' (when set) (e.g., 1GB)VARCHAR90% of available disk space
memory_limitAlias of max_memory.VARCHAR80% of RAM
temp_file_encryptionEncrypt all temporary files if database is encryptedBOOLEANfalse
threadsThe number of total threads used by the system; a session or transaction value caps the threads its queries use (see SET).BIGINTthe number of CPU cores
worker_threadsAlias of threads.BIGINTthe number of CPU cores
write_buffer_row_group_memory_limitThe maximum data to buffer in row groups (in bytes) to buffer prior to flushing them together. When either this limit is reached, or write_buffer_row_group_count is reached, we flush the data to disk. Defaults to 20% of memory limit divided by thread count.VARCHAR925.0 MiB

Storage and checkpointing​

Durability, the write-ahead log, and how rows are laid out on disk.

NameDescriptionTypeDefault value
checkpoint_on_detachOverride checkpoint behavior when detaching a database. ENABLED always checkpoints, DISABLED never checkpoints, DEFAULT defers to the global checkpoint_on_shutdown setting.VARCHARDEFAULT
checkpoint_thresholdThe WAL size threshold at which to automatically trigger a checkpoint (e.g. 1GB).VARCHAR16.0 MiB
default_block_sizeThe default block size for new duckdb database files (new as-in, they do not yet exist).UBIGINT262144
disabled_compression_methodsDisable a specific set of compression methods (comma separated)VARCHAR
enable_optimistic_writeWhether or not to optimistically write large appends to disk before committing. Disable this to keep bulk appends in memory.BOOLEANtrue
fsync_modeHow to synchronize database file changes to stable storage (STANDARD, NONE or FULL). NONE may cause database corruption after an operating system or hardware crash.VARCHARSTANDARD
initial_column_segment_sizeThe initial memory (in bytes) reserved for the first transient column segment. Must be a power of two. Internally, we subtract the block header size (typically 8 bytes) for segments with or exceeding 1024 bytes. Subsequent segments double in size until reaching the block size.UBIGINT2048
recovery_replay_depthMaximum WAL chunks in flight per inverted index during recovery replay (the prefetch window; bounds replay memory). 0 = auto (4 x cpu threads).UINTEGER0
row_group_sizeDefault columnstore row-group size for newly created inverted indexes. Per-index WITH (row_group_size = ...) overrides it. Reads from existing indexes are unaffected. Default: 122'880.UINTEGER122880
storage_block_prefetchIn which scenarios to use storage block prefetchingVARCHARREMOTE_ONLY
storage_compatibility_versionSerialize on checkpoint with compatibility for a given duckdb versionVARCHARlatest
wal_autocheckpointAlias of checkpoint_threshold.VARCHAR16.0 MiB
wal_autocheckpoint_entriesTrigger automatic checkpoint when WAL entry count reaches or exceeds N (0 = disabled)UBIGINT0
write_buffer_row_group_countThe amount of row groups to buffer in bulk ingestion prior to flushing them together. Reducing this setting can reduce memory consumption.UBIGINT5

Query execution and the optimizer​

Planning, rewriting and the shape of query output.

NameDescriptionTypeDefault value
approximate_join_order_thresholdThe minimum number of tables in a join to determine the optimal join order approximately instead of exactly.UBIGINT12
asof_loop_join_thresholdThe maximum number of rows we need on the left side of an ASOF join to use a nested loop joinUBIGINT64
default_null_orderNULL ordering used when none is specified (NULLS_FIRST or NULLS_LAST).VARCHARNULLS_LAST
delim_join_as_cteRewrite delim joins to materialized CTEs during dependent join flattening.BOOLEANon
disabled_optimizersDEBUG SETTING: disable a specific set of optimizers (comma separated).VARCHAR
dynamic_or_filter_thresholdThe maximum amount of OR filters we generate dynamically from a hash joinUBIGINT50
enable_caching_operatorsEnables caching operators that cache intermediate results.BOOLEANon
enable_optimizerWhether or not query optimization is enabled.BOOLEANon
explain_outputOutput of EXPLAIN statements (ALL, OPTIMIZED_ONLY, PHYSICAL_ONLY)VARCHARPHYSICAL_ONLY
explain_output_formatColumn shape of EXPLAIN output (DUCKDB_NATIVE = native two-column key/value, PG = single QUERY PLAN column with one row per line).VARCHARPG
late_materialization_max_rowsThe maximum amount of rows in the LIMIT/SAMPLE for which we trigger late materializationUBIGINT50
match_recognize_max_statesThe maximum number of pattern states MATCH_RECOGNIZE explores for a single match before it refuses the pattern (0 = no limit).UBIGINT1000000
max_expression_depthThe maximum expression depth limit in the parser. WARNING: increasing this setting and using very deep expressions might lead to stack overflow errors.UBIGINT1000
max_streaming_buffer_sizeThe maximum number of bytes a streaming query result buffers (e.g. 1GB).VARCHAR10.0 MiB
merge_join_thresholdThe maximum number of rows on either table to choose a merge joinUBIGINT1000
nested_loop_join_thresholdThe maximum number of rows on either table to choose a nested loop joinUBIGINT5
null_orderAlias of default_null_order.VARCHARNULLS_LAST
order_by_non_integer_literalAllow ordering by non-integer literals - ordering by such literals has no effect.BOOLEANfalse
ordered_aggregate_thresholdThe number of rows to accumulate before sorting, used for tuningUBIGINT262144
partitioned_write_flush_thresholdThe threshold in number of rows after which we flush a thread state when writing using PARTITION_BYUBIGINT524288
partitioned_write_max_open_filesThe maximum amount of files the system can keep open before flushing to disk when writing using PARTITION_BYUBIGINT100
prefer_range_joinsForce use of range joins with mixed predicatesBOOLEANfalse
preserve_insertion_orderWhether or not to preserve insertion order. If set to false the system is allowed to re-order any results that do not contain ORDER BY clauses.BOOLEANtrue
read_ahead_depthThe number of scan jobs prefetched ahead of decoding (-1 = automatic, bounded by a memory budget; 0 = disabled).BIGINT-1
scalar_subquery_error_on_multiple_rowsWhen a scalar subquery returns multiple rows - return a random row instead of returning an error.BOOLEANtrue
sdb_job_max_depthMaximum number of job runs in one chain of EXECUTE JOB calls, where a job's body executes another job; a run that would go deeper fails. Default 16. Server-global.UINTEGER16
standard_vector_sizeThe compiled-in STANDARD_VECTOR_SIZE (read-only).UBIGINT2048

Session and PostgreSQL compatibility​

Wire-protocol and session state that PostgreSQL clients read or set.

NameDescriptionTypeDefault value
access_modeAccess mode of the database (AUTOMATIC, READ_ONLY or READ_WRITE)VARCHARautomatic
bytea_outputSets the output format for bytea.VARCHARhex
CalendarThe current calendarVARCHARSystem (locale) calendar
client_encodingSets the client's character set encoding.VARCHARUTF8
client_min_messagesSets the message levels that are sent to the client.VARCHARnotice
current_transaction_invalidation_policyWhich types of exceptions invalidate the database for the current transactionVARCHARSTANDARD_POLICY
custom_user_agentMetadata from SereneDB callersVARCHAR
DateStyleSets the display format for date and time values.VARCHARISO, MDY
default_transaction_invalidation_policyWhen to invalidate transactions when errors occur (SYNTACTIC_ERRORS_DO_NOT_INVALIDATE, i.e. parser and binder exceptions do not invalidate, or ALL_ERRORS_INVALIDATE_TRANSACTION).VARCHARALL_ERRORS_INVALIDATE_TRANSACTION
default_transaction_isolationSets the transaction isolation level of each new transaction.VARCHARrepeatable read
default_transaction_read_onlySets the default read-only status of new transactions.BOOLEANoff
dialect_compatibility_modeEnable SQL dialect compatibility for a certain engine (e.g. SET dialect_compatibility_mode='spark').VARCHARNONE
duckdb_apiSereneDB API surfaceVARCHARcli
error_on_division_by_zeroThrow an error instead of returning NULL when dividing by zero.BOOLEANtrue
errors_as_jsonOutput error messages as structured JSON instead of as a raw stringBOOLEANfalse
extra_float_digitsSets the number of digits displayed for floating-point values.INTEGER1
immediate_transaction_modeWhether transactions should be started lazily when needed, or immediately when BEGIN TRANSACTION is calledBOOLEANfalse
in_hot_standbyShows whether hot standby is currently active.BOOLEANoff
integer_datetimesShows whether datetimes are integer based.BOOLEANon
IntervalStyleSets the display format for interval values.VARCHARpostgres
lock_configurationWhether or not configurations can be alteredBOOLEANfalse
max_execution_timeThe maximum execution time per query in milliseconds (0 = no limit).BIGINT0
pg_idle_in_transaction_timeout_millisPostgres idle in transaction timeout in milliseconds to set on scan connections.UINTEGER
regex_match_operator_semanticsConfigures whether regex match operators use partial or full string matching.VARCHARpartial
roleSets the current role.VARCHAR
server_encodingShows the server (database) character set encoding.VARCHARUTF8
server_versionShows the server version.VARCHAR18.3
server_version_numShows the server version as an integer.INTEGER
show_behaviorConfigures how SHOW resolves a bare identifier: auto describes a table if one exists, else a setting (deprecated); table always describes a table; setting always describes a setting.VARCHARSETTING
standard_conforming_stringsCauses '...' strings to treat backslashes literally.BOOLEANon
statement_timeoutAborts any statement that takes more than the specified amount of time (milliseconds without a unit; units us, ms, s, min, h, d) with SQLSTATE 57014, as in PostgreSQL. 0 disables the timeout. Sets max_execution_time for the same scope.VARCHAR0
table_function_identifier_conversionConfigures the use of deprecated implicit conversion of unbound identifiers to strings in table function arguments.VARCHARDISABLE_IMPLICIT_STRING
TimeZoneThe current time zoneVARCHARSystem (locale) timezone

Logical replication​

Server-wide settings of subscriptions. Only a superuser may set them, and a change applies to running subscriptions too.

NameDescriptionTypeDefault value
max_sync_workers_per_subscriptionHow many tables one subscription copies at the same time during its initial synchronization, each over its own publisher connection (a walsender on the publisher).UINTEGER2
wal_receiver_status_intervalHow often a subscription reports its position to the publisher (seconds without a unit; units us, ms, s, min, h, d). 0 disables the periodic reports.VARCHAR10s
wal_receiver_timeoutA subscription whose publisher sends nothing for this long drops the connection and reconnects (milliseconds without a unit). 0 disables the timeout.VARCHAR1min
wal_retrieve_retry_intervalHow long a failed subscription waits before it reconnects (milliseconds without a unit).VARCHAR5s

Security​

Authentication, authorization and what the server is allowed to reach.

NameDescriptionTypeDefault value
allow_asterisks_in_http_pathsAllow '*' character in URLs users can queryBOOLEANfalse
allow_community_extensionsAllow to load community built extensionsBOOLEANtrue
allow_extensions_metadata_mismatchAllow to load extensions with not compatible metadataBOOLEANfalse
allow_persistent_secretsAllow the creation of persistent secrets, that are stored and loaded on restartsBOOLEANtrue
allow_unredacted_secretsAllow printing unredacted secretsBOOLEANfalse
allow_unsigned_extensionsAllow to load extensions with invalid or missing signaturesBOOLEANfalse
enable_external_accessAllow the database to access external state (through e.g., loading/installing modules, COPY TO/FROM, CSV readers, pandas replacement scans, etc)BOOLEANtrue
enable_macro_dependenciesEnable created MACROs to create dependencies on the referenced objects (such as tables)BOOLEANtrue
hbaHost-based authentication ruleset (pg_hba.conf syntax) as a single string: one rule per line, first match wins, applied to connections opened after the SET. An un-removable local + loopback trust rule is force-prepended so a bad ruleset cannot lock you out; an empty value restores the default (unix trust + SCRAM for TCP). Server-global.VARCHAR
scram_iterationsSets the iteration count for SCRAM secret generation.INTEGER4096
secret_directorySet the directory to which persistent secrets are storedVARCHAR<datadir>/secrets

Logging, metrics and profiling​

What the server records about itself.

NameDescriptionTypeDefault value
enable_loggingEnables the loggerBOOLEAN1
legacy_metrics_formatWhen enabled, profiling output uses the legacy flat format instead of the current grouped format.BOOLEANoff
log_query_pathSpecifies the path to which queries should be logged (default: NULL, queries are not logged)VARCHAR
logging_levelThe log level which will be recorded in the logVARCHARINFO
logging_modeDetermines which types of log messages are loggedVARCHARLEVEL_ONLY
logging_storageSet the logging storage (memory/stdout/file/<custom>)VARCHARstdout
sdb_job_history_sizeNumber of recent job runs, across all jobs, that sdb_job_runs() returns; the oldest run is dropped first. 0 keeps none. Default 1024. Server-global.UBIGINT1024

Files, object stores and caching​

Local paths, remote object stores and the external file cache.

NameDescriptionTypeDefault value
ca_cert_filePath to a custom certificate file for self-signed certificates.VARCHAR
cache_local_filesWhether the external file cache also caches local files (remote files are always cached).BOOLEANoff
enable_fsst_vectorsAllow scans on FSST compressed segments to emit compressed vectors to utilize late decompressionBOOLEANfalse
enable_server_cert_verificationEnable server side certificate verification.BOOLEANfalse
extension_directorySet the directory to store extensions inVARCHAR<datadir>/extensions
external_file_cache_local_max_block_sizeMaximum size in bytes of an external file cache block for local (non-remote) files. Larger reads are split into blocks of this size, which are fetched in parallel.UBIGINT16384
external_file_cache_remote_max_block_sizeMaximum size in bytes of an external file cache block for remote files (e.g. HTTP/S3). Larger reads are split into blocks of this size, which are fetched in parallel.UBIGINT2097152
external_file_cache_remote_min_block_sizeReads of remote files are rounded out to aligned blocks of this size, so tiny reads do not each cost a request.UBIGINT4096
external_file_cache_spillWhether evicted external file cache blocks of remote files spill to the temporary directory instead of being dropped, so they are re-read from there rather than re-fetched.BOOLEANfalse
extra_http_headersExtra HTTP headers added to every request.MAP(VARCHAR, VARCHAR){}
force_downloadForces upfront download of fileBOOLEANfalse
gcs_user_projectGCS billing project for Requester Pays.VARCHAR
hf_max_per_pageDebug option to limit number of items returned in list requests.UBIGINT0
home_directorySets the home directory used by the systemVARCHAR
http_client_pool_capacityHTTP client pool capacity, derived from the CPU and async thread counts unless explicitly set.BIGINT128
http_keep_aliveKeep alive connections. Setting this to false can help when running into connection failuresBOOLEANtrue
http_proxyHTTP proxy hostVARCHAR
http_proxy_passwordPassword for HTTP proxyVARCHAR
http_proxy_usernameUsername for HTTP proxyVARCHAR
http_retriesHTTP retries on I/O errorUBIGINT3
http_retry_backoffBackoff factor for exponentially increasing retry wait timeFLOAT4
http_retry_wait_msTime between retriesUBIGINT100
http_timeoutHTTP timeout read/write/connection/retry (in seconds)UBIGINT30
s3_access_key_idS3 Access Key IDVARCHARNULL
s3_allow_recursive_globbingWhether globs on S3-like storage are optimized with recursive strategy (alterative is listing)BOOLEANtrue
s3_endpointS3 EndpointVARCHARNULL
s3_kms_key_idS3 KMS Key IDVARCHARNULL
s3_list_concurrencyMaximum number of concurrent LIST requests issued while expanding an S3 glob. The window is also bounded by async_threads + 1 and shrinks automatically when the server throttles.UBIGINT256
s3_regionS3 RegionVARCHARNULL
s3_requester_paysS3 use requester pays modeBOOLEANfalse
s3_secret_access_keyS3 Access KeyVARCHARNULL
s3_session_tokenS3 Session TokenVARCHARNULL
s3_uploader_max_filesizeS3 Uploader max filesize (between 50GB and 5TB)VARCHAR800GB
s3_uploader_max_parts_per_fileS3 Uploader max parts per file (between 1 and 10000)UBIGINT10000
s3_url_compatibility_modeDisable Globs and Query Parameters on S3 URLsBOOLEANfalse
s3_url_scheme_aliasesAdditional URL schemes routed to the S3-compatible filesystem (e.g. ['oss', 'cos']). Can only be set globally; secrets for aliased schemes need an explicit SCOPE.VARCHAR[][]
s3_url_styleS3 URL styleVARCHARvhost
s3_use_sslS3 use SSLBOOLEANtrue
s3_version_id_pinningPin S3 reads to a specific object version for consistencyBOOLEANfalse
temp_directorySet the directory to which to write temp filesVARCHAR<datadir>/tmp

Database connectors​

Settings for the PostgreSQL and ClickHouse connectors.

NameDescriptionTypeDefault value
pg_array_as_varcharRead Postgres arrays as varchar - enables reading mixed dimensional arrays.BOOLEANoff
pg_connection_cacheWhether or not to use the connection pooling. This option is deprecated, instead to disable the connection pooling use "SET pg_pool_max_connections=0" for newly attached Postgres databases and "FROM postgres_configure_pool(catalog_name='my_attached_postgres_db', max_connections=0)" for already attached Postgres databases.BOOLEANon
pg_connection_limitThe maximum amount of concurrent Postgres connections. This option is deprecated, instead use "SET pg_pool_max_connections = 42" for newly attached Postgres databases and "FROM postgres_configure_pool(catalog_name='my_attached_postgres_db', max_connections=42)" for already attached Postgres databases.UBIGINT32
pg_experimental_filter_pushdownWhether or not to use filter pushdown.BOOLEANon
pg_null_byte_replacementWhen writing NULL bytes to Postgres, replace them with the given character.VARCHAR
pg_oauth_tokenOAuth bearer token for PostgreSQL OAUTHBEARER authentication. Takes priority over the PGOAUTHTOKEN environment variable.VARCHAR
pg_order_pushdownPush ORDER BY and LIMIT clauses to Postgres (default: true).BOOLEANon
pg_pages_per_taskThe amount of pages per task.UBIGINT1000
pg_statement_timeout_millisPostgres statement timeout in milliseconds to set on scan connections.UINTEGER
pg_use_binary_copyWhether or not to use BINARY copy to read data.BOOLEANon
pg_use_ctid_scanWhether or not to parallelize scanning using table ctids.BOOLEANon
pg_use_text_protocolWhether or not to use TEXT protocol to read data. This is slower, but provides better compatibility with non-Postgres systems.BOOLEANoff

File formats​

Defaults for the CSV, Parquet, JSON, Arrow and Iceberg readers and writers.

NameDescriptionTypeDefault value
arrow_large_buffer_sizeWhether Arrow buffers for strings, blobs, uuids and bits should be exported using large buffersBOOLEANfalse
arrow_lossless_conversionWhenever a SereneDB type does not have a clear native or canonical extension match in Arrow, export the types with a duckdb.type_name extension name.BOOLEANfalse
arrow_output_list_viewWhether export to Arrow format should use ListView as the physical layout for LIST columnsBOOLEANfalse
arrow_output_versionWhether strings should be produced by SereneDB in Utf8View format instead of Utf8VARCHAR1.0
binary_as_stringIn Parquet files, interpret binary data as a string.BOOLEANfalse
copy_csv_header_defaultWhether COPY ... TO a CSV file writes a header line when HEADER is not specified.BOOLEANoff
parquet_metadata_cacheCache Parquet metadata - useful when reading the same files multiple timesBOOLEANfalse
parquet_prefetch_column_gapByte gap under which Parquet prefetch I/O ranges are coalesced (NULL lets the cost model adapt it).UBIGINT
produce_arrow_string_viewWhether Arrow strings should be produced by SereneDB in Utf8View format instead of Utf8BOOLEANfalse

Extensions​

Installing and loading extensions.

NameDescriptionTypeDefault value
autoinstall_extension_repositoryOverrides the custom endpoint for extension installation on autoloadingVARCHAR
autoinstall_known_extensionsWhether known extensions are allowed to be automatically installed when a query depends on themBOOLEANfalse
autoload_known_extensionsWhether known extensions are allowed to be automatically loaded when a query depends on themBOOLEANfalse
custom_extension_repositoryOverrides the custom endpoint for remote extension installationVARCHAR
extension_directoriesSet the directories to store extensions inVARCHAR[][]

Debugging and unsafe options​

Not for production. These exist to reproduce and diagnose engine behaviour, and several can corrupt data.

NameDescriptionTypeDefault value
disable_database_invalidationDisables invalidating the database instance when encountering a fatal error. Should be used with great care, as SereneDB cannot guarantee correct behavior after a fatal error.BOOLEANtrue
disable_parquet_prefetchingDisable the prefetching mechanism in ParquetBOOLEANfalse
disable_timestamptz_castsDisable casting from timestamp to timestamptzBOOLEANfalse
enable_view_dependenciesEnable created VIEWs to create dependencies on the referenced objects (such as tables)BOOLEANtrue
force_download_thresholdForces upfront download of files smaller than the given size in bytesUBIGINT0
force_mbedtls_unsafeEnable mbedtls for encryption (WARNING: unsafe to use)BOOLEANfalse
force_variant_shreddingForces the VARIANT shredding that happens at checkpoint to use the provided schema for the shredding.VARCHARINVALID
legacy_disable_null_typeWhen enabled, prevent the NULL type from leaving the binder (< v2.0 default behavior).BOOLEANoff
old_implicit_castingAllow implicit casting to/from VARCHARBOOLEANfalse
unsafe_disable_etag_checksDisable checks on ETag consistencyBOOLEANfalse

Other​

Everything that does not fall into the groups above.

NameDescriptionTypeDefault value
__delta_only_variant_encoding_enabledEnables the Parquet reader to identify a Variant structurally.BOOLEANfalse
allowed_configsList of configuration options that are ALWAYS allowed to be changed - even when lock_configuration is trueVARCHAR[][]
allowed_directoriesList of directories/prefixes that are ALWAYS allowed to be queried - even when enable_external_access is falseVARCHAR[][]
allowed_pathsList of files that are ALWAYS allowed to be queried - even when enable_external_access is falseVARCHAR[][]
auto_checkpoint_skip_wal_thresholdThe estimated WAL write size at which point we will skip writing to the WAL and only checkpoint. Skipping writing to the WAL means concurrent commits are blocked while the checkpoint is happening.UBIGINT100000
auto_fallback_to_full_downloadAllows automatically falling back to full file downloads when possible.BOOLEANtrue
catalog_error_max_schemasThe maximum number of schemas the system will scan for "did you mean..." style errors in the catalogUBIGINT100
default_collationThe collation setting used when none is specifiedVARCHAR
default_orderThe order type used when none is specified (ASC or DESC)VARCHARASCENDING
default_secret_storageAllows switching the default storage for secretsVARCHARlocal_file
disabled_filesystemsDisable specific file systems preventing access (e.g., LocalFileSystem)VARCHAR
disabled_log_typesSets the list of disabled loggersVARCHAR
enable_curl_server_cert_verificationEnable server side certificate verification for CURL backend.BOOLEANtrue
enable_external_file_cacheAllow the database to cache external files (e.g., Parquet) in memory.BOOLEANtrue
enable_geoparquet_conversionAttempt to decode/encode geometry data in/as GeoParquet files if the spatial extension is present.BOOLEANtrue
enable_global_s3_configurationAutomatically fetch AWS credentials from environment variables.BOOLEANtrue
enable_http_metadata_cacheWhether or not the global http metadata is used to cache HTTP metadataBOOLEANfalse
enabled_log_typesSets the list of enabled loggersVARCHAR
experimental_metadata_reuseEXPERIMENTAL: Re-use row group and table metadata when checkpointing.BOOLEANtrue
external_threadsThe number of external threads that work on SereneDB tasks.UBIGINT0
file_search_pathA comma separated list of directories to search for input filesVARCHAR
geometry_minimum_shredding_sizeMinimum size of a rowgroup to enable GEOMETRY shredding, or set to -1 to disable entirely. Defaults to 1/4th of a rowgroupBIGINT30000
httpfs_connection_cachingEnable connection caching for HTTP requestsBOOLEANtrue
ieee_floating_point_opsUse IEE754-compliant floating point operations (returning NAN instead of errors/NULL).BOOLEANtrue
ignore_unknown_crsIgnore unknown Coordinate Reference Systems (CRS) when creating geometry types or importing geospatial data.BOOLEANfalse
index_scan_max_countThe maximum index scan count sets a threshold for index scans. If fewer than MAX(index_scan_max_count, index_scan_percentage * total_row_count) rows match, we perform an index scan instead of a table scan.UBIGINT2048
index_scan_percentageThe index scan percentage sets a threshold for index scans. If fewer than MAX(index_scan_max_count, index_scan_percentage * total_row_count) rows match, we perform an index scan instead of a table scan.DOUBLE0.001
integer_divisionWhether or not the / operator defaults to integer division, or to floating point divisionBOOLEANtrue
lambda_syntaxConfigures the use of the deprecated single arrow operator (->) for lambda functions.VARCHARENABLE_SINGLE_ARROW
max_vacuum_tasksThe maximum vacuum tasks to schedule during a checkpoint.UBIGINT100
merge_http_secret_into_s3_requestMerges http secret params into S3 requestsBOOLEANtrue
perfect_ht_thresholdThreshold in bytes for when to use a perfect hash tableUBIGINT12
pin_threadsWhether to pin threads to cores (Linux only, default AUTO: on when there are more than 64 cores)VARCHARauto
pivot_filter_thresholdThe threshold to switch from using filtered aggregates to LIST with a dedicated pivot operatorUBIGINT20
pivot_limitThe maximum number of pivot columns in a pivot statementUBIGINT100000
preserve_identifier_caseWhether or not to preserve the identifier case, instead of always lowercasing all non-quoted identifiersBOOLEANfalse
scheduler_process_partialPartially process tasks before rescheduling - allows for more scheduler fairness between separate queriesBOOLEANtrue
vacuum_rebuild_indexes(Experimental) Allow vacuum to compact row groups on tables with bound ART indexes, rebuilding the indexes afterward. Tables with a row count exceeding this threshold are skipped. 0 = disabled.UBIGINT0
validate_external_file_cacheCache validation mode: VALIDATE_ALL (default, validate all cache entries), VALIDATE_REMOTE (validate only remote cache entries), or NO_VALIDATION (disable cache validation).VARCHARVALIDATE_ALL
variant_minimum_shredding_sizeMinimum size of a rowgroup to enable VARIANT shredding, or set to -1 to disable entirely. Defaults to 1/4th of a rowgroupBIGINT30000
warnings_as_errorsEscalate all warnings to errors.BOOLEANfalse
zstd_min_string_lengthThe (average) length at which to enable ZSTD compression, defaults to 4096UBIGINT4096

Local Configuration Options​

Memory and threads​

How much memory the engine may use and how many threads it runs.

NameDescriptionTypeDefault value
operator_memory_limitThe maximum memory for query intermediates (sorts, hash tables) per connection (e.g. 256MB).VARCHAR

Query execution and the optimizer​

Planning, rewriting and the shape of query output.

NameDescriptionTypeDefault value
filter_reorderHow far filter reordering may move conditions that can fail (never, safe, fast or always)VARCHARfast

Session and PostgreSQL compatibility​

Wire-protocol and session state that PostgreSQL clients read or set.

NameDescriptionTypeDefault value
application_nameSets the application name to be reported in statistics and logs.VARCHAR
is_superuserShows whether the current session's user is a superuser.BOOLEANon
search_pathSets the default catalog search path as a comma-separated list of valuesVARCHAR"$user", public
session_authorizationSets the current session's user name.VARCHAR
session_replication_roleSets the session's behavior for triggers, as in PostgreSQL: origin (the default) and local fire the triggers enabled with ENABLE TRIGGER, replica fires only those enabled with ENABLE REPLICA TRIGGER and skips foreign key checks; ENABLE ALWAYS triggers fire in every role. Only superusers may change it. The apply worker of a subscription runs as replica.VARCHARorigin
transaction_isolationSets the current transaction's isolation level.VARCHARrepeatable read

Logging, metrics and profiling​

What the server records about itself.

NameDescriptionTypeDefault value
enable_http_logging(deprecated) Enables HTTP loggingBOOLEANtrue
enable_profilingEnables profiling, and sets the output format (JSON, QUERY_TREE, QUERY_TREE_OPTIMIZER)VARCHARNULL
enable_progress_barEnables the progress bar, printing progress to the terminal for long queriesBOOLEANtrue
enable_progress_bar_printControls the printing of the progress bar, when 'enable_progress_bar' is trueBOOLEANfalse
http_logging_output(deprecated) The file to which HTTP logging output should be saved, or empty to print to the terminalVARCHAR
profile_outputThe file to which profile output should be saved, or empty to print to the terminal.VARCHAR
profiling_coverageThe profiling coverage (SELECT or ALL)VARCHARSELECT
profiling_modeThe profiling mode (STANDARD or DETAILED)VARCHARNULL
profiling_outputAlias of profile_output.VARCHAR
profiling_renderer_settingsA map of settings passed to the renderer of the profiler output (e.g. {'max_extra_lines': 100}) - settings not recognized by the active renderer are ignored.MAP(VARCHAR, VARCHAR){}
progress_bar_timeSets the time (in milliseconds) how long a query needs to take before we start printing a progress barBIGINT2000
tracked_metricsA list of metric glob patterns to enable for collection (e.g. ['query.', 'optimizer.']).VARCHAR[][*]

Other​

Everything that does not fall into the groups above.

NameDescriptionTypeDefault value
schemaSets the default search schema. Equivalent to setting search_path to a single value.VARCHARpublic
streaming_buffer_sizeThe maximum memory to buffer between fetching from a streaming result (e.g., 1GB)VARCHAR976.5 KiB