{"id":"sql-configuration/mysql/back-log","corpus":"sql-configuration","engine":"mysql","language":"en","title":"back_log (MySQL)","description":"MySQL back_log: Depth of the listen queue for incoming TCP connections. Default: -1 (autosized).","body":{"engine":"mysql","slug":"back-log","name":"back_log","topic":"connections","summary":"Depth of the listen queue for incoming TCP connections.","detail":"When many connection requests arrive within a very short time, faster than the main thread can check each one and start a thread for it, the extras queue up to this depth. Beyond the depth the OS refuses new connections, which clients see as failed or timed-out connects. It autosizes to max_connections so the queue can absorb a full connection burst.","default":"-1 (autosized)","default_note":"Autosized to max_connections, 151 with defaults (MySQL 8.4); do not assign -1 yourself.","range":"1 to 65535","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'back_log';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'back_log';","change":"SET PERSIST_ONLY back_log = 2048;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"When clients fail to connect during a reconnect burst, such as after a failover or an application restart, while Threads_connected stays below max_connections.","risk":"The OS caps the queue on its own: on Linux the effective value is the smaller of this and net.core.somaxconn, so a large setting can sit silently capped. Requests that do not fit the queue are refused, not delayed.","related":["max-connections","thread-cache-size","connect-timeout"],"faqs":[{"question":"What is the default value of back_log in MySQL?","answer":"-1 (autosized). Autosized to max_connections, 151 with defaults (MySQL 8.4); do not assign -1 yourself."},{"question":"Does changing back_log require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change back_log?","answer":"When clients fail to connect during a reconnect burst, such as after a failover or an application restart, while Threads_connected stays below max_connections."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/back-log","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/binlog-expire-logs-seconds","corpus":"sql-configuration","engine":"mysql","language":"en","title":"binlog_expire_logs_seconds (MySQL)","description":"MySQL binlog_expire_logs_seconds: Age after which binary log files are purged automatically. Default: 2592000 (30 days).","body":{"engine":"mysql","slug":"binlog-expire-logs-seconds","name":"binlog_expire_logs_seconds","topic":"durability","summary":"Age after which binary log files are purged automatically.","detail":"Purging runs at startup and when the binary log rotates, not on a timer, so a quiet primary can keep expired files until something forces a rotation; FLUSH BINARY LOGS does it immediately. MySQL purges without checking replica positions, which is why a lagging replica is the risk below.","default":"2592000 (30 days)","default_note":"30 days since MySQL 8.0 (MySQL 8.4).","range":"0 to 4294967295 seconds (0 disables purging)","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'binlog_expire_logs_seconds';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'binlog_expire_logs_seconds';","change":"SET GLOBAL binlog_expire_logs_seconds = 604800;    -- until the next restart\nSET PERSIST binlog_expire_logs_seconds = 604800;   -- now and after restarts","when":"Shorten it when binlogs fill the disk and backups plus replicas do not need 30 days; lengthen it to cover your point-in-time recovery window.","risk":"A replica that falls further behind than the retention can no longer catch up and must be rebuilt.","related":["log-bin"],"faqs":[{"question":"What is the default value of binlog_expire_logs_seconds in MySQL?","answer":"2592000 (30 days). 30 days since MySQL 8.0 (MySQL 8.4)."},{"question":"Does changing binlog_expire_logs_seconds require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change binlog_expire_logs_seconds?","answer":"Shorten it when binlogs fill the disk and backups plus replicas do not need 30 days; lengthen it to cover your point-in-time recovery window."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/binlog-expire-logs-seconds","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/binlog-format","corpus":"sql-configuration","engine":"mysql","language":"en","title":"binlog_format (MySQL)","description":"MySQL binlog_format: Whether the binary log stores statements, row changes, or a mix. Default: ROW.","body":{"engine":"mysql","slug":"binlog-format","name":"binlog_format","topic":"durability","summary":"Whether the binary log stores statements, row changes, or a mix.","detail":"ROW writes the rows each statement changed, STATEMENT writes the SQL text, and MIXED switches to row logging when a statement is not safe to log as text. Row-based is the default, and 8.4 deprecates the variable itself: the manual says only row-based logging should be used for new replication setups.","default":"ROW","default_note":"ROW since MySQL 5.7.7 and still the value in MySQL 8.4, where the variable is deprecated and non-ROW values are subject to removal.","range":"ROW, STATEMENT, MIXED","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'binlog_format';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'binlog_format';","change":"SET SESSION binlog_format = 'ROW';   -- this connection\nSET GLOBAL binlog_format = 'ROW';    -- new connections, until restart\nSET PERSIST binlog_format = 'ROW';   -- new connections, and after restarts","when":"Almost never in 8.4. Servers upgraded from old versions that still run STATEMENT should move to ROW, one replica at a time, because the alternatives are deprecated.","risk":"Statement-based logging replays statements, so their effects can differ on the replica: an UPDATE tied to LIMIT without ORDER BY is the classic unsafe case. READ COMMITTED isolation refuses statement-based logging, and row filters and GTID-oriented tooling assume ROW.","related":["log-bin","binlog-row-image","transaction-isolation"],"faqs":[{"question":"What is the default value of binlog_format in MySQL?","answer":"ROW. ROW since MySQL 5.7.7 and still the value in MySQL 8.4, where the variable is deprecated and non-ROW values are subject to removal."},{"question":"Does changing binlog_format require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change binlog_format?","answer":"Almost never in 8.4. Servers upgraded from old versions that still run STATEMENT should move to ROW, one replica at a time, because the alternatives are deprecated."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/binlog-format","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/binlog-row-image","corpus":"sql-configuration","engine":"mysql","language":"en","title":"binlog_row_image (MySQL)","description":"MySQL binlog_row_image: How many columns a row-based binary log event records. Default: FULL.","body":{"engine":"mysql","slug":"binlog-row-image","name":"binlog_row_image","topic":"durability","summary":"How many columns a row-based binary log event records.","detail":"Each row change carries a before image for finding the row and an after image with the new values. FULL records every column in both; MINIMAL records only the identifying columns plus those that changed; NOBLOB records everything except BLOB or TEXT columns the statement did not touch.","default":"FULL","default_note":"FULL (MySQL 8.4).","range":"FULL, MINIMAL, NOBLOB","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'binlog_row_image';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'binlog_row_image';","change":"SET SESSION binlog_row_image = 'MINIMAL';   -- this connection\nSET GLOBAL binlog_row_image = 'MINIMAL';    -- new connections, until restart\nSET PERSIST binlog_row_image = 'MINIMAL';   -- new connections, and after restarts","when":"On high-write replicas where binlog size and network transfer matter, with wide tables holding large BLOB or TEXT columns that rarely change.","risk":"Smaller images shrink the log and the network cost, but the replica must then match rows with fewer columns, so every replicated table needs a primary key or unique index to be updated reliably. Use the same value on every server in the topology, as the manual recommends.","related":["binlog-format","log-bin","replica-parallel-workers"],"faqs":[{"question":"What is the default value of binlog_row_image in MySQL?","answer":"FULL. FULL (MySQL 8.4)."},{"question":"Does changing binlog_row_image require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change binlog_row_image?","answer":"On high-write replicas where binlog size and network transfer matter, with wide tables holding large BLOB or TEXT columns that rarely change."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/binlog-row-image","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/character-set-server","corpus":"sql-configuration","engine":"mysql","language":"en","title":"character_set_server (MySQL)","description":"MySQL character_set_server: Character set applied to new objects that do not name one. Default: utf8mb4.","body":{"engine":"mysql","slug":"character-set-server","name":"character_set_server","topic":"behavior","summary":"Character set applied to new objects that do not name one.","detail":"It is the server default for CREATE TABLE and CREATE DATABASE statements that omit a CHARACTER SET clause. Setting it changes nothing already stored: every column keeps the set it was created with. The client side sets (character_set_client, character_set_connection) are separate variables and unaffected.","default":"utf8mb4","default_note":"utf8mb4 since MySQL 8.0 (latin1 in 5.7), same in MySQL 8.4.","range":"Any character set name installed on the server","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'character_set_server';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'character_set_server';","change":"SET SESSION character_set_server = 'utf8mb4';   -- this connection\nSET GLOBAL character_set_server = 'utf8mb4';    -- new connections, until restart\nSET PERSIST character_set_server = 'utf8mb4';   -- new connections, and after restarts","when":"Rarely on 8.0 or 8.4, where utf8mb4 is already what you want; keep latin1 as the default only so a legacy schema keeps creating latin1 columns without explicit clauses.","risk":"If you change it, set collation_server too, or new objects get the character set's own default collation instead of the one you intended. Old columns keep their original set, so a schema can end up mixed utf8mb4 and latin1, and comparisons across the two go through conversion rules.","related":["collation-server","sql-mode"],"faqs":[{"question":"What is the default value of character_set_server in MySQL?","answer":"utf8mb4. utf8mb4 since MySQL 8.0 (latin1 in 5.7), same in MySQL 8.4."},{"question":"Does changing character_set_server require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change character_set_server?","answer":"Rarely on 8.0 or 8.4, where utf8mb4 is already what you want; keep latin1 as the default only so a legacy schema keeps creating latin1 columns without explicit clauses."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/character-set-server","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/collation-server","corpus":"sql-configuration","engine":"mysql","language":"en","title":"collation_server (MySQL)","description":"MySQL collation_server: Collation applied to new objects that do not name one. Default: utf8mb4_0900_ai_ci.","body":{"engine":"mysql","slug":"collation-server","name":"collation_server","topic":"behavior","summary":"Collation applied to new objects that do not name one.","detail":"It pairs with character_set_server and only reaches objects created after the change, so existing columns compare and sort exactly as before. The default utf8mb4_0900_ai_ci is accent insensitive and case insensitive; picking _as_cs or _bin makes new columns compare strictly.","default":"utf8mb4_0900_ai_ci","default_note":"utf8mb4_0900_ai_ci (MySQL 8.4); assigning a user-defined collation raises a warning instead of an error.","range":"Any collation whose character set matches character_set_server","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'collation_server';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'collation_server';","change":"SET SESSION collation_server = 'utf8mb4_0900_as_cs';   -- this connection\nSET GLOBAL collation_server = 'utf8mb4_0900_as_cs';    -- new connections, until restart\nSET PERSIST collation_server = 'utf8mb4_0900_as_cs';   -- new connections, and after restarts","when":"When new schemas should default to case or accent sensitive comparisons without spelling the collation in every CREATE statement.","risk":"Changing the variable leaves stored columns untouched, and one schema can easily hold columns with three different collations, so check SHOW CREATE TABLE or information_schema.COLUMNS for what a query actually compares with rather than the server variable.","related":["character-set-server","sql-mode"],"faqs":[{"question":"What is the default value of collation_server in MySQL?","answer":"utf8mb4_0900_ai_ci. utf8mb4_0900_ai_ci (MySQL 8.4); assigning a user-defined collation raises a warning instead of an error."},{"question":"Does changing collation_server require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change collation_server?","answer":"When new schemas should default to case or accent sensitive comparisons without spelling the collation in every CREATE statement."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/collation-server","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/connect-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"connect_timeout (MySQL)","description":"MySQL connect_timeout: Seconds the server waits for a client to answer the handshake. Default: 10.","body":{"engine":"mysql","slug":"connect-timeout","name":"connect_timeout","topic":"timeouts","summary":"Seconds the server waits for a client to answer the handshake.","detail":"mysqld waits this long for the client's connect packet after the TCP connection is accepted, then gives up with Bad handshake. Raising it helps clients that keep failing with 'Lost connection to MySQL server at waiting for initial communication packet', typically over slow or congested links.","default":"10","default_note":"10 seconds (MySQL 8.4).","range":"2 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'connect_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'connect_timeout';","change":"SET GLOBAL connect_timeout = 30;    -- until the next restart\nSET PERSIST connect_timeout = 30;   -- now and after restarts","when":"When legitimate clients fail to get through the handshake on slow links, or while investigating a rise in Aborted_connects in SHOW GLOBAL STATUS.","risk":"Half-open handshakes each hold a thread until the timeout fires, so a large value lets a broken network or an aggressive connection flood tie up threads for minutes. The default ten seconds already covers most real links; fix the network before raising it much.","related":["max-connect-errors","back-log","net-read-timeout"],"faqs":[{"question":"What is the default value of connect_timeout in MySQL?","answer":"10. 10 seconds (MySQL 8.4)."},{"question":"Does changing connect_timeout require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change connect_timeout?","answer":"When legitimate clients fail to get through the handshake on slow links, or while investigating a rise in Aborted_connects in SHOW GLOBAL STATUS."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/connect-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/enforce-gtid-consistency","corpus":"sql-configuration","engine":"mysql","language":"en","title":"enforce_gtid_consistency (MySQL)","description":"MySQL enforce_gtid_consistency: Refuse transactions that cannot be logged safely with a GTID. Default: OFF.","body":{"engine":"mysql","slug":"enforce-gtid-consistency","name":"enforce_gtid_consistency","topic":"durability","summary":"Refuse transactions that cannot be logged safely with a GTID.","detail":"It must be ON before gtid_mode can reach ON. With it on, a transaction may not update both transactional and nontransactional tables, and CREATE TEMPORARY TABLE or DROP TEMPORARY TABLE inside a transaction is refused. WARN allows everything but logs a warning, so you can measure what would break before enforcing it.","default":"OFF","default_note":"OFF (MySQL 8.4).","range":"OFF, WARN, ON","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'enforce_gtid_consistency';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'enforce_gtid_consistency';","change":"SET GLOBAL enforce_gtid_consistency = WARN;    -- until the next restart\nSET PERSIST enforce_gtid_consistency = WARN;   -- now and after restarts","when":"Run WARN on every server for a while before a GTID migration to find application transactions that would be refused, then ON across the whole topology before stepping gtid_mode up.","risk":"Only logged statements are checked: a statement removed by a replication filter skips the check entirely. The refused transactions fail at runtime, so an application that mixes InnoDB with MyISAM writes or uses temporary tables inside transactions needs fixing before ON.","related":["gtid-mode","log-bin"],"faqs":[{"question":"What is the default value of enforce_gtid_consistency in MySQL?","answer":"OFF. OFF (MySQL 8.4)."},{"question":"Does changing enforce_gtid_consistency require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change enforce_gtid_consistency?","answer":"Run WARN on every server for a while before a GTID migration to find application transactions that would be refused, then ON across the whole topology before stepping gtid_mode up."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/enforce-gtid-consistency","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/group-concat-max-len","corpus":"sql-configuration","engine":"mysql","language":"en","title":"group_concat_max_len (MySQL)","description":"MySQL group_concat_max_len: Longest result the GROUP_CONCAT function may return. Default: 1024.","body":{"engine":"mysql","slug":"group-concat-max-len","name":"group_concat_max_len","topic":"behavior","summary":"Longest result the GROUP_CONCAT function may return.","detail":"Anything longer is cut to the limit and the query returns the truncated string with a warning, not an error. The limit is counted in bytes, and the result is additionally capped by max_allowed_packet, so a very large value here cannot actually ship more than one packet.","default":"1024","default_note":"1024 bytes (MySQL 8.4), counted in bytes rather than characters.","range":"4 to 18446744073709551615 bytes (4294967295 on 32-bit platforms)","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'group_concat_max_len';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'group_concat_max_len';","change":"SET SESSION group_concat_max_len = 1048576;   -- this connection\nSET GLOBAL group_concat_max_len = 1048576;    -- new connections, until restart\nSET PERSIST group_concat_max_len = 1048576;   -- new connections, and after restarts","when":"When GROUP_CONCAT output is visibly cut off, typically in report or export queries; set it in the session that runs them instead of globally.","risk":"Truncation is silent apart from a warning, so reports can ship incomplete lists without anyone noticing. Large values let one query return megabytes, which flows through max_allowed_packet to client memory, so size it to what the caller really consumes.","related":["max-allowed-packet","sql-mode"],"faqs":[{"question":"What is the default value of group_concat_max_len in MySQL?","answer":"1024. 1024 bytes (MySQL 8.4), counted in bytes rather than characters."},{"question":"Does changing group_concat_max_len require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change group_concat_max_len?","answer":"When GROUP_CONCAT output is visibly cut off, typically in report or export queries; set it in the session that runs them instead of globally."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/group-concat-max-len","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/gtid-mode","corpus":"sql-configuration","engine":"mysql","language":"en","title":"gtid_mode (MySQL)","description":"MySQL gtid_mode: Whether transactions in the binary log carry GTIDs. Default: OFF.","body":{"engine":"mysql","slug":"gtid-mode","name":"gtid_mode","topic":"durability","summary":"Whether transactions in the binary log carry GTIDs.","detail":"OFF keeps every transaction anonymous, identified by binary log file and position; ON gives every transaction a globally unique GTID. OFF_PERMISSIVE and ON_PERMISSIVE are the two transition steps: the first accepts replicated GTID transactions while writing new ones anonymous, the second writes GTIDs while still accepting anonymous ones.","default":"OFF","default_note":"OFF (MySQL 8.4). GTID mode can be changed online since MySQL 5.7.6, one step at a time in either direction.","range":"OFF, OFF_PERMISSIVE, ON_PERMISSIVE, ON","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'gtid_mode';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'gtid_mode';","change":"SET GLOBAL gtid_mode = ON_PERMISSIVE;    -- until the next restart\nSET PERSIST gtid_mode = ON_PERMISSIVE;   -- now and after restarts","when":"When moving a topology to GTID replication for simpler failover and replica provisioning: set enforce_gtid_consistency=ON first, then step OFF, OFF_PERMISSIVE, ON_PERMISSIVE, ON, letting anonymous traffic drain between steps.","risk":"The value moves only one step at a time; SET GLOBAL gtid_mode = ON straight from OFF fails outright. With ON, anonymous replicated transactions are refused, so every server must have drained its anonymous transactions before the last step, and a server still writing anonymous transactions breaks failover tooling that assumes GTID sets.","related":["enforce-gtid-consistency","log-bin","replica-parallel-workers"],"faqs":[{"question":"What is the default value of gtid_mode in MySQL?","answer":"OFF. OFF (MySQL 8.4). GTID mode can be changed online since MySQL 5.7.6, one step at a time in either direction."},{"question":"Does changing gtid_mode require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change gtid_mode?","answer":"When moving a topology to GTID replication for simpler failover and replica provisioning: set enforce_gtid_consistency=ON first, then step OFF, OFF_PERMISSIVE, ON_PERMISSIVE, ON, letting anonymous traffic drain between steps."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/gtid-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-adaptive-hash-index","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_adaptive_hash_index (MySQL)","description":"MySQL innodb_adaptive_hash_index: Build in-memory hash indexes on hot B-tree pages automatically. Default: OFF.","body":{"engine":"mysql","slug":"innodb-adaptive-hash-index","name":"innodb_adaptive_hash_index","topic":"optimizer","summary":"Build in-memory hash indexes on hot B-tree pages automatically.","detail":"Speeds up repeated equality lookups on cached data, but its latches became a contention point under mixed read/write load, which is why 8.4 turned it off.","default":"OFF","default_note":"OFF since MySQL 8.4 (ON in 8.0).","range":"ON, OFF","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_adaptive_hash_index';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_adaptive_hash_index';","change":"SET GLOBAL innodb_adaptive_hash_index = ON;    -- until the next restart\nSET PERSIST innodb_adaptive_hash_index = ON;   -- now and after restarts","when":"Benchmark turning it on for read-mostly workloads with many repeated point lookups.","risk":"Latch contention on the hash index under concurrent writes, which can make throughput worse than with it off.","related":["innodb-buffer-pool-size"],"faqs":[{"question":"What is the default value of innodb_adaptive_hash_index in MySQL?","answer":"OFF. OFF since MySQL 8.4 (ON in 8.0)."},{"question":"Does changing innodb_adaptive_hash_index require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_adaptive_hash_index?","answer":"Benchmark turning it on for read-mostly workloads with many repeated point lookups."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-adaptive-hash-index","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-autoinc-lock-mode","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_autoinc_lock_mode (MySQL)","description":"MySQL innodb_autoinc_lock_mode: Locking used to generate AUTO_INCREMENT values. Default: 2.","body":{"engine":"mysql","slug":"innodb-autoinc-lock-mode","name":"innodb_autoinc_lock_mode","topic":"behavior","summary":"Locking used to generate AUTO_INCREMENT values.","detail":"2 (interleaved) needs no table-level lock and is fastest, but values from concurrent multi-row inserts can interleave, so INSERT ... SELECT does not get consecutive values. It is safe with row-based binary logging.","default":"2","default_note":"2 since MySQL 8.0 (1 in 5.7). Same in 8.4.","range":"0, 1, 2","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_autoinc_lock_mode';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_autoinc_lock_mode';","change":"SET PERSIST_ONLY innodb_autoinc_lock_mode = 1;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Set 1 only if you still replicate with statement-based binary logging.","risk":"With statement-based replication, mode 2 can produce different values on replicas.","related":["log-bin"],"faqs":[{"question":"What is the default value of innodb_autoinc_lock_mode in MySQL?","answer":"2. 2 since MySQL 8.0 (1 in 5.7). Same in 8.4."},{"question":"Does changing innodb_autoinc_lock_mode require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_autoinc_lock_mode?","answer":"Set 1 only if you still replicate with statement-based binary logging."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-autoinc-lock-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-buffer-pool-instances","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_buffer_pool_instances (MySQL)","description":"MySQL innodb_buffer_pool_instances: Number of separate regions the buffer pool is split into. Default: 1 (computed).","body":{"engine":"mysql","slug":"innodb-buffer-pool-instances","name":"innodb_buffer_pool_instances","topic":"memory","summary":"Number of separate regions the buffer pool is split into.","detail":"Each instance has its own mutex and LRU list, which reduces contention when many threads read pages concurrently.","default":"1 (computed)","default_note":"Computed at startup. Before MySQL 8.4 it was 8, or 1 when the pool is under 1GB; 8.4 derives it from the pool size and the number of logical processors. The 128MB default pool gives 1.","range":"1 to 64","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_buffer_pool_instances';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_buffer_pool_instances';","change":"SET PERSIST_ONLY innodb_buffer_pool_instances = 8;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Rarely needed in 8.4, where the computed value tracks the hardware. Set it explicitly only if you see buffer pool mutex contention.","risk":"Each instance should be at least 1GB; many small instances waste memory on per-instance overhead.","related":["innodb-buffer-pool-size","innodb-page-cleaners"],"faqs":[{"question":"What is the default value of innodb_buffer_pool_instances in MySQL?","answer":"1 (computed). Computed at startup. Before MySQL 8.4 it was 8, or 1 when the pool is under 1GB; 8.4 derives it from the pool size and the number of logical processors. The 128MB default pool gives 1."},{"question":"Does changing innodb_buffer_pool_instances require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_buffer_pool_instances?","answer":"Rarely needed in 8.4, where the computed value tracks the hardware. Set it explicitly only if you see buffer pool mutex contention."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-buffer-pool-instances","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-buffer-pool-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_buffer_pool_size (MySQL)","description":"MySQL innodb_buffer_pool_size: Size of InnoDB's cache for table and index pages. Default: 128MB.","body":{"engine":"mysql","slug":"innodb-buffer-pool-size","name":"innodb_buffer_pool_size","topic":"memory","summary":"Size of InnoDB's cache for table and index pages.","detail":"The most important MySQL setting. InnoDB does its own caching (with O_DIRECT it bypasses the OS cache), so on a dedicated server the buffer pool is usually most of RAM. It can be resized online; the size is rounded to a multiple of innodb_buffer_pool_chunk_size x innodb_buffer_pool_instances.","default":"128MB","default_note":"134217728 bytes, 128MB (MySQL 8.4). With innodb_dedicated_server=ON it is sized from RAM instead.","range":"5MB up to the 64-bit address limit","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_buffer_pool_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_buffer_pool_size';","change":"SET GLOBAL innodb_buffer_pool_size = 8589934592;    -- until the next restart\nSET PERSIST innodb_buffer_pool_size = 8589934592;   -- now and after restarts","when":"Always, on a dedicated server: start around 70-80% of RAM and check Innodb_buffer_pool_reads (disk reads) against Innodb_buffer_pool_read_requests.","risk":"Too large and the OS swaps or the OOM killer stops mysqld; leave room for per-connection buffers and the OS. An online resize briefly blocks while chunks are added or removed.","related":["innodb-buffer-pool-instances","innodb-dedicated-server","innodb-redo-log-capacity"],"faqs":[{"question":"What is the default value of innodb_buffer_pool_size in MySQL?","answer":"128MB. 134217728 bytes, 128MB (MySQL 8.4). With innodb_dedicated_server=ON it is sized from RAM instead."},{"question":"Does changing innodb_buffer_pool_size require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_buffer_pool_size?","answer":"Always, on a dedicated server: start around 70-80% of RAM and check Innodb_buffer_pool_reads (disk reads) against Innodb_buffer_pool_read_requests."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-buffer-pool-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-change-buffering","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_change_buffering (MySQL)","description":"MySQL innodb_change_buffering: Whether InnoDB buffers changes to secondary index pages that are not in memory. Default: none.","body":{"engine":"mysql","slug":"innodb-change-buffering","name":"innodb_change_buffering","topic":"io","summary":"Whether InnoDB buffers changes to secondary index pages that are not in memory.","detail":"Change buffering defers random secondary-index writes, which mattered on rotating disks. On SSDs the saving is small and the merge work still has to happen later, so 8.4 disabled it.","default":"none","default_note":"none since MySQL 8.4 (all in 8.0).","range":"none, inserts, deletes, changes, purges, all","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_change_buffering';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_change_buffering';","change":"SET GLOBAL innodb_change_buffering = all;    -- until the next restart\nSET PERSIST innodb_change_buffering = all;   -- now and after restarts","when":"Only for write-heavy workloads on spinning disks with large secondary indexes that do not fit in memory.","risk":"The buffered changes are merged later, adding background I/O and making a slow shutdown (innodb_fast_shutdown=0) take longer.","related":["innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_change_buffering in MySQL?","answer":"none. none since MySQL 8.4 (all in 8.0)."},{"question":"Does changing innodb_change_buffering require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_change_buffering?","answer":"Only for write-heavy workloads on spinning disks with large secondary indexes that do not fit in memory."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-change-buffering","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-deadlock-detect","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_deadlock_detect (MySQL)","description":"MySQL innodb_deadlock_detect: Detect deadlocks immediately and roll back one of the transactions. Default: ON.","body":{"engine":"mysql","slug":"innodb-deadlock-detect","name":"innodb_deadlock_detect","topic":"behavior","summary":"Detect deadlocks immediately and roll back one of the transactions.","detail":"With detection off, deadlocked transactions wait until innodb_lock_wait_timeout. Detection itself can become a bottleneck when hundreds of threads wait on the same rows.","default":"ON","default_note":"ON (MySQL 8.4).","range":"ON, OFF","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_deadlock_detect';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_deadlock_detect';","change":"SET GLOBAL innodb_deadlock_detect = OFF;    -- until the next restart\nSET PERSIST innodb_deadlock_detect = OFF;   -- now and after restarts","when":"Only on very high-concurrency systems where profiling shows deadlock detection as the bottleneck, together with a low innodb_lock_wait_timeout.","risk":"With detection off, a deadlock stays invisible until innodb_lock_wait_timeout expires, so every real deadlock costs the full wait before one transaction is rolled back with error 1205. That trade only makes sense where contention concentrates on a few rows and detection itself measured as the bottleneck.","related":["innodb-lock-wait-timeout","innodb-print-all-deadlocks"],"faqs":[{"question":"What is the default value of innodb_deadlock_detect in MySQL?","answer":"ON. ON (MySQL 8.4)."},{"question":"Does changing innodb_deadlock_detect require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_deadlock_detect?","answer":"Only on very high-concurrency systems where profiling shows deadlock detection as the bottleneck, together with a low innodb_lock_wait_timeout."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-deadlock-detect","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-dedicated-server","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_dedicated_server (MySQL)","description":"MySQL innodb_dedicated_server: Let InnoDB size the buffer pool and redo log from the server's memory and CPU count. Default: OFF.","body":{"engine":"mysql","slug":"innodb-dedicated-server","name":"innodb_dedicated_server","topic":"memory","summary":"Let InnoDB size the buffer pool and redo log from the server's memory and CPU count.","detail":"When ON, InnoDB sets innodb_buffer_pool_size (128MB under 1GB of RAM, 50% at 1-4GB, 75% above 4GB) and innodb_redo_log_capacity (logical processors / 2, in GB, up to 16GB) automatically, unless they are set explicitly.","default":"OFF","default_note":"OFF (MySQL 8.4).","range":"ON, OFF","restart_required":true,"apply":"Restart required, and the variable cannot be persisted: SET GLOBAL and SET PERSIST_ONLY both fail with error 1238. Set it under [mysqld] in my.cnf or on the mysqld command line.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_dedicated_server';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_dedicated_server';","change":"-- SET PERSIST_ONLY innodb_dedicated_server fails: error 1238, non persistent read only variable.\n-- Add this line under [mysqld] in my.cnf, then restart mysqld:\n--   innodb_dedicated_server = ON","when":"On a host or container that runs nothing but MySQL, as a sane starting point.","risk":"It reads the memory it can see; in a container without a memory limit that may be the whole host's RAM.","related":["innodb-buffer-pool-size","innodb-redo-log-capacity"],"faqs":[{"question":"What is the default value of innodb_dedicated_server in MySQL?","answer":"OFF. OFF (MySQL 8.4)."},{"question":"Does changing innodb_dedicated_server require a restart?","answer":"Yes. Restart required, and the variable cannot be persisted: SET GLOBAL and SET PERSIST_ONLY both fail with error 1238. Set it under [mysqld] in my.cnf or on the mysqld command line."},{"question":"When should I change innodb_dedicated_server?","answer":"On a host or container that runs nothing but MySQL, as a sane starting point."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-dedicated-server","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-flush-log-at-trx-commit","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_flush_log_at_trx_commit (MySQL)","description":"MySQL innodb_flush_log_at_trx_commit: When InnoDB writes and flushes the redo log for a commit. Default: 1.","body":{"engine":"mysql","slug":"innodb-flush-log-at-trx-commit","name":"innodb_flush_log_at_trx_commit","topic":"durability","summary":"When InnoDB writes and flushes the redo log for a commit.","detail":"1 writes and flushes at every commit (full durability). 2 writes at commit and flushes about once a second: a mysqld crash loses nothing, an OS crash or power loss can lose about a second. 0 writes and flushes about once a second: even a mysqld crash can lose about a second.","default":"1","default_note":"1 (MySQL 8.4), the durability-safe value in every stock build; 0 and 2 are deliberate relaxations, never the default.","range":"0, 1, 2","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_flush_log_at_trx_commit';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_flush_log_at_trx_commit';","change":"SET GLOBAL innodb_flush_log_at_trx_commit = 2;    -- until the next restart\nSET PERSIST innodb_flush_log_at_trx_commit = 2;   -- now and after restarts","when":"Use 2 on replicas you can rebuild or for bulk loads where a second of loss is acceptable; keep 1 on primaries holding data you cannot lose.","risk":"0 or 2 can lose acknowledged transactions and leave the binary log ahead of InnoDB after a crash.","related":["sync-binlog","innodb-redo-log-capacity","innodb-flush-method"],"faqs":[{"question":"What is the default value of innodb_flush_log_at_trx_commit in MySQL?","answer":"1. 1 (MySQL 8.4), the durability-safe value in every stock build; 0 and 2 are deliberate relaxations, never the default."},{"question":"Does changing innodb_flush_log_at_trx_commit require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_flush_log_at_trx_commit?","answer":"Use 2 on replicas you can rebuild or for bulk loads where a second of loss is acceptable; keep 1 on primaries holding data you cannot lose."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-flush-log-at-trx-commit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-flush-method","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_flush_method (MySQL)","description":"MySQL innodb_flush_method: How InnoDB opens and flushes data and log files. Default: O_DIRECT on Linux.","body":{"engine":"mysql","slug":"innodb-flush-method","name":"innodb_flush_method","topic":"io","summary":"How InnoDB opens and flushes data and log files.","detail":"O_DIRECT bypasses the OS page cache for data files, so pages are not cached twice; fsync uses buffered I/O. On Windows the choices are unbuffered and normal.","default":"O_DIRECT on Linux","default_note":"O_DIRECT where supported since MySQL 8.4 (fsync in 8.0). Windows uses unbuffered.","range":"fsync, O_DSYNC, littlesync, nosync, O_DIRECT, O_DIRECT_NO_FSYNC (Unix)","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_flush_method';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_flush_method';","change":"SET PERSIST_ONLY innodb_flush_method = O_DIRECT;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Rarely in 8.4. Check it on servers upgraded from 8.0 with an old my.cnf that still says fsync.","risk":"nosync and littlesync are for testing only. On a file system without O_DIRECT support, such as tmpfs, InnoDB logs a warning and carries on with buffered I/O.","related":["innodb-flush-log-at-trx-commit","innodb-buffer-pool-size"],"faqs":[{"question":"What is the default value of innodb_flush_method in MySQL?","answer":"O_DIRECT on Linux. O_DIRECT where supported since MySQL 8.4 (fsync in 8.0). Windows uses unbuffered."},{"question":"Does changing innodb_flush_method require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_flush_method?","answer":"Rarely in 8.4. Check it on servers upgraded from 8.0 with an old my.cnf that still says fsync."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-flush-method","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-flush-neighbors","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_flush_neighbors (MySQL)","description":"MySQL innodb_flush_neighbors: Whether flushing a page also flushes adjacent dirty pages in the same extent. Default: 0.","body":{"engine":"mysql","slug":"innodb-flush-neighbors","name":"innodb_flush_neighbors","topic":"io","summary":"Whether flushing a page also flushes adjacent dirty pages in the same extent.","detail":"Helps on spinning disks by turning random writes into sequential ones; adds pointless writes on SSDs.","default":"0","default_note":"0 since MySQL 8.0 (1 in 5.7). Same in 8.4.","range":"0, 1, 2","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_flush_neighbors';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_flush_neighbors';","change":"SET GLOBAL innodb_flush_neighbors = 1;    -- until the next restart\nSET PERSIST innodb_flush_neighbors = 1;   -- now and after restarts","when":"Only turn it on for data on rotating disks.","risk":"On SSDs the extra adjacent writes buy nothing and add write amplification; keep 0. The default has been 0 since MySQL 8.0, so this only needs revisiting on servers upgraded with an old my.cnf that still sets 1 or 2 for spinning disks.","related":["innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_flush_neighbors in MySQL?","answer":"0. 0 since MySQL 8.0 (1 in 5.7). Same in 8.4."},{"question":"Does changing innodb_flush_neighbors require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_flush_neighbors?","answer":"Only turn it on for data on rotating disks."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-flush-neighbors","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-io-capacity","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_io_capacity (MySQL)","description":"MySQL innodb_io_capacity: Background I/O operations per second InnoDB aims for when flushing pages and merging. Default: 10000.","body":{"engine":"mysql","slug":"innodb-io-capacity","name":"innodb_io_capacity","topic":"io","summary":"Background I/O operations per second InnoDB aims for when flushing pages and merging.","detail":"Paces the page cleaner and other background work. It should reflect what the storage can sustain, not its peak.","default":"10000","default_note":"10000 since MySQL 8.4 (200 in 8.0, a value chosen for spinning disks).","range":"100 to 4294967295","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_io_capacity';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_io_capacity';","change":"SET GLOBAL innodb_io_capacity = 2000;    -- until the next restart\nSET PERSIST innodb_io_capacity = 2000;   -- now and after restarts","when":"Lower it on slow or shared storage where background flushing starves queries; on fast NVMe the 8.4 default is reasonable.","risk":"Too high causes needless write amplification; too low lets dirty pages accumulate until InnoDB has to flush aggressively.","related":["innodb-io-capacity-max","innodb-flush-neighbors","innodb-redo-log-capacity"],"faqs":[{"question":"What is the default value of innodb_io_capacity in MySQL?","answer":"10000. 10000 since MySQL 8.4 (200 in 8.0, a value chosen for spinning disks)."},{"question":"Does changing innodb_io_capacity require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_io_capacity?","answer":"Lower it on slow or shared storage where background flushing starves queries; on fast NVMe the 8.4 default is reasonable."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-io-capacity","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-io-capacity-max","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_io_capacity_max (MySQL)","description":"MySQL innodb_io_capacity_max: Upper limit on background I/O when InnoDB falls behind on flushing. Default: 2 x innodb_io_capacity (20000).","body":{"engine":"mysql","slug":"innodb-io-capacity-max","name":"innodb_io_capacity_max","topic":"io","summary":"Upper limit on background I/O when InnoDB falls behind on flushing.","detail":"When dirty pages or redo age build up, InnoDB may exceed innodb_io_capacity up to this value.","default":"2 x innodb_io_capacity (20000)","default_note":"Twice innodb_io_capacity, which is 20000 in MySQL 8.4. In 8.0 it was twice innodb_io_capacity with a floor of 2000, so 2000 with the old default of 200.","range":"100 to 4294967295","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_io_capacity_max';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_io_capacity_max';","change":"SET GLOBAL innodb_io_capacity_max = 40000;    -- until the next restart\nSET PERSIST innodb_io_capacity_max = 40000;   -- now and after restarts","when":"Set it when you set innodb_io_capacity explicitly and want a different ratio.","risk":"A value below innodb_io_capacity is not accepted as given: SET GLOBAL raises it to innodb_io_capacity with a warning. With the 8.4 default of 10000, an old setting such as 2000 or 4000 silently becomes 10000.","related":["innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_io_capacity_max in MySQL?","answer":"2 x innodb_io_capacity (20000). Twice innodb_io_capacity, which is 20000 in MySQL 8.4. In 8.0 it was twice innodb_io_capacity with a floor of 2000, so 2000 with the old default of 200."},{"question":"Does changing innodb_io_capacity_max require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_io_capacity_max?","answer":"Set it when you set innodb_io_capacity explicitly and want a different ratio."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-io-capacity-max","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-lock-wait-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_lock_wait_timeout (MySQL)","description":"MySQL innodb_lock_wait_timeout: Seconds an InnoDB transaction waits for a row lock before giving up. Default: 50.","body":{"engine":"mysql","slug":"innodb-lock-wait-timeout","name":"innodb_lock_wait_timeout","topic":"timeouts","summary":"Seconds an InnoDB transaction waits for a row lock before giving up.","detail":"On timeout only the statement is rolled back (error 1205), not the transaction, unless innodb_rollback_on_timeout is ON. Deadlocks are detected separately and immediately.","default":"50","default_note":"50 seconds (MySQL 8.4).","range":"1 to 1073741824 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_lock_wait_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_lock_wait_timeout';","change":"SET SESSION innodb_lock_wait_timeout = 5;   -- this connection\nSET GLOBAL innodb_lock_wait_timeout = 5;    -- new connections, until restart\nSET PERSIST innodb_lock_wait_timeout = 5;   -- new connections, and after restarts","when":"Lower it for interactive OLTP so users get an error quickly instead of hanging; raise it per session for batch jobs that expect to wait.","risk":"The application must handle error 1205; the transaction is still open after the failed statement.","related":["lock-wait-timeout","innodb-deadlock-detect"],"faqs":[{"question":"What is the default value of innodb_lock_wait_timeout in MySQL?","answer":"50. 50 seconds (MySQL 8.4)."},{"question":"Does changing innodb_lock_wait_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change innodb_lock_wait_timeout?","answer":"Lower it for interactive OLTP so users get an error quickly instead of hanging; raise it per session for batch jobs that expect to wait."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-lock-wait-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-log-buffer-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_log_buffer_size (MySQL)","description":"MySQL innodb_log_buffer_size: Memory buffer for redo log records before they are written to disk. Default: 64MB.","body":{"engine":"mysql","slug":"innodb-log-buffer-size","name":"innodb_log_buffer_size","topic":"durability","summary":"Memory buffer for redo log records before they are written to disk.","detail":"Large transactions that exceed it must write redo before commit. Innodb_log_waits counts waits for buffer space.","default":"64MB","default_note":"64MB since MySQL 8.4 (16MB in 8.0).","range":"256KB to 4GB","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_log_buffer_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_log_buffer_size';","change":"SET GLOBAL innodb_log_buffer_size = 134217728;    -- until the next restart\nSET PERSIST innodb_log_buffer_size = 134217728;   -- now and after restarts","when":"If Innodb_log_waits is above zero, typically with large BLOB or bulk transactions.","risk":"It is one buffer shared by all connections, not per connection, so a few hundred megabytes is cheap insurance. The failure mode is a single transaction whose redo does not fit: it must write to disk mid-flight, which Innodb_log_waits counts.","related":["innodb-redo-log-capacity"],"faqs":[{"question":"What is the default value of innodb_log_buffer_size in MySQL?","answer":"64MB. 64MB since MySQL 8.4 (16MB in 8.0)."},{"question":"Does changing innodb_log_buffer_size require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_log_buffer_size?","answer":"If Innodb_log_waits is above zero, typically with large BLOB or bulk transactions."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-log-buffer-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-page-cleaners","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_page_cleaners (MySQL)","description":"MySQL innodb_page_cleaners: Threads that flush dirty pages from the buffer pool. Default: = innodb_buffer_pool_instances.","body":{"engine":"mysql","slug":"innodb-page-cleaners","name":"innodb_page_cleaners","topic":"io","summary":"Threads that flush dirty pages from the buffer pool.","detail":"Each buffer pool instance is served by one cleaner when the counts match; the value is capped at innodb_buffer_pool_instances.","default":"= innodb_buffer_pool_instances","default_note":"Equal to innodb_buffer_pool_instances since MySQL 8.4 (4 in 8.0). 1 with the default 128MB pool.","range":"1 to 64","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_page_cleaners';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_page_cleaners';","change":"SET PERSIST_ONLY innodb_page_cleaners = 8;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"If the error log reports 'page_cleaner: 1000ms intended loop took ...' under steady write load.","risk":"The value is silently capped at innodb_buffer_pool_instances, so a cleaner count above the instance count simply idles the extras; keep the two equal. The loop-delay warning in the error log is the signal to revisit, not the thread count itself.","related":["innodb-buffer-pool-instances","innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_page_cleaners in MySQL?","answer":"= innodb_buffer_pool_instances. Equal to innodb_buffer_pool_instances since MySQL 8.4 (4 in 8.0). 1 with the default 128MB pool."},{"question":"Does changing innodb_page_cleaners require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_page_cleaners?","answer":"If the error log reports 'page_cleaner: 1000ms intended loop took ...' under steady write load."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-page-cleaners","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-parallel-read-threads","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_parallel_read_threads (MySQL)","description":"MySQL innodb_parallel_read_threads: Threads for parallel clustered index reads. Default: Logical CPUs / 8, minimum 4.","body":{"engine":"mysql","slug":"innodb-parallel-read-threads","name":"innodb_parallel_read_threads","topic":"parallelism","summary":"Threads for parallel clustered index reads.","detail":"Used by CHECK TABLE and SELECT COUNT(*) without a WHERE clause. MySQL has no general parallel query.","default":"Logical CPUs / 8, minimum 4","default_note":"One eighth of the logical processors, at least 4, since MySQL 8.4 (a fixed 4 before).","range":"1 to 256","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_parallel_read_threads';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_parallel_read_threads';","change":"SET SESSION innodb_parallel_read_threads = 8;   -- this connection\nSET GLOBAL innodb_parallel_read_threads = 8;    -- new connections, until restart\nSET PERSIST innodb_parallel_read_threads = 8;   -- new connections, and after restarts","when":"Raise per session before counting or checking very large tables.","risk":"A parallel clustered index read competes for CPU and buffer pool pages with everything else, so running COUNT(*) at the session maximum on a busy primary can stall OLTP queries. Cap it per session outside maintenance windows.","related":["innodb-read-io-threads"],"faqs":[{"question":"What is the default value of innodb_parallel_read_threads in MySQL?","answer":"Logical CPUs / 8, minimum 4. One eighth of the logical processors, at least 4, since MySQL 8.4 (a fixed 4 before)."},{"question":"Does changing innodb_parallel_read_threads require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change innodb_parallel_read_threads?","answer":"Raise per session before counting or checking very large tables."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-parallel-read-threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-print-all-deadlocks","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_print_all_deadlocks (MySQL)","description":"MySQL innodb_print_all_deadlocks: Write every InnoDB deadlock to the error log. Default: OFF.","body":{"engine":"mysql","slug":"innodb-print-all-deadlocks","name":"innodb_print_all_deadlocks","topic":"logging","summary":"Write every InnoDB deadlock to the error log.","detail":"SHOW ENGINE INNODB STATUS keeps only the latest deadlock. This records each one with both transactions and their locks.","default":"OFF","default_note":"OFF (MySQL 8.4).","range":"ON, OFF","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_print_all_deadlocks';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_print_all_deadlocks';","change":"SET GLOBAL innodb_print_all_deadlocks = ON;    -- until the next restart\nSET PERSIST innodb_print_all_deadlocks = ON;   -- now and after restarts","when":"When the application reports deadlocks (error 1213) and you need history to find the pattern.","risk":"On a system that deadlocks often the error log grows fast and drowns other diagnostics, so leave it on just long enough to find the pattern, then off. Occasional deadlocks are normal InnoDB behavior; the log is for finding which queries to fix.","related":["innodb-deadlock-detect"],"faqs":[{"question":"What is the default value of innodb_print_all_deadlocks in MySQL?","answer":"OFF. OFF (MySQL 8.4)."},{"question":"Does changing innodb_print_all_deadlocks require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_print_all_deadlocks?","answer":"When the application reports deadlocks (error 1213) and you need history to find the pattern."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-print-all-deadlocks","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-purge-threads","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_purge_threads (MySQL)","description":"MySQL innodb_purge_threads: Threads that remove delete-marked rows and old undo records. Default: 1 or 4.","body":{"engine":"mysql","slug":"innodb-purge-threads","name":"innodb_purge_threads","topic":"maintenance","summary":"Threads that remove delete-marked rows and old undo records.","detail":"Purge is InnoDB's equivalent of vacuum. If it falls behind, the history list length (SHOW ENGINE INNODB STATUS) grows and queries slow down.","default":"1 or 4","default_note":"1 when the server has 16 or fewer logical processors, otherwise 4, since MySQL 8.4 (a fixed 4 in 8.0).","range":"1 to 32","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_purge_threads';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_purge_threads';","change":"SET PERSIST_ONLY innodb_purge_threads = 4;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"When history list length keeps growing under heavy DML.","risk":"More purge threads take CPU and can contend with foreground queries for pages, but a history list that only grows is worse: it bloats undo and slows every read that must skip delete-marked rows. It needs a restart, so size it from steady-state DML volume.","related":["innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_purge_threads in MySQL?","answer":"1 or 4. 1 when the server has 16 or fewer logical processors, otherwise 4, since MySQL 8.4 (a fixed 4 in 8.0)."},{"question":"Does changing innodb_purge_threads require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_purge_threads?","answer":"When history list length keeps growing under heavy DML."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-purge-threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-read-io-threads","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_read_io_threads (MySQL)","description":"MySQL innodb_read_io_threads: Background threads for read-ahead and other InnoDB read I/O. Default: Logical CPUs / 2, minimum 4.","body":{"engine":"mysql","slug":"innodb-read-io-threads","name":"innodb_read_io_threads","topic":"io","summary":"Background threads for read-ahead and other InnoDB read I/O.","detail":"With native asynchronous I/O on Linux each thread handles many requests, so few are needed.","default":"Logical CPUs / 2, minimum 4","default_note":"Half the available logical processors, at least 4, since MySQL 8.4 (a fixed 4 before).","range":"1 to 64","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_read_io_threads';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_read_io_threads';","change":"SET PERSIST_ONLY innodb_read_io_threads = 8;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Rarely: the 8.4 default scales with the machine.","risk":"Too few appear as read-ahead falling behind on large scans while CPU and buffer pool still have headroom; too many cost little more than scheduler overhead, so erring high is safe on NVMe. It takes a restart, so set it once from the machine's size, not per incident.","related":["innodb-write-io-threads","innodb-parallel-read-threads"],"faqs":[{"question":"What is the default value of innodb_read_io_threads in MySQL?","answer":"Logical CPUs / 2, minimum 4. Half the available logical processors, at least 4, since MySQL 8.4 (a fixed 4 before)."},{"question":"Does changing innodb_read_io_threads require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_read_io_threads?","answer":"Rarely: the 8.4 default scales with the machine."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-read-io-threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-redo-log-capacity","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_redo_log_capacity (MySQL)","description":"MySQL innodb_redo_log_capacity: Total disk space for the InnoDB redo log. Default: 100MB.","body":{"engine":"mysql","slug":"innodb-redo-log-capacity","name":"innodb_redo_log_capacity","topic":"durability","summary":"Total disk space for the InnoDB redo log.","detail":"Replaced innodb_log_file_size and innodb_log_files_in_group in MySQL 8.0.30. InnoDB keeps 32 files in #innodb_redo. A larger log means fewer forced flushes during write bursts and longer crash recovery.","default":"100MB","default_note":"104857600 bytes (MySQL 8.4). With innodb_dedicated_server=ON it is sized from the CPU count.","range":"8MB to 512GB","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_redo_log_capacity';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_redo_log_capacity';","change":"SET GLOBAL innodb_redo_log_capacity = 4294967296;    -- until the next restart\nSET PERSIST innodb_redo_log_capacity = 4294967296;   -- now and after restarts","when":"On write-heavy servers: size it to hold roughly an hour of peak redo (measure Innodb_redo_log_current_lsn over time). 100MB is small for busy production servers.","risk":"Larger capacity lengthens crash recovery. Changing it online is fine; InnoDB resizes as files are recycled.","related":["innodb-log-buffer-size","innodb-flush-log-at-trx-commit","innodb-io-capacity"],"faqs":[{"question":"What is the default value of innodb_redo_log_capacity in MySQL?","answer":"100MB. 104857600 bytes (MySQL 8.4). With innodb_dedicated_server=ON it is sized from the CPU count."},{"question":"Does changing innodb_redo_log_capacity require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change innodb_redo_log_capacity?","answer":"On write-heavy servers: size it to hold roughly an hour of peak redo (measure Innodb_redo_log_current_lsn over time). 100MB is small for busy production servers."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-redo-log-capacity","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/innodb-write-io-threads","corpus":"sql-configuration","engine":"mysql","language":"en","title":"innodb_write_io_threads (MySQL)","description":"MySQL innodb_write_io_threads: Background threads for InnoDB write I/O. Default: 4.","body":{"engine":"mysql","slug":"innodb-write-io-threads","name":"innodb_write_io_threads","topic":"io","summary":"Background threads for InnoDB write I/O.","detail":"Writes are mostly issued by page cleaner threads through these I/O threads.","default":"4","default_note":"4 (MySQL 8.4), a fixed value that 8.4 did not rescale, unlike innodb_read_io_threads.","range":"1 to 64","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'innodb_write_io_threads';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'innodb_write_io_threads';","change":"SET PERSIST_ONLY innodb_write_io_threads = 8;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Rarely; prefer raising innodb_page_cleaners or innodb_io_capacity when flushing lags.","risk":"Flush throughput depends at least as much on innodb_io_capacity and innodb_page_cleaners, so raising this alone rarely clears a write backlog; check Innodb_data_pending_writes before restarting the server for it.","related":["innodb-read-io-threads","innodb-page-cleaners"],"faqs":[{"question":"What is the default value of innodb_write_io_threads in MySQL?","answer":"4. 4 (MySQL 8.4), a fixed value that 8.4 did not rescale, unlike innodb_read_io_threads."},{"question":"Does changing innodb_write_io_threads require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change innodb_write_io_threads?","answer":"Rarely; prefer raising innodb_page_cleaners or innodb_io_capacity when flushing lags."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/innodb-write-io-threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/interactive-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"interactive_timeout (MySQL)","description":"MySQL interactive_timeout: Idle timeout for interactive clients such as the mysql command-line client. Default: 28800 (8 hours).","body":{"engine":"mysql","slug":"interactive-timeout","name":"interactive_timeout","topic":"timeouts","summary":"Idle timeout for interactive clients such as the mysql command-line client.","detail":"When a client connects with CLIENT_INTERACTIVE, its session wait_timeout is initialized from this value.","default":"28800 (8 hours)","default_note":"28800 seconds (MySQL 8.4).","range":"1 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'interactive_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'interactive_timeout';","change":"SET SESSION interactive_timeout = 3600;   -- this connection\nSET GLOBAL interactive_timeout = 3600;    -- new connections, until restart\nSET PERSIST interactive_timeout = 3600;   -- new connections, and after restarts","when":"Lower it if forgotten shell sessions hold locks or connections.","risk":"It applies only to clients that connect with CLIENT_INTERACTIVE, effectively the mysql command line and connectors with an explicit interactive option; most pools and drivers use wait_timeout and never read this, so a global change does nothing for app sessions.","related":["wait-timeout"],"faqs":[{"question":"What is the default value of interactive_timeout in MySQL?","answer":"28800 (8 hours). 28800 seconds (MySQL 8.4)."},{"question":"Does changing interactive_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change interactive_timeout?","answer":"Lower it if forgotten shell sessions hold locks or connections."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/interactive-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/join-buffer-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"join_buffer_size (MySQL)","description":"MySQL join_buffer_size: Buffer for joins that cannot use an index, including hash joins. Default: 256KB.","body":{"engine":"mysql","slug":"join-buffer-size","name":"join_buffer_size","topic":"memory","summary":"Buffer for joins that cannot use an index, including hash joins.","detail":"Used by hash joins (which replaced block nested-loop joins in MySQL 8.0.20) and by Batched Key Access. One buffer can be allocated per such join in a query.","default":"256KB","default_note":"262144 bytes (MySQL 8.4).","range":"128 bytes to about 2^64 bytes","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'join_buffer_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'join_buffer_size';","change":"SET SESSION join_buffer_size = 4194304;   -- this connection\nSET GLOBAL join_buffer_size = 4194304;    -- new connections, until restart\nSET PERSIST join_buffer_size = 4194304;   -- new connections, and after restarts","when":"Raise per session for analytic queries doing large hash joins; first look for a missing index.","risk":"Allocated per join per connection; large global values add up quickly.","related":["sort-buffer-size"],"faqs":[{"question":"What is the default value of join_buffer_size in MySQL?","answer":"256KB. 262144 bytes (MySQL 8.4)."},{"question":"Does changing join_buffer_size require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change join_buffer_size?","answer":"Raise per session for analytic queries doing large hash joins; first look for a missing index."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/join-buffer-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/lock-wait-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"lock_wait_timeout (MySQL)","description":"MySQL lock_wait_timeout: Seconds to wait for a metadata lock (DDL, LOCK TABLES, FLUSH TABLES). Default: 31536000 (1 year).","body":{"engine":"mysql","slug":"lock-wait-timeout","name":"lock_wait_timeout","topic":"timeouts","summary":"Seconds to wait for a metadata lock (DDL, LOCK TABLES, FLUSH TABLES).","detail":"An ALTER TABLE waiting for a metadata lock blocks new queries on that table behind it, so a long wait is effectively an outage.","default":"31536000 (1 year)","default_note":"31536000 seconds (MySQL 8.4).","range":"1 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'lock_wait_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'lock_wait_timeout';","change":"SET SESSION lock_wait_timeout = 10;   -- this connection\nSET GLOBAL lock_wait_timeout = 10;    -- new connections, until restart\nSET PERSIST lock_wait_timeout = 10;   -- new connections, and after restarts","when":"Set it low in the session that runs migrations so DDL fails fast instead of queueing behind a long transaction.","risk":"The timed-out statement fails and must be retried, which is the point: a migration that would otherwise queue for hours behind one long transaction dies in seconds, and the queries piling up behind the migration are never blocked. The failed DDL leaves the schema unchanged.","related":["innodb-lock-wait-timeout"],"faqs":[{"question":"What is the default value of lock_wait_timeout in MySQL?","answer":"31536000 (1 year). 31536000 seconds (MySQL 8.4)."},{"question":"Does changing lock_wait_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change lock_wait_timeout?","answer":"Set it low in the session that runs migrations so DDL fails fast instead of queueing behind a long transaction."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/lock-wait-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/log-bin","corpus":"sql-configuration","engine":"mysql","language":"en","title":"log_bin (MySQL)","description":"MySQL log_bin: Whether the binary log is enabled. Default: ON.","body":{"engine":"mysql","slug":"log-bin","name":"log_bin","topic":"durability","summary":"Whether the binary log is enabled.","detail":"The binary log feeds replication and point-in-time recovery. The variable shows the state; you control it at startup: --log-bin[=base_name] enables it, --skip-log-bin or --disable-log-bin turns it off.","default":"ON","default_note":"ON since MySQL 8.0 (it was off in 5.7). Same in 8.4.","range":"ON, OFF","restart_required":true,"apply":"Restart required, and the variable cannot be persisted: SET GLOBAL and SET PERSIST_ONLY both fail with error 1238. Set it under [mysqld] in my.cnf or on the mysqld command line.","view":"SHOW GLOBAL VARIABLES LIKE 'log_bin';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'log_bin';","change":"-- SET PERSIST_ONLY log_bin fails: error 1238, non persistent read only variable.\n-- Add this line under [mysqld] in my.cnf, then restart mysqld:\n--   skip-log-bin","when":"Disable it only on standalone servers with no replicas and no point-in-time recovery needs, such as CI databases.","risk":"Without it there is no replication from this server and no recovery to a point between backups.","related":["sync-binlog","binlog-expire-logs-seconds"],"faqs":[{"question":"What is the default value of log_bin in MySQL?","answer":"ON. ON since MySQL 8.0 (it was off in 5.7). Same in 8.4."},{"question":"Does changing log_bin require a restart?","answer":"Yes. Restart required, and the variable cannot be persisted: SET GLOBAL and SET PERSIST_ONLY both fail with error 1238. Set it under [mysqld] in my.cnf or on the mysqld command line."},{"question":"When should I change log_bin?","answer":"Disable it only on standalone servers with no replicas and no point-in-time recovery needs, such as CI databases."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/log-bin","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/log-slow-extra","corpus":"sql-configuration","engine":"mysql","language":"en","title":"log_slow_extra (MySQL)","description":"MySQL log_slow_extra: Add extra fields such as rows sent, bytes and temporary table counts to slow log entries. Default: OFF.","body":{"engine":"mysql","slug":"log-slow-extra","name":"log_slow_extra","topic":"logging","summary":"Add extra fields such as rows sent, bytes and temporary table counts to slow log entries.","detail":"Available from MySQL 8.0.14 and only when the slow log is written to a file; the mysql.slow_log table ignores it. The added fields include rows examined and sent, bytes, and temporary table and filesort counts, so the entry shows why a statement was slow and not just that it was.","default":"OFF","default_note":"OFF (MySQL 8.4).","range":"ON, OFF","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'log_slow_extra';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'log_slow_extra';","change":"SET GLOBAL log_slow_extra = ON;    -- until the next restart\nSET PERSIST log_slow_extra = ON;   -- now and after restarts","when":"Turn it on with the slow log; the extra fields show why a statement was slow.","risk":"The extra fields only reach the file log; the mysql.slow_log table ignores them. With it off, tools like mysqldumpslow and pt-query-digest lose rows examined and temp table counts, which is what separates a bad plan from a big table.","related":["slow-query-log"],"faqs":[{"question":"What is the default value of log_slow_extra in MySQL?","answer":"OFF. OFF (MySQL 8.4)."},{"question":"Does changing log_slow_extra require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change log_slow_extra?","answer":"Turn it on with the slow log; the extra fields show why a statement was slow."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/log-slow-extra","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/long-query-time","corpus":"sql-configuration","engine":"mysql","language":"en","title":"long_query_time (MySQL)","description":"MySQL long_query_time: Seconds a statement must run to be written to the slow query log. Default: 10.","body":{"engine":"mysql","slug":"long-query-time","name":"long_query_time","topic":"logging","summary":"Seconds a statement must run to be written to the slow query log.","detail":"Fractional values work down to microseconds. The time excludes waiting for table locks.","default":"10","default_note":"10 seconds (MySQL 8.4).","range":"0 to 31536000 seconds, with microsecond resolution","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'long_query_time';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'long_query_time';","change":"SET SESSION long_query_time = 0.5;   -- this connection\nSET GLOBAL long_query_time = 0.5;    -- new connections, until restart\nSET PERSIST long_query_time = 0.5;   -- new connections, and after restarts","when":"10 seconds misses most problems; 0.5-1 second is a common production value.","risk":"0 logs every statement: useful briefly for sampling, too heavy to leave on.","related":["slow-query-log","max-execution-time"],"faqs":[{"question":"What is the default value of long_query_time in MySQL?","answer":"10. 10 seconds (MySQL 8.4)."},{"question":"Does changing long_query_time require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change long_query_time?","answer":"10 seconds misses most problems; 0.5-1 second is a common production value."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/long-query-time","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/max-allowed-packet","corpus":"sql-configuration","engine":"mysql","language":"en","title":"max_allowed_packet (MySQL)","description":"MySQL max_allowed_packet: Largest single packet, and so the largest row, BLOB or statement, the server accepts. Default: 64MB.","body":{"engine":"mysql","slug":"max-allowed-packet","name":"max_allowed_packet","topic":"connections","summary":"Largest single packet, and so the largest row, BLOB or statement, the server accepts.","detail":"Also limits the size of strings that functions such as GROUP_CONCAT or REPEAT can return. The client has its own max_allowed_packet; both must be large enough.","default":"64MB","default_note":"67108864 bytes since MySQL 8.0 (MySQL 8.4).","range":"1KB to 1GB","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'max_allowed_packet';","change":"SET GLOBAL max_allowed_packet = 268435456;    -- until the next restart\nSET PERSIST max_allowed_packet = 268435456;   -- now and after restarts","when":"When inserts of large BLOBs or long multi-row INSERTs fail with 'Packet too large' or the connection drops on big dumps.","risk":"The session value is read-only and taken from the global one when a connection opens. Large values let a client make the server allocate big buffers.","related":["max-connections"],"faqs":[{"question":"What is the default value of max_allowed_packet in MySQL?","answer":"64MB. 67108864 bytes since MySQL 8.0 (MySQL 8.4)."},{"question":"Does changing max_allowed_packet require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change max_allowed_packet?","answer":"When inserts of large BLOBs or long multi-row INSERTs fail with 'Packet too large' or the connection drops on big dumps."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/max-allowed-packet","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/max-connect-errors","corpus":"sql-configuration","engine":"mysql","language":"en","title":"max_connect_errors (MySQL)","description":"MySQL max_connect_errors: Failed connection attempts from one host before it is blocked. Default: 100.","body":{"engine":"mysql","slug":"max-connect-errors","name":"max_connect_errors","topic":"connections","summary":"Failed connection attempts from one host before it is blocked.","detail":"Counts interrupted handshakes, not wrong passwords. Once blocked, the host gets 'Host is blocked because of many connection errors' until the host cache is flushed.","default":"100","default_note":"100 (MySQL 8.4).","range":"1 to 2^64-1","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'max_connect_errors';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'max_connect_errors';","change":"SET GLOBAL max_connect_errors = 10000;    -- until the next restart\nSET PERSIST max_connect_errors = 10000;   -- now and after restarts","when":"Raise it when load balancer health checks (TCP connects that never authenticate) keep blocking app servers.","risk":"Unblock a host with TRUNCATE TABLE performance_schema.host_cache; FLUSH HOSTS is deprecated.","related":["max-connections","skip-name-resolve"],"faqs":[{"question":"What is the default value of max_connect_errors in MySQL?","answer":"100. 100 (MySQL 8.4)."},{"question":"Does changing max_connect_errors require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change max_connect_errors?","answer":"Raise it when load balancer health checks (TCP connects that never authenticate) keep blocking app servers."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/max-connect-errors","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/max-connections","corpus":"sql-configuration","engine":"mysql","language":"en","title":"max_connections (MySQL)","description":"MySQL max_connections: Maximum simultaneous client connections. Default: 151.","body":{"engine":"mysql","slug":"max-connections","name":"max_connections","topic":"connections","summary":"Maximum simultaneous client connections.","detail":"One more connection is always allowed for accounts with CONNECTION_ADMIN (or SUPER) so an administrator can get in. Each connection costs a thread and its buffers.","default":"151","default_note":"151 (MySQL 8.4).","range":"1 to 100000","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'max_connections';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'max_connections';","change":"SET GLOBAL max_connections = 500;    -- until the next restart\nSET PERSIST max_connections = 500;   -- now and after restarts","when":"When clients get 'Too many connections' and Max_used_connections reaches the limit. Check for leaked or idle pooled connections first.","risk":"Each connection may allocate sort, join and temp buffers; memory use rises with the setting. open_files_limit may also need raising.","related":["thread-cache-size","wait-timeout","max-connect-errors"],"faqs":[{"question":"What is the default value of max_connections in MySQL?","answer":"151. 151 (MySQL 8.4)."},{"question":"Does changing max_connections require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change max_connections?","answer":"When clients get 'Too many connections' and Max_used_connections reaches the limit. Check for leaked or idle pooled connections first."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/max-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/max-execution-time","corpus":"sql-configuration","engine":"mysql","language":"en","title":"max_execution_time (MySQL)","description":"MySQL max_execution_time: Milliseconds after which a read-only SELECT is aborted; 0 disables. Default: 0 (disabled).","body":{"engine":"mysql","slug":"max-execution-time","name":"max_execution_time","topic":"timeouts","summary":"Milliseconds after which a read-only SELECT is aborted; 0 disables.","detail":"Applies only to read-only SELECT statements, not to INSERT ... SELECT or other DML. A per-query hint, SELECT /*+ MAX_EXECUTION_TIME(1000) */ ..., overrides it.","default":"0 (disabled)","default_note":"0 (MySQL 8.4), so SELECTs run unbounded unless this setting or a MAX_EXECUTION_TIME hint says otherwise.","range":"0 to 2^64-1 ms","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'max_execution_time';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'max_execution_time';","change":"SET SESSION max_execution_time = 30000;   -- this connection\nSET GLOBAL max_execution_time = 30000;    -- new connections, until restart\nSET PERSIST max_execution_time = 30000;   -- new connections, and after restarts","when":"For reporting users or ad hoc query tools, so an accidental cross join does not run for hours.","risk":"Statements fail with error 3024 (maximum statement execution time exceeded).","related":["long-query-time"],"faqs":[{"question":"What is the default value of max_execution_time in MySQL?","answer":"0 (disabled). 0 (MySQL 8.4), so SELECTs run unbounded unless this setting or a MAX_EXECUTION_TIME hint says otherwise."},{"question":"Does changing max_execution_time require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change max_execution_time?","answer":"For reporting users or ad hoc query tools, so an accidental cross join does not run for hours."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/max-execution-time","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/max-heap-table-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"max_heap_table_size (MySQL)","description":"MySQL max_heap_table_size: Largest user-created MEMORY table. Default: 16MB.","body":{"engine":"mysql","slug":"max-heap-table-size","name":"max_heap_table_size","topic":"memory","summary":"Largest user-created MEMORY table.","detail":"Limits tables created with ENGINE=MEMORY. If internal temporary tables use the MEMORY engine (internal_tmp_mem_storage_engine=MEMORY), their limit is the smaller of this and tmp_table_size.","default":"16MB","default_note":"16777216 bytes (MySQL 8.4).","range":"16KB to 2^64-1 bytes","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'max_heap_table_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'max_heap_table_size';","change":"SET SESSION max_heap_table_size = 67108864;   -- this connection\nSET GLOBAL max_heap_table_size = 67108864;    -- new connections, until restart\nSET PERSIST max_heap_table_size = 67108864;   -- new connections, and after restarts","when":"Only if you use MEMORY tables, or the MEMORY engine for internal temporary tables.","risk":"A MEMORY table's size is fixed when it is created or altered; raising the setting does not grow existing tables.","related":["tmp-table-size"],"faqs":[{"question":"What is the default value of max_heap_table_size in MySQL?","answer":"16MB. 16777216 bytes (MySQL 8.4)."},{"question":"Does changing max_heap_table_size require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change max_heap_table_size?","answer":"Only if you use MEMORY tables, or the MEMORY engine for internal temporary tables."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/max-heap-table-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/net-read-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"net_read_timeout (MySQL)","description":"MySQL net_read_timeout: Seconds the server waits for more data from a client before aborting the read. Default: 30.","body":{"engine":"mysql","slug":"net-read-timeout","name":"net_read_timeout","topic":"timeouts","summary":"Seconds the server waits for more data from a client before aborting the read.","detail":"It applies whenever the server is reading from the client: a statement arriving in several packets, or the data behind a LOAD DATA LOCAL. If the next block does not arrive within the limit the connection is dropped, which clients report as 'Lost connection to MySQL server during query'.","default":"30","default_note":"30 seconds (MySQL 8.4).","range":"1 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'net_read_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'net_read_timeout';","change":"SET SESSION net_read_timeout = 600;   -- this connection\nSET GLOBAL net_read_timeout = 600;    -- new connections, until restart\nSET PERSIST net_read_timeout = 600;   -- new connections, and after restarts","when":"When a bulk loader or a client on a slow link sends very large statements in pieces and connections keep dying mid-send.","risk":"Raising it globally keeps half-dead connections, each with a thread and its buffers, alive for the whole limit. A value that has to be huge usually points at a network problem or a client writing data in dribbles; find that instead of stretching the timeout for everyone.","related":["net-write-timeout","wait-timeout","connect-timeout"],"faqs":[{"question":"What is the default value of net_read_timeout in MySQL?","answer":"30. 30 seconds (MySQL 8.4)."},{"question":"Does changing net_read_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change net_read_timeout?","answer":"When a bulk loader or a client on a slow link sends very large statements in pieces and connections keep dying mid-send."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/net-read-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/net-write-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"net_write_timeout (MySQL)","description":"MySQL net_write_timeout: Seconds the server waits writing a block to a client before aborting. Default: 60.","body":{"engine":"mysql","slug":"net-write-timeout","name":"net_write_timeout","topic":"timeouts","summary":"Seconds the server waits writing a block to a client before aborting.","detail":"When the server has a result block ready but the client has stopped reading, the write stalls and the connection is dropped after this limit. It is the usual server-side sign behind 'Lost connection to MySQL server during query' when a client abandons a huge result set mid-transfer.","default":"60","default_note":"60 seconds (MySQL 8.4).","range":"1 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'net_write_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'net_write_timeout';","change":"SET SESSION net_write_timeout = 300;   -- this connection\nSET GLOBAL net_write_timeout = 300;    -- new connections, until restart\nSET PERSIST net_write_timeout = 300;   -- new connections, and after restarts","when":"For clients that legitimately pull large results slowly, such as report extracts over a WAN link; raise it in that session rather than globally.","risk":"A stalled client keeps its thread, its sort and read buffers, and any locks its open transaction holds until the timeout fires, so a large global value keeps dead sessions around longer. Fetch less per round trip, or stream the result, before stretching it server wide.","related":["net-read-timeout","wait-timeout","max-allowed-packet"],"faqs":[{"question":"What is the default value of net_write_timeout in MySQL?","answer":"60. 60 seconds (MySQL 8.4)."},{"question":"Does changing net_write_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change net_write_timeout?","answer":"For clients that legitimately pull large results slowly, such as report extracts over a WAN link; raise it in that session rather than globally."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/net-write-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/performance-schema","corpus":"sql-configuration","engine":"mysql","language":"en","title":"performance_schema (MySQL)","description":"MySQL performance_schema: Enable the Performance Schema instrumentation. Default: ON.","body":{"engine":"mysql","slug":"performance-schema","name":"performance_schema","topic":"logging","summary":"Enable the Performance Schema instrumentation.","detail":"Provides statement digests, wait events, locks and memory instrumentation, and the sys schema views built on it.","default":"ON","default_note":"ON (MySQL 8.4).","range":"ON, OFF","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'performance_schema';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'performance_schema';","change":"SET PERSIST_ONLY performance_schema = OFF;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Leave it on; individual instruments and consumers can be toggled at runtime in performance_schema.setup_instruments and setup_consumers.","risk":"Turning it off saves some memory and CPU but removes most diagnostics.","related":["slow-query-log"],"faqs":[{"question":"What is the default value of performance_schema in MySQL?","answer":"ON. ON (MySQL 8.4)."},{"question":"Does changing performance_schema require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change performance_schema?","answer":"Leave it on; individual instruments and consumers can be toggled at runtime in performance_schema.setup_instruments and setup_consumers."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/performance-schema","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/read-rnd-buffer-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"read_rnd_buffer_size (MySQL)","description":"MySQL read_rnd_buffer_size: Buffer for reading rows in sorted order and for Multi-Range Read. Default: 256KB.","body":{"engine":"mysql","slug":"read-rnd-buffer-size","name":"read_rnd_buffer_size","topic":"memory","summary":"Buffer for reading rows in sorted order and for Multi-Range Read.","detail":"When rows of a MyISAM table are read back in sorted order after a key sort, they go through this buffer to avoid disk seeks. It also drives Multi-Range Read (MRR) for any storage engine, which batches row lookups from a range scan into sequential reads. Most InnoDB OLTP queries use neither path, which is why the global default stays small.","default":"256KB","default_note":"262144 bytes (MySQL 8.4).","range":"1 to 2147483647 bytes","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'read_rnd_buffer_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'read_rnd_buffer_size';","change":"SET SESSION read_rnd_buffer_size = 1048576;   -- this connection\nSET GLOBAL read_rnd_buffer_size = 1048576;    -- new connections, until restart\nSET PERSIST read_rnd_buffer_size = 1048576;   -- new connections, and after restarts","when":"Per session, when a query plan shows Multi-Range Read or a large sorted MyISAM read and the bigger buffer measurably speeds it up.","risk":"The buffer is allocated per client, so a large global value multiplies across connections even though only the few queries that use MRR or sorted MyISAM reads ever allocate it. Keep the global default and raise the session value where it helps.","related":["sort-buffer-size","join-buffer-size"],"faqs":[{"question":"What is the default value of read_rnd_buffer_size in MySQL?","answer":"256KB. 262144 bytes (MySQL 8.4)."},{"question":"Does changing read_rnd_buffer_size require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change read_rnd_buffer_size?","answer":"Per session, when a query plan shows Multi-Range Read or a large sorted MyISAM read and the bigger buffer measurably speeds it up."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/read-rnd-buffer-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/replica-parallel-workers","corpus":"sql-configuration","engine":"mysql","language":"en","title":"replica_parallel_workers (MySQL)","description":"MySQL replica_parallel_workers: Applier threads a replica uses to apply transactions in parallel. Default: 4.","body":{"engine":"mysql","slug":"replica-parallel-workers","name":"replica_parallel_workers","topic":"parallelism","summary":"Applier threads a replica uses to apply transactions in parallel.","detail":"Parallel apply follows the commit dependencies recorded by the source. 1 applies transactions one at a time (one coordinator, one worker); 0 also applies them sequentially but is deprecated in 8.4 and raises a warning.","default":"4","default_note":"4 since MySQL 8.0.27 (0 before). Same in 8.4.","range":"0 to 1024","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'replica_parallel_workers';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'replica_parallel_workers';","change":"SET GLOBAL replica_parallel_workers = 8;    -- until the next restart\nSET PERSIST replica_parallel_workers = 8;   -- now and after restarts","when":"When a replica lags under a write load the source handles easily. A new value takes effect at the next START REPLICA, so run STOP REPLICA SQL_THREAD; START REPLICA SQL_THREAD; after changing it.","risk":"More threads use more memory and help only when the source's transactions are independent.","related":["log-bin"],"faqs":[{"question":"What is the default value of replica_parallel_workers in MySQL?","answer":"4. 4 since MySQL 8.0.27 (0 before). Same in 8.4."},{"question":"Does changing replica_parallel_workers require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change replica_parallel_workers?","answer":"When a replica lags under a write load the source handles easily. A new value takes effect at the next START REPLICA, so run STOP REPLICA SQL_THREAD; START REPLICA SQL_THREAD; after changing it."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/replica-parallel-workers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/skip-name-resolve","corpus":"sql-configuration","engine":"mysql","language":"en","title":"skip_name_resolve (MySQL)","description":"MySQL skip_name_resolve: Do not resolve client host names; match accounts by IP address only. Default: OFF.","body":{"engine":"mysql","slug":"skip-name-resolve","name":"skip_name_resolve","topic":"security","summary":"Do not resolve client host names; match accounts by IP address only.","detail":"Without it, every new connection may wait on a reverse DNS lookup, and account names like 'app'@'web1.example.com' depend on DNS.","default":"OFF","default_note":"OFF (MySQL 8.4). The official Docker image turns it ON in its config file, so variables_info shows it as ON with VARIABLE_SOURCE GLOBAL (the global option file).","range":"ON, OFF","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'skip_name_resolve';","change":"SET PERSIST_ONLY skip_name_resolve = ON;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Turn it on for faster, DNS-independent logins, after checking that no account uses a host name.","risk":"Accounts defined with host names (other than localhost) stop matching.","related":["max-connect-errors"],"faqs":[{"question":"What is the default value of skip_name_resolve in MySQL?","answer":"OFF. OFF (MySQL 8.4). The official Docker image turns it ON in its config file, so variables_info shows it as ON with VARIABLE_SOURCE GLOBAL (the global option file)."},{"question":"Does changing skip_name_resolve require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change skip_name_resolve?","answer":"Turn it on for faster, DNS-independent logins, after checking that no account uses a host name."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/skip-name-resolve","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/slow-query-log","corpus":"sql-configuration","engine":"mysql","language":"en","title":"slow_query_log (MySQL)","description":"MySQL slow_query_log: Whether the slow query log is written. Default: OFF.","body":{"engine":"mysql","slug":"slow-query-log","name":"slow_query_log","topic":"logging","summary":"Whether the slow query log is written.","detail":"Logs statements slower than long_query_time to slow_query_log_file (or a table, depending on log_output).","default":"OFF","default_note":"OFF (MySQL 8.4).","range":"ON, OFF","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'slow_query_log';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'slow_query_log';","change":"SET GLOBAL slow_query_log = ON;    -- until the next restart\nSET PERSIST slow_query_log = ON;   -- now and after restarts","when":"Turn it on in production; analyze the file with mysqldumpslow or pt-query-digest.","risk":"A low long_query_time on a busy server makes the log grow fast; rotate it.","related":["long-query-time","log-slow-extra"],"faqs":[{"question":"What is the default value of slow_query_log in MySQL?","answer":"OFF. OFF (MySQL 8.4)."},{"question":"Does changing slow_query_log require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change slow_query_log?","answer":"Turn it on in production; analyze the file with mysqldumpslow or pt-query-digest."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/slow-query-log","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/sort-buffer-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"sort_buffer_size (MySQL)","description":"MySQL sort_buffer_size: Memory each sort may use before it writes merge passes to disk. Default: 256KB.","body":{"engine":"mysql","slug":"sort-buffer-size","name":"sort_buffer_size","topic":"memory","summary":"Memory each sort may use before it writes merge passes to disk.","detail":"Each sort that cannot use an index gets its own buffer. Since MySQL 8.0.12 the buffer grows as needed up to this size instead of being allocated in full. Sort_merge_passes in SHOW GLOBAL STATUS counts sorts that did not fit.","default":"256KB","default_note":"262144 bytes (MySQL 8.4).","range":"32KB to 2^64-1 bytes","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'sort_buffer_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'sort_buffer_size';","change":"SET SESSION sort_buffer_size = 2097152;   -- this connection\nSET GLOBAL sort_buffer_size = 2097152;    -- new connections, until restart\nSET PERSIST sort_buffer_size = 2097152;   -- new connections, and after restarts","when":"Raise it per session for a big report rather than globally, if Sort_merge_passes is high.","risk":"Since 8.0.12 the buffer grows on demand instead of being allocated whole, but many concurrent sorts can still stack up real memory: 100 sessions each sorting 16MB is 1.6GB on top of everything else. Raise it in the session that needs it rather than globally.","related":["join-buffer-size","tmp-table-size"],"faqs":[{"question":"What is the default value of sort_buffer_size in MySQL?","answer":"256KB. 262144 bytes (MySQL 8.4)."},{"question":"Does changing sort_buffer_size require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change sort_buffer_size?","answer":"Raise it per session for a big report rather than globally, if Sort_merge_passes is high."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/sort-buffer-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/sql-mode","corpus":"sql-configuration","engine":"mysql","language":"en","title":"sql_mode (MySQL)","description":"MySQL sql_mode: SQL syntax and validation rules, as a comma-separated list of modes.","body":{"engine":"mysql","slug":"sql-mode","name":"sql_mode","topic":"behavior","summary":"SQL syntax and validation rules, as a comma-separated list of modes.","detail":"Controls strictness: STRICT_TRANS_TABLES rejects invalid or truncated data instead of warning, ONLY_FULL_GROUP_BY rejects non-aggregated columns not in GROUP BY.","default":"ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION","default_note":"That list is the default since MySQL 8.0; same in 8.4.","range":"Comma-separated mode names, or ''","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'sql_mode';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'sql_mode';","change":"SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';   -- this connection\nSET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';    -- new connections, until restart\nSET PERSIST sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';   -- new connections, and after restarts","when":"Only to keep a legacy application working while you fix its queries; set it per session for that application rather than globally.","risk":"Removing strict modes lets bad data in silently (truncated strings, zero dates); removing ONLY_FULL_GROUP_BY allows queries with arbitrary results.","related":["transaction-isolation"],"faqs":[{"question":"What is the default value of sql_mode in MySQL?","answer":"ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION. That list is the default since MySQL 8.0; same in 8.4."},{"question":"Does changing sql_mode require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change sql_mode?","answer":"Only to keep a legacy application working while you fix its queries; set it per session for that application rather than globally."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/sql-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/sync-binlog","corpus":"sql-configuration","engine":"mysql","language":"en","title":"sync_binlog (MySQL)","description":"MySQL sync_binlog: How often the binary log is synced to disk. Default: 1.","body":{"engine":"mysql","slug":"sync-binlog","name":"sync_binlog","topic":"durability","summary":"How often the binary log is synced to disk.","detail":"1 syncs at every commit group, so a crash cannot lose transactions that were reported committed. 0 leaves flushing to the OS. N syncs every N commit groups.","default":"1","default_note":"1 since MySQL 5.7.7 (MySQL 8.4).","range":"0 to 4294967295","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'sync_binlog';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'sync_binlog';","change":"SET GLOBAL sync_binlog = 0;    -- until the next restart\nSET PERSIST sync_binlog = 0;   -- now and after restarts","when":"Keep 1 with innodb_flush_log_at_trx_commit=1 on a primary. Relax it only on replicas or throwaway environments.","risk":"Values other than 1 can lose binlog events on a crash, breaking replicas or point-in-time recovery.","related":["innodb-flush-log-at-trx-commit","log-bin"],"faqs":[{"question":"What is the default value of sync_binlog in MySQL?","answer":"1. 1 since MySQL 5.7.7 (MySQL 8.4)."},{"question":"Does changing sync_binlog require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change sync_binlog?","answer":"Keep 1 with innodb_flush_log_at_trx_commit=1 on a primary. Relax it only on replicas or throwaway environments."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/sync-binlog","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/table-definition-cache","corpus":"sql-configuration","engine":"mysql","language":"en","title":"table_definition_cache (MySQL)","description":"MySQL table_definition_cache: Number of table definitions cached. Default: 2000 (autosized).","body":{"engine":"mysql","slug":"table-definition-cache","name":"table_definition_cache","topic":"connections","summary":"Number of table definitions cached.","detail":"Caches the parsed definition of each table, separate from open handles. Autosized at startup to MIN(400 + table_open_cache / 2, 2000).","default":"2000 (autosized)","default_note":"Autosized; with the default table_open_cache of 4000 it is 2000 (MySQL 8.4).","range":"400 to 524288","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'table_definition_cache';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'table_definition_cache';","change":"SET GLOBAL table_definition_cache = 10000;    -- until the next restart\nSET PERSIST table_definition_cache = 10000;   -- now and after restarts","when":"Schemas with more tables than the cache holds; compare Opened_table_definitions over time.","risk":"Definitions are small but not free, and servers with tens of thousands of tables can spend real memory here, more when tables are wide. Too low shows up as Opened_table_definitions climbing while the server re-reads table metadata from the data dictionary.","related":["table-open-cache"],"faqs":[{"question":"What is the default value of table_definition_cache in MySQL?","answer":"2000 (autosized). Autosized; with the default table_open_cache of 4000 it is 2000 (MySQL 8.4)."},{"question":"Does changing table_definition_cache require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change table_definition_cache?","answer":"Schemas with more tables than the cache holds; compare Opened_table_definitions over time."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/table-definition-cache","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/table-open-cache","corpus":"sql-configuration","engine":"mysql","language":"en","title":"table_open_cache (MySQL)","description":"MySQL table_open_cache: Number of open table handles cached across all sessions. Default: 4000.","body":{"engine":"mysql","slug":"table-open-cache","name":"table_open_cache","topic":"connections","summary":"Number of open table handles cached across all sessions.","detail":"Each session that uses a table needs its own handle. When Opened_tables grows steadily, handles are being closed and reopened.","default":"4000","default_note":"4000 (MySQL 8.4).","range":"1 to 524288","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'table_open_cache';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'table_open_cache';","change":"SET GLOBAL table_open_cache = 8000;    -- until the next restart\nSET PERSIST table_open_cache = 8000;   -- now and after restarts","when":"Servers with thousands of tables or many concurrent connections touching many tables.","risk":"Needs file descriptors; mysqld may raise or be limited by open_files_limit.","related":["table-definition-cache","max-connections"],"faqs":[{"question":"What is the default value of table_open_cache in MySQL?","answer":"4000. 4000 (MySQL 8.4)."},{"question":"Does changing table_open_cache require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change table_open_cache?","answer":"Servers with thousands of tables or many concurrent connections touching many tables."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/table-open-cache","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/table-open-cache-instances","corpus":"sql-configuration","engine":"mysql","language":"en","title":"table_open_cache_instances (MySQL)","description":"MySQL table_open_cache_instances: Number of shards the open tables cache is split into. Default: 16.","body":{"engine":"mysql","slug":"table-open-cache-instances","name":"table_open_cache_instances","topic":"connections","summary":"Number of shards the open tables cache is split into.","detail":"The cache is partitioned into instances of table_open_cache / table_open_cache_instances each, and a session locks only its one instance for DML, which cuts contention on many-core servers. DDL still locks the whole cache, which is why heavy DDL is the workload that feels this setting.","default":"16","default_note":"16 (MySQL 8.4); the manual recommends 8 or 16 on systems that routinely use 16 or more cores.","range":"1 to 64","restart_required":true,"apply":"Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.","view":"SHOW GLOBAL VARIABLES LIKE 'table_open_cache_instances';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'table_open_cache_instances';","change":"SET PERSIST_ONLY table_open_cache_instances = 16;\n-- then restart mysqld (or set it under [mysqld] in my.cnf)","when":"Rarely: 16 is right for most many-core servers. Drop to 1 only when very large triggers on many tables make the cache hold excessive memory.","risk":"Raising it shrinks each instance instead of growing the cache, so it only spreads the same table_open_cache across more locks. Many large triggers multiply per-instance memory, which is the one case the manual names for lowering it.","related":["table-open-cache","table-definition-cache"],"faqs":[{"question":"What is the default value of table_open_cache_instances in MySQL?","answer":"16. 16 (MySQL 8.4); the manual recommends 8 or 16 on systems that routinely use 16 or more cores."},{"question":"Does changing table_open_cache_instances require a restart?","answer":"Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf."},{"question":"When should I change table_open_cache_instances?","answer":"Rarely: 16 is right for most many-core servers. Drop to 1 only when very large triggers on many tables make the cache hold excessive memory."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/table-open-cache-instances","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/temptable-max-ram","corpus":"sql-configuration","engine":"mysql","language":"en","title":"temptable_max_ram (MySQL)","description":"MySQL temptable_max_ram: Total RAM the TempTable engine may use for internal temporary tables before spilling. Default: 3% of RAM, 1GB to 4GB.","body":{"engine":"mysql","slug":"temptable-max-ram","name":"temptable_max_ram","topic":"temp","summary":"Total RAM the TempTable engine may use for internal temporary tables before spilling.","detail":"Shared by every internal temporary table on the server. Beyond it, TempTable spills to memory-mapped files up to temptable_max_mmap, then to InnoDB on-disk tables. In 8.4 temptable_max_mmap defaults to 0, so spills go straight to InnoDB.","default":"3% of RAM, 1GB to 4GB","default_note":"3% of total memory, kept between 1GB and 4GB, since MySQL 8.4 (a fixed 1GB in 8.0). A server with less than about 33GB of RAM gets 1GB.","range":"2MB to 2^64-1 bytes","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'temptable_max_ram';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'temptable_max_ram';","change":"SET GLOBAL temptable_max_ram = 2147483648;    -- until the next restart\nSET PERSIST temptable_max_ram = 2147483648;   -- now and after restarts","when":"Raise it on reporting servers with heavy GROUP BY or window-function workloads that spill.","risk":"Memory used here comes off the same RAM the buffer pool wants, so raising both on one host oversubscribes memory. Once the limit passes, tables spill to InnoDB on disk in 8.4 (temptable_max_mmap is 0 by default), which shows up as Created_tmp_disk_tables and slower queries.","related":["tmp-table-size"],"faqs":[{"question":"What is the default value of temptable_max_ram in MySQL?","answer":"3% of RAM, 1GB to 4GB. 3% of total memory, kept between 1GB and 4GB, since MySQL 8.4 (a fixed 1GB in 8.0). A server with less than about 33GB of RAM gets 1GB."},{"question":"Does changing temptable_max_ram require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change temptable_max_ram?","answer":"Raise it on reporting servers with heavy GROUP BY or window-function workloads that spill."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/temptable-max-ram","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/thread-cache-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"thread_cache_size (MySQL)","description":"MySQL thread_cache_size: Threads kept for reuse after a client disconnects. Default: 9 (autosized).","body":{"engine":"mysql","slug":"thread-cache-size","name":"thread_cache_size","topic":"connections","summary":"Threads kept for reuse after a client disconnects.","detail":"Reusing a thread avoids creating one for each new connection. -1 at startup means autosize: 8 + max_connections / 100.","default":"9 (autosized)","default_note":"Autosized to 8 + max_connections / 100, which is 9 with the default 151 (MySQL 8.4).","range":"0 to 16384","restart_required":false,"apply":"No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts.","view":"SHOW GLOBAL VARIABLES LIKE 'thread_cache_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'thread_cache_size';","change":"SET GLOBAL thread_cache_size = 64;    -- until the next restart\nSET PERSIST thread_cache_size = 64;   -- now and after restarts","when":"When Threads_created keeps climbing relative to Connections on a server with many short connections.","risk":"Cached threads keep their stacks, so a high ceiling costs some memory, but the real trap is expecting it to fix churn: threads enter the cache only when connections close, so a pool that opens connections faster than they close still creates threads. Watch Threads_created alongside Connections.","related":["max-connections"],"faqs":[{"question":"What is the default value of thread_cache_size in MySQL?","answer":"9 (autosized). Autosized to 8 + max_connections / 100, which is 9 with the default 151 (MySQL 8.4)."},{"question":"Does changing thread_cache_size require a restart?","answer":"No. No restart. SET GLOBAL or SET PERSIST takes effect immediately; SET PERSIST also writes mysqld-auto.cnf so the value survives restarts."},{"question":"When should I change thread_cache_size?","answer":"When Threads_created keeps climbing relative to Connections on a server with many short connections."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/thread-cache-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/tmp-table-size","corpus":"sql-configuration","engine":"mysql","language":"en","title":"tmp_table_size (MySQL)","description":"MySQL tmp_table_size: Largest in-memory internal temporary table before it converts to disk. Default: 16MB.","body":{"engine":"mysql","slug":"tmp-table-size","name":"tmp_table_size","topic":"memory","summary":"Largest in-memory internal temporary table before it converts to disk.","detail":"Internal temporary tables back GROUP BY, DISTINCT, UNION and derived tables. With the TempTable engine (the default), tmp_table_size limits each table (from 8.0.28) and temptable_max_ram limits all of them together.","default":"16MB","default_note":"16777216 bytes (MySQL 8.4).","range":"1KB to 2^64-1 bytes","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'tmp_table_size';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'tmp_table_size';","change":"SET SESSION tmp_table_size = 67108864;   -- this connection\nSET GLOBAL tmp_table_size = 67108864;    -- new connections, until restart\nSET PERSIST tmp_table_size = 67108864;   -- new connections, and after restarts","when":"When Created_tmp_disk_tables is a large share of Created_tmp_tables and the queries are ones you cannot rewrite.","risk":"Per table, per connection: many concurrent large GROUP BY queries can use much more than the setting.","related":["temptable-max-ram","max-heap-table-size"],"faqs":[{"question":"What is the default value of tmp_table_size in MySQL?","answer":"16MB. 16777216 bytes (MySQL 8.4)."},{"question":"Does changing tmp_table_size require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change tmp_table_size?","answer":"When Created_tmp_disk_tables is a large share of Created_tmp_tables and the queries are ones you cannot rewrite."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/tmp-table-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/transaction-isolation","corpus":"sql-configuration","engine":"mysql","language":"en","title":"transaction_isolation (MySQL)","description":"MySQL transaction_isolation: Default transaction isolation level. Default: REPEATABLE-READ.","body":{"engine":"mysql","slug":"transaction-isolation","name":"transaction_isolation","topic":"behavior","summary":"Default transaction isolation level.","detail":"REPEATABLE READ gives each transaction a consistent snapshot and uses gap locks on locking reads; READ COMMITTED takes a fresh snapshot per statement and uses fewer gap locks.","default":"REPEATABLE-READ","default_note":"REPEATABLE-READ (MySQL 8.4).","range":"READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'transaction_isolation';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'transaction_isolation';","change":"SET SESSION transaction_isolation = 'READ-COMMITTED';   -- this connection\nSET GLOBAL transaction_isolation = 'READ-COMMITTED';    -- new connections, until restart\nSET PERSIST transaction_isolation = 'READ-COMMITTED';   -- new connections, and after restarts","when":"READ COMMITTED reduces gap-lock deadlocks in high-concurrency write workloads and matches what PostgreSQL, SQL Server and Oracle default to.","risk":"Repeated reads inside one transaction can now return different rows. With READ COMMITTED, InnoDB refuses statement-based binary logging, so binlog_format must stay ROW (the default) or MIXED.","related":["innodb-deadlock-detect","sql-mode"],"faqs":[{"question":"What is the default value of transaction_isolation in MySQL?","answer":"REPEATABLE-READ. REPEATABLE-READ (MySQL 8.4)."},{"question":"Does changing transaction_isolation require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change transaction_isolation?","answer":"READ COMMITTED reduces gap-lock deadlocks in high-concurrency write workloads and matches what PostgreSQL, SQL Server and Oracle default to."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/transaction-isolation","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/mysql/wait-timeout","corpus":"sql-configuration","engine":"mysql","language":"en","title":"wait_timeout (MySQL)","description":"MySQL wait_timeout: Seconds a non-interactive connection may sit idle before the server closes it. Default: 28800 (8 hours).","body":{"engine":"mysql","slug":"wait-timeout","name":"wait_timeout","topic":"timeouts","summary":"Seconds a non-interactive connection may sit idle before the server closes it.","detail":"Interactive clients (the mysql CLI) get interactive_timeout instead. Pools that keep connections longer than this see 'MySQL server has gone away' or 'Lost connection'.","default":"28800 (8 hours)","default_note":"28800 seconds (MySQL 8.4).","range":"1 to 31536000 seconds","restart_required":false,"apply":"No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.","view":"SHOW GLOBAL VARIABLES LIKE 'wait_timeout';\n\nSELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME\nFROM performance_schema.variables_info\nWHERE VARIABLE_NAME = 'wait_timeout';","change":"SET SESSION wait_timeout = 600;   -- this connection\nSET GLOBAL wait_timeout = 600;    -- new connections, until restart\nSET PERSIST wait_timeout = 600;   -- new connections, and after restarts","when":"Lower it to clean up connections leaked by apps; then make the pool's max idle or lifetime shorter than the new value.","risk":"Too short breaks pools and long-running clients that sit idle between batches.","related":["interactive-timeout","max-connections"],"faqs":[{"question":"What is the default value of wait_timeout in MySQL?","answer":"28800 (8 hours). 28800 seconds (MySQL 8.4)."},{"question":"Does changing wait_timeout require a restart?","answer":"No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves."},{"question":"When should I change wait_timeout?","answer":"Lower it to clean up connections leaked by apps; then make the pool's max idle or lifetime shorter than the new value."}]},"source_url":"https://sqlly.app/sql-configuration/mysql/wait-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/audit-trail","corpus":"sql-configuration","engine":"oracle","language":"en","title":"audit_trail (Oracle)","description":"Oracle audit_trail: Where classic auditing writes its records: the database, operating system files, XML files, or nowhere. Default: DB.","body":{"engine":"oracle","slug":"audit-trail","name":"audit_trail","topic":"security","summary":"Where classic auditing writes its records: the database, operating system files, XML files, or nowhere.","detail":"DB stores rows in SYS.AUD$ and OS or XML write files under audit_file_dest, with the EXTENDED variants also capturing SQL text and bind values. From 23ai onward, unified auditing replaced traditional auditing entirely, so the value is kept for compatibility and no longer controls where records go.","default":"DB","default_note":"DB (Oracle 23ai/26ai); on 23ai and later the value is ignored because unified auditing is always on.","range":"NONE, DB, DB,EXTENDED, OS, XML, XML,EXTENDED","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER audit_trail\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'audit_trail';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'audit_trail';","change":"ALTER SYSTEM SET audit_trail = DB SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Only on releases older than 23ai: DB for centralized SYS.AUD$ records, OS or XML when rules require the trail outside the database. On 23ai and later, configure unified audit policies instead.","risk":"DB,EXTENDED records bind values, so passwords typed into statements land in the audit trail, and SYS.AUD$ grows inside the SYSTEM tablespace until someone manages it.","related":["remote-login-passwordfile"],"faqs":[{"question":"What is the default value of audit_trail in Oracle?","answer":"DB. DB (Oracle 23ai/26ai); on 23ai and later the value is ignored because unified auditing is always on."},{"question":"Does changing audit_trail require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change audit_trail?","answer":"Only on releases older than 23ai: DB for centralized SYS.AUD$ records, OS or XML when rules require the trail outside the database. On 23ai and later, configure unified audit policies instead."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/audit-trail","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/control-file-record-keep-time","corpus":"sql-configuration","engine":"oracle","language":"en","title":"control_file_record_keep_time (Oracle)","description":"Oracle control_file_record_keep_time: Days RMAN backup and archived log records stay in the control file before those slots are reused. Default: 7.","body":{"engine":"oracle","slug":"control-file-record-keep-time","name":"control_file_record_keep_time","topic":"maintenance","summary":"Days RMAN backup and archived log records stay in the control file before those slots are reused.","detail":"When RMAN uses the control file as its repository, records for backups, archived logs and data file copies live in fixed-size circular sections. Records older than this many days are the first overwritten as new backups arrive. 0 means slots are never reused, so the control file only grows.","default":"7","default_note":"7 days (Oracle 23ai/26ai).","range":"0 to 365 days","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER control_file_record_keep_time\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'control_file_record_keep_time';","change":"ALTER SYSTEM SET control_file_record_keep_time = 35 SCOPE=BOTH;","when":"Above the longest retention RMAN keeps, for example a 30-day recovery window plus margin, so the repository outlives the backups it describes.","risk":"Too low and RMAN forgets backups that are still on disk or tape, leaving them unusable through the repository; with a recovery catalog this matters much less.","related":["db-recovery-file-dest-size"],"faqs":[{"question":"What is the default value of control_file_record_keep_time in Oracle?","answer":"7. 7 days (Oracle 23ai/26ai)."},{"question":"Does changing control_file_record_keep_time require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change control_file_record_keep_time?","answer":"Above the longest retention RMAN keeps, for example a 30-day recovery window plus margin, so the repository outlives the backups it describes."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/control-file-record-keep-time","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/cursor-sharing","corpus":"sql-configuration","engine":"oracle","language":"en","title":"cursor_sharing (Oracle)","description":"Oracle cursor_sharing: Whether literals in SQL are replaced by bind variables so statements share cursors. Default: EXACT.","body":{"engine":"oracle","slug":"cursor-sharing","name":"cursor_sharing","topic":"optimizer","summary":"Whether literals in SQL are replaced by bind variables so statements share cursors.","detail":"FORCE turns WHERE id = 42 and WHERE id = 43 into one shared cursor, cutting hard parses for applications that do not use binds. SIMILAR is deprecated and no longer documented, though 23ai still accepts it.","default":"EXACT","default_note":"EXACT (Oracle 23ai/26ai).","range":"EXACT, FORCE","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER cursor_sharing\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'cursor_sharing';","change":"ALTER SESSION SET cursor_sharing = FORCE;   -- this session\n\nALTER SYSTEM SET cursor_sharing = FORCE SCOPE=BOTH;","when":"As a stopgap for applications that build SQL with literals and cause library cache contention, ideally per session or service.","risk":"Plans are shared across values with different selectivity (adaptive cursor sharing helps only partly), and the reported width of selected literals can change.","related":["session-cached-cursors","optimizer-mode","shared-pool-size"],"faqs":[{"question":"What is the default value of cursor_sharing in Oracle?","answer":"EXACT. EXACT (Oracle 23ai/26ai)."},{"question":"Does changing cursor_sharing require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change cursor_sharing?","answer":"As a stopgap for applications that build SQL with literals and cause library cache contention, ideally per session or service."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/cursor-sharing","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/db-block-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"db_block_size (Oracle)","description":"Oracle db_block_size: Size of a database block in bytes, fixed when the database is created. Default: 8192.","body":{"engine":"oracle","slug":"db-block-size","name":"db_block_size","topic":"io","summary":"Size of a database block in bytes, fixed when the database is created.","detail":"Every data file in the standard block size uses it. Tablespaces with other block sizes are possible but need matching db_nK_cache_size buffer caches.","default":"8192","default_note":"8192 (Oracle 23ai/26ai).","range":"2048, 4096, 8192, 16384, 32768 (platform-dependent)","restart_required":true,"apply":"Cannot be changed after the database is created; it would mean creating a new database and moving the data.","view":"SHOW PARAMETER db_block_size\n\nSELECT tablespace_name, block_size FROM dba_tablespaces;","change":"-- Not changeable. Choose it in DBCA or CREATE DATABASE, for example:\n-- DB_BLOCK_SIZE=8192 in the initialization file before CREATE DATABASE","when":"Only at database creation: 8KB suits nearly every workload; some data warehouses choose 16KB or 32KB.","risk":"Non-default block sizes are less tested and can complicate buffer cache sizing.","related":["filesystemio-options","db-cache-size"],"faqs":[{"question":"What is the default value of db_block_size in Oracle?","answer":"8192. 8192 (Oracle 23ai/26ai)."},{"question":"Does changing db_block_size require a restart?","answer":"Yes. Cannot be changed after the database is created; it would mean creating a new database and moving the data."},{"question":"When should I change db_block_size?","answer":"Only at database creation: 8KB suits nearly every workload; some data warehouses choose 16KB or 32KB."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/db-block-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/db-cache-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"db_cache_size (Oracle)","description":"Oracle db_cache_size: Minimum size of the default buffer pool, the cache for blocks of the standard block size. Default: 0.","body":{"engine":"oracle","slug":"db-cache-size","name":"db_cache_size","topic":"memory","summary":"Minimum size of the default buffer pool, the cache for blocks of the standard block size.","detail":"With sga_target or memory_target set, an explicit value is a floor for automatic tuning. The KEEP and RECYCLE pools and the db_nK_cache_size caches for non-default block sizes sit outside it and are never auto-tuned. Inside a PDB it reserves a minimum buffer cache for that PDB, below the root's value.","default":"0","default_note":"0, so ASMM or AMM sizes the cache when sga_target or memory_target is set (Oracle 23ai/26ai).","range":"0, or a value inside the SGA up to sga_max_size","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER db_cache_size\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'db_cache_size';","change":"ALTER SYSTEM SET db_cache_size = 4G SCOPE=BOTH;","when":"When V$DB_CACHE_ADVICE shows a larger cache would cut physical reads and automatic sizing keeps giving the memory away, or to pin a minimum for a PDB.","risk":"A floor sized on one busy day can strand SGA the shared pool needs during a parse spike, so keep part of the cache auto-tuned.","related":["sga-target","db-block-size","use-large-pages"],"faqs":[{"question":"What is the default value of db_cache_size in Oracle?","answer":"0. 0, so ASMM or AMM sizes the cache when sga_target or memory_target is set (Oracle 23ai/26ai)."},{"question":"Does changing db_cache_size require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change db_cache_size?","answer":"When V$DB_CACHE_ADVICE shows a larger cache would cut physical reads and automatic sizing keeps giving the memory away, or to pin a minimum for a PDB."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/db-cache-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/db-files","corpus":"sql-configuration","engine":"oracle","language":"en","title":"db_files (Oracle)","description":"Oracle db_files: Maximum number of data files the database can hold, counted database-wide rather than per instance. Default: 200.","body":{"engine":"oracle","slug":"db-files","name":"db_files","topic":"io","summary":"Maximum number of data files the database can hold, counted database-wide rather than per instance.","detail":"Raising it takes effect at the next startup and grows the control file to track the extra records. Every instance of a RAC database must run the same value. A smallfile data file also tops out at about four million blocks, so with 8KB blocks one file holds roughly 32GB and very large databases need many files or bigfile tablespaces.","default":"200","default_note":"200 (Oracle 23ai/26ai).","range":"1 to an OS-dependent maximum","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER db_files\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'db_files';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'db_files';","change":"ALTER SYSTEM SET db_files = 2000 SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Before a migration, import or consolidation that would push the count in CDB_DATA_FILES close to the current limit.","risk":"Creating one file too many fails with ORA-00059, and the fix, raising the parameter, needs a restart; OS open-file limits can bite below the setting too.","related":["db-block-size"],"faqs":[{"question":"What is the default value of db_files in Oracle?","answer":"200. 200 (Oracle 23ai/26ai)."},{"question":"Does changing db_files require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change db_files?","answer":"Before a migration, import or consolidation that would push the count in CDB_DATA_FILES close to the current limit."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/db-files","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/db-recovery-file-dest-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"db_recovery_file_dest_size (Oracle)","description":"Oracle db_recovery_file_dest_size: Space limit for the fast recovery area (archived logs, flashback logs, RMAN backups). Default: 0.","body":{"engine":"oracle","slug":"db-recovery-file-dest-size","name":"db_recovery_file_dest_size","topic":"durability","summary":"Space limit for the fast recovery area (archived logs, flashback logs, RMAN backups).","detail":"Used together with db_recovery_file_dest. When the area fills and nothing can be deleted, archiving stops and the database hangs on log switches.","default":"0","default_note":"0, no recovery area (Oracle 23ai/26ai).","range":"0 (unset, the default); once set, at least 1 byte, up to the space available","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER db_recovery_file_dest_size\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'db_recovery_file_dest_size';","change":"ALTER SYSTEM SET db_recovery_file_dest_size = 200G SCOPE=BOTH;","when":"When you enable ARCHIVELOG mode with a fast recovery area. Size it for the backup and archivelog retention policy.","risk":"Too small stalls the database with ORA-19809 / ORA-00257 when archived logs cannot be written.","related":["undo-retention","control-file-record-keep-time"],"faqs":[{"question":"What is the default value of db_recovery_file_dest_size in Oracle?","answer":"0. 0, no recovery area (Oracle 23ai/26ai)."},{"question":"Does changing db_recovery_file_dest_size require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change db_recovery_file_dest_size?","answer":"When you enable ARCHIVELOG mode with a fast recovery area. Size it for the backup and archivelog retention policy."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/db-recovery-file-dest-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/db-writer-processes","corpus":"sql-configuration","engine":"oracle","language":"en","title":"db_writer_processes (Oracle)","description":"Oracle db_writer_processes: Number of database writer (DBWn) processes. Default: Max(1, CPU_COUNT / 8).","body":{"engine":"oracle","slug":"db-writer-processes","name":"db_writer_processes","topic":"io","summary":"Number of database writer (DBWn) processes.","detail":"DBWn writes dirty buffers to the data files. On systems with asynchronous I/O, one writer per eight CPUs is plenty.","default":"Max(1, CPU_COUNT / 8)","default_note":"Derived as the larger of 1 and CPU_COUNT / 8 (Oracle 23ai/26ai); 1 on Oracle Free.","range":"1 to 100","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER db_writer_processes\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'db_writer_processes';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'db_writer_processes';","change":"ALTER SYSTEM SET db_writer_processes = 4 SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"When 'free buffer waits' appear and the I/O subsystem is not the bottleneck, or asynchronous I/O is unavailable.","risk":"Extra writers without I/O capacity do not help, and each one adds scheduling overhead; check 'free buffer waits' and disk latency before raising, because slow storage is the usual real cause.","related":["filesystemio-options","fast-start-mttr-target"],"faqs":[{"question":"What is the default value of db_writer_processes in Oracle?","answer":"Max(1, CPU_COUNT / 8). Derived as the larger of 1 and CPU_COUNT / 8 (Oracle 23ai/26ai); 1 on Oracle Free."},{"question":"Does changing db_writer_processes require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change db_writer_processes?","answer":"When 'free buffer waits' appear and the I/O subsystem is not the bottleneck, or asynchronous I/O is unavailable."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/db-writer-processes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/ddl-lock-timeout","corpus":"sql-configuration","engine":"oracle","language":"en","title":"ddl_lock_timeout (Oracle)","description":"Oracle ddl_lock_timeout: Seconds a DDL statement waits for a DML lock before failing; 0 fails at once. Default: 0.","body":{"engine":"oracle","slug":"ddl-lock-timeout","name":"ddl_lock_timeout","topic":"timeouts","summary":"Seconds a DDL statement waits for a DML lock before failing; 0 fails at once.","detail":"Without it, DDL on a busy table fails immediately with ORA-00054 (resource busy and acquire with NOWAIT specified).","default":"0","default_note":"0 (Oracle 23ai/26ai).","range":"0 to 1000000 seconds","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER ddl_lock_timeout\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'ddl_lock_timeout';","change":"ALTER SESSION SET ddl_lock_timeout = 30;   -- this session\n\nALTER SYSTEM SET ddl_lock_timeout = 30 SCOPE=BOTH;","when":"Set it in deployment sessions so DDL waits briefly for in-flight transactions instead of failing.","risk":"While DDL waits, it can queue behind and in front of other sessions' locks; keep the value short.","related":["max-idle-time"],"faqs":[{"question":"What is the default value of ddl_lock_timeout in Oracle?","answer":"0. 0 (Oracle 23ai/26ai)."},{"question":"Does changing ddl_lock_timeout require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change ddl_lock_timeout?","answer":"Set it in deployment sessions so DDL waits briefly for in-flight transactions instead of failing."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/ddl-lock-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/fast-start-mttr-target","corpus":"sql-configuration","engine":"oracle","language":"en","title":"fast_start_mttr_target (Oracle)","description":"Oracle fast_start_mttr_target: Target crash-recovery time in seconds; Oracle paces incremental checkpoints to meet it. Default: 0.","body":{"engine":"oracle","slug":"fast-start-mttr-target","name":"fast_start_mttr_target","topic":"checkpoints","summary":"Target crash-recovery time in seconds; Oracle paces incremental checkpoints to meet it.","detail":"With a non-zero value, DBWn writes dirty buffers often enough that instance recovery should finish within the target. V$INSTANCE_RECOVERY shows the estimate and the advisory.","default":"0","default_note":"0 (Oracle 23ai/26ai).","range":"0 to 3600 seconds","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER fast_start_mttr_target\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'fast_start_mttr_target';","change":"ALTER SYSTEM SET fast_start_mttr_target = 60 SCOPE=BOTH;","when":"Set it when instance recovery time after a crash must be bounded, for example under an SLA.","risk":"Low targets increase write I/O during normal operation, and recovery always does fixed work such as reading the control file and redo, so targets under about half a minute are rarely met; V$INSTANCE_RECOVERY.TARGET_MTTR shows what is realistic.","related":["log-buffer","db-writer-processes","undo-retention"],"faqs":[{"question":"What is the default value of fast_start_mttr_target in Oracle?","answer":"0. 0 (Oracle 23ai/26ai)."},{"question":"Does changing fast_start_mttr_target require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change fast_start_mttr_target?","answer":"Set it when instance recovery time after a crash must be bounded, for example under an SLA."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/fast-start-mttr-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/filesystemio-options","corpus":"sql-configuration","engine":"oracle","language":"en","title":"filesystemio_options (Oracle)","description":"Oracle filesystemio_options: I/O mode for data files on file systems: asynchronous, direct, both or neither. Default: Platform-dependent.","body":{"engine":"oracle","slug":"filesystemio-options","name":"filesystemio_options","topic":"io","summary":"I/O mode for data files on file systems: asynchronous, direct, both or neither.","detail":"SETALL enables both direct and asynchronous I/O, which avoids double caching in the OS page cache and lets DBWn issue writes in parallel.","default":"Platform-dependent","default_note":"Platform-dependent (Oracle 23ai/26ai). On Linux, V$PARAMETER.DEFAULT_VALUE shows asynch, while Oracle Free reports a running value of none.","range":"ASYNCH, DIRECTIO, SETALL, NONE","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER filesystemio_options\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'filesystemio_options';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'filesystemio_options';","change":"ALTER SYSTEM SET filesystemio_options = SETALL SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Set SETALL on Linux file-system storage (not ASM, which does its own direct I/O) after checking the file system supports it.","risk":"With direct I/O, the SGA must be large enough because the OS cache no longer helps.","related":["db-writer-processes"],"faqs":[{"question":"What is the default value of filesystemio_options in Oracle?","answer":"Platform-dependent. Platform-dependent (Oracle 23ai/26ai). On Linux, V$PARAMETER.DEFAULT_VALUE shows asynch, while Oracle Free reports a running value of none."},{"question":"Does changing filesystemio_options require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change filesystemio_options?","answer":"Set SETALL on Linux file-system storage (not ASM, which does its own direct I/O) after checking the file system supports it."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/filesystemio-options","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/job-queue-processes","corpus":"sql-configuration","engine":"oracle","language":"en","title":"job_queue_processes (Oracle)","description":"Oracle job_queue_processes: Maximum job worker processes for DBMS_SCHEDULER and DBMS_JOB jobs. Default: 4000.","body":{"engine":"oracle","slug":"job-queue-processes","name":"job_queue_processes","topic":"maintenance","summary":"Maximum job worker processes for DBMS_SCHEDULER and DBMS_JOB jobs.","detail":"0 stops job execution, including materialized view refreshes run as jobs and other scheduled maintenance.","default":"4000","default_note":"4000 (Oracle 23ai/26ai); Oracle Free sets it to 1.","range":"0 to 4000","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER job_queue_processes\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'job_queue_processes';","change":"ALTER SYSTEM SET job_queue_processes = 20 SCOPE=BOTH;","when":"Lower it to cap concurrent jobs on a busy system; set 0 temporarily during maintenance or upgrades.","risk":"0 silently stops scheduled jobs, including statistics gathering jobs controlled through the scheduler.","related":["statistics-level"],"faqs":[{"question":"What is the default value of job_queue_processes in Oracle?","answer":"4000. 4000 (Oracle 23ai/26ai); Oracle Free sets it to 1."},{"question":"Does changing job_queue_processes require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change job_queue_processes?","answer":"Lower it to cap concurrent jobs on a busy system; set 0 temporarily during maintenance or upgrades."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/job-queue-processes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/log-buffer","corpus":"sql-configuration","engine":"oracle","language":"en","title":"log_buffer (Oracle)","description":"Oracle log_buffer: Size of the redo log buffer in the SGA. Default: Derived.","body":{"engine":"oracle","slug":"log-buffer","name":"log_buffer","topic":"durability","summary":"Size of the redo log buffer in the SGA.","detail":"LGWR writes it to the online redo logs at commit, every three seconds, and when it is a third full. Waits on 'log buffer space' mean it is too small or LGWR is slow.","default":"Derived","default_note":"Derived at startup from the SGA size and CPU count (Oracle 23ai/26ai); about 4MB on Oracle Free.","range":"Platform-dependent","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER log_buffer\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'log_buffer';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'log_buffer';","change":"ALTER SYSTEM SET log_buffer = 64M SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"When 'log buffer space' waits are significant in AWR. Check redo log disk latency first.","risk":"Larger buffers do not fix slow redo disks, and Oracle rounds the value up to internal allocation units, so V$PARAMETER shows more than you set; persistent 'log buffer space' waits usually mean LGWR cannot drain it fast enough, and the fix is faster redo storage more often than a bigger buffer.","related":["fast-start-mttr-target"],"faqs":[{"question":"What is the default value of log_buffer in Oracle?","answer":"Derived. Derived at startup from the SGA size and CPU count (Oracle 23ai/26ai); about 4MB on Oracle Free."},{"question":"Does changing log_buffer require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change log_buffer?","answer":"When 'log buffer space' waits are significant in AWR. Check redo log disk latency first."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/log-buffer","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/max-idle-time","corpus":"sql-configuration","engine":"oracle","language":"en","title":"max_idle_time (Oracle)","description":"Oracle max_idle_time: Minutes a session may be idle before it is terminated; 0 means no limit. Default: 0 (no limit).","body":{"engine":"oracle","slug":"max-idle-time","name":"max_idle_time","topic":"timeouts","summary":"Minutes a session may be idle before it is terminated; 0 means no limit.","detail":"Applies to every session. max_idle_blocker_time is a variant that only terminates idle sessions holding resources other sessions are waiting for.","default":"0 (no limit)","default_note":"0 (Oracle 23ai/26ai).","range":"0 or more minutes","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER max_idle_time\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'max_idle_time';","change":"ALTER SYSTEM SET max_idle_time = 60 SCOPE=BOTH;","when":"On databases where abandoned client sessions accumulate. Prefer max_idle_blocker_time if the goal is to clear blockers.","risk":"Pooled connections idle longer than the limit are killed and the pool must detect it.","related":["ddl-lock-timeout"],"faqs":[{"question":"What is the default value of max_idle_time in Oracle?","answer":"0 (no limit). 0 (Oracle 23ai/26ai)."},{"question":"Does changing max_idle_time require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change max_idle_time?","answer":"On databases where abandoned client sessions accumulate. Prefer max_idle_blocker_time if the goal is to clear blockers."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/max-idle-time","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/max-string-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"max_string_size (Oracle)","description":"Oracle max_string_size: Cap on VARCHAR2, NVARCHAR2 and RAW column sizes: 4000 bytes STANDARD or 32767 bytes EXTENDED. Default: STANDARD.","body":{"engine":"oracle","slug":"max-string-size","name":"max_string_size","topic":"behavior","summary":"Cap on VARCHAR2, NVARCHAR2 and RAW column sizes: 4000 bytes STANDARD or 32767 bytes EXTENDED.","detail":"EXTENDED requires compatible 12.0.0 or higher and a one-way procedure: restart with the new value, run utl32k.sql, restart again. Inside a PDB it can be raised for that PDB alone. Index key limits still follow the block size, so indexing an extended column beyond the key limit fails with ORA-01450.","default":"STANDARD","default_note":"STANDARD (Oracle 23ai/26ai).","range":"STANDARD, EXTENDED","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER max_string_size\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'max_string_size';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'max_string_size';","change":"ALTER SYSTEM SET max_string_size = EXTENDED SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"When applications must store more than 4000 bytes per column and a CLOB does not fit the data model or the tooling.","risk":"Going back to STANDARD means shrinking every extended column first, and clients or drivers that assume 4000 bytes can truncate or reject longer values.","related":["db-block-size"],"faqs":[{"question":"What is the default value of max_string_size in Oracle?","answer":"STANDARD. STANDARD (Oracle 23ai/26ai)."},{"question":"Does changing max_string_size require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change max_string_size?","answer":"When applications must store more than 4000 bytes per column and a CLOB does not fit the data model or the tooling."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/max-string-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/memory-max-target","corpus":"sql-configuration","engine":"oracle","language":"en","title":"memory_max_target (Oracle)","description":"Oracle memory_max_target: Hard ceiling on memory_target under AMM: the most SGA plus PGA memory the instance may grow to without a restart. Default: 0.","body":{"engine":"oracle","slug":"memory-max-target","name":"memory_max_target","topic":"memory","summary":"Hard ceiling on memory_target under AMM: the most SGA plus PGA memory the instance may grow to without a restart.","detail":"Setting it above memory_target leaves room to raise memory_target online later. With both at 0, AMM is off. On Linux the value must fit in /dev/shm or the instance fails with ORA-00845, and ORA-00837 reports a memory_target set above this ceiling.","default":"0","default_note":"0, which makes memory_target its own ceiling (Oracle 23ai/26ai).","range":"0, or a platform-dependent minimum up to physical memory","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER memory_max_target\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'memory_max_target';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'memory_max_target';","change":"ALTER SYSTEM SET memory_max_target = 6G SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Before enabling AMM, because memory_target cannot rise above it, and to keep headroom for online growth afterwards.","risk":"It reserves nothing on its own, but a ceiling below what you actually plan to use kills the headroom, and AMM still cannot use HugePages.","related":["memory-target","sga-max-size"],"faqs":[{"question":"What is the default value of memory_max_target in Oracle?","answer":"0. 0, which makes memory_target its own ceiling (Oracle 23ai/26ai)."},{"question":"Does changing memory_max_target require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change memory_max_target?","answer":"Before enabling AMM, because memory_target cannot rise above it, and to keep headroom for online growth afterwards."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/memory-max-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/memory-target","corpus":"sql-configuration","engine":"oracle","language":"en","title":"memory_target (Oracle)","description":"Oracle memory_target: Total memory for SGA and PGA together under Automatic Memory Management (AMM); 0 disables AMM. Default: 0 (AMM off).","body":{"engine":"oracle","slug":"memory-target","name":"memory_target","topic":"memory","summary":"Total memory for SGA and PGA together under Automatic Memory Management (AMM); 0 disables AMM.","detail":"With AMM, Oracle moves memory between SGA and PGA as the workload shifts. It can be changed online only up to memory_max_target, which is static, so turning AMM on from 0 means setting memory_max_target and memory_target with SCOPE=SPFILE and restarting (otherwise ORA-00837). On Linux, /dev/shm must be at least memory_max_target.","default":"0 (AMM off)","default_note":"0 (Oracle 23ai/26ai).","range":"0, or 152MB up to memory_max_target","restart_required":false,"apply":"No restart to resize it while AMM is on, up to memory_max_target. Turning AMM on from 0 needs memory_max_target and memory_target set with SCOPE=SPFILE and a restart. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER memory_target\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'memory_target';","change":"ALTER SYSTEM SET memory_target = 3G SCOPE=BOTH;","when":"On small or test systems where simplicity matters more than the last bit of performance. On Linux production servers most DBAs use sga_target plus pga_aggregate_target instead.","risk":"AMM cannot use Linux HugePages, so a large SGA pays for small-page tables. It is not available on some platforms.","related":["memory-max-target","sga-target","pga-aggregate-target","use-large-pages"],"faqs":[{"question":"What is the default value of memory_target in Oracle?","answer":"0 (AMM off). 0 (Oracle 23ai/26ai)."},{"question":"Does changing memory_target require a restart?","answer":"No. No restart to resize it while AMM is on, up to memory_max_target. Turning AMM on from 0 needs memory_max_target and memory_target set with SCOPE=SPFILE and a restart. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change memory_target?","answer":"On small or test systems where simplicity matters more than the last bit of performance. On Linux production servers most DBAs use sga_target plus pga_aggregate_target instead."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/memory-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/open-cursors","corpus":"sql-configuration","engine":"oracle","language":"en","title":"open_cursors (Oracle)","description":"Oracle open_cursors: Maximum open cursors per session. Default: 50.","body":{"engine":"oracle","slug":"open-cursors","name":"open_cursors","topic":"connections","summary":"Maximum open cursors per session.","detail":"A per-session limit; memory is used only for cursors actually open. Exceeding it raises ORA-01000.","default":"50","default_note":"50 (Oracle 23ai/26ai); DBCA-created databases, Oracle Free included, set 300.","range":"0 to 65535","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER open_cursors\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'open_cursors';","change":"ALTER SYSTEM SET open_cursors = 1000 SCOPE=BOTH;","when":"When applications hit ORA-01000. Also check for cursor leaks (V$OPEN_CURSOR grouped by SQL_ID).","risk":"A high limit hides cursor leaks until memory runs short, so treat a raised value as a workaround: find the leak with V$OPEN_CURSOR grouped by SQL_ID while the limit buys time.","related":["session-cached-cursors","processes","shared-pool-size"],"faqs":[{"question":"What is the default value of open_cursors in Oracle?","answer":"50. 50 (Oracle 23ai/26ai); DBCA-created databases, Oracle Free included, set 300."},{"question":"Does changing open_cursors require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change open_cursors?","answer":"When applications hit ORA-01000. Also check for cursor leaks (V$OPEN_CURSOR grouped by SQL_ID)."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/open-cursors","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/optimizer-adaptive-plans","corpus":"sql-configuration","engine":"oracle","language":"en","title":"optimizer_adaptive_plans (Oracle)","description":"Oracle optimizer_adaptive_plans: Allow plans to switch join methods or parallel distribution at run time. Default: TRUE.","body":{"engine":"oracle","slug":"optimizer-adaptive-plans","name":"optimizer_adaptive_plans","topic":"optimizer","summary":"Allow plans to switch join methods or parallel distribution at run time.","detail":"The optimizer can postpone the final join method choice until it sees actual row counts from the first execution.","default":"TRUE","default_note":"TRUE since Oracle 12.2 (where it replaced optimizer_adaptive_features). Same in 23ai.","range":"TRUE, FALSE","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER optimizer_adaptive_plans\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'optimizer_adaptive_plans';","change":"ALTER SESSION SET optimizer_adaptive_plans = FALSE;   -- this session\n\nALTER SYSTEM SET optimizer_adaptive_plans = FALSE SCOPE=BOTH;","when":"Rarely turned off; disable per statement with a hint if one plan flips badly.","risk":"Turning it off loses runtime correction of bad cardinality estimates.","related":["optimizer-adaptive-statistics","optimizer-mode","optimizer-features-enable"],"faqs":[{"question":"What is the default value of optimizer_adaptive_plans in Oracle?","answer":"TRUE. TRUE since Oracle 12.2 (where it replaced optimizer_adaptive_features). Same in 23ai."},{"question":"Does changing optimizer_adaptive_plans require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change optimizer_adaptive_plans?","answer":"Rarely turned off; disable per statement with a hint if one plan flips badly."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/optimizer-adaptive-plans","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/optimizer-adaptive-statistics","corpus":"sql-configuration","engine":"oracle","language":"en","title":"optimizer_adaptive_statistics (Oracle)","description":"Oracle optimizer_adaptive_statistics: Allow SQL plan directives, statistics feedback and dynamic sampling triggered by them. Default: FALSE.","body":{"engine":"oracle","slug":"optimizer-adaptive-statistics","name":"optimizer_adaptive_statistics","topic":"optimizer","summary":"Allow SQL plan directives, statistics feedback and dynamic sampling triggered by them.","detail":"In 12.1 these were on by default and caused excessive hard parsing and dynamic sampling on some systems, so 12.2 made them off by default.","default":"FALSE","default_note":"FALSE since Oracle 12.2. Same in 23ai.","range":"TRUE, FALSE","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER optimizer_adaptive_statistics\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'optimizer_adaptive_statistics';","change":"ALTER SESSION SET optimizer_adaptive_statistics = TRUE;   -- this session\n\nALTER SYSTEM SET optimizer_adaptive_statistics = TRUE SCOPE=BOTH;","when":"Analytic workloads with complex predicates where estimates are poor and parse time is not an issue.","risk":"More hard parses and recursive dynamic-sampling queries follow when SQL plan directives fire, and on OLTP systems the sampling can cost more than better estimates save; 12.2 turned it off by default for exactly that reason, so enable it deliberately and watch parse counts.","related":["optimizer-adaptive-plans"],"faqs":[{"question":"What is the default value of optimizer_adaptive_statistics in Oracle?","answer":"FALSE. FALSE since Oracle 12.2. Same in 23ai."},{"question":"Does changing optimizer_adaptive_statistics require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change optimizer_adaptive_statistics?","answer":"Analytic workloads with complex predicates where estimates are poor and parse time is not an issue."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/optimizer-adaptive-statistics","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/optimizer-features-enable","corpus":"sql-configuration","engine":"oracle","language":"en","title":"optimizer_features_enable (Oracle)","description":"Oracle optimizer_features_enable: Umbrella switch that pins the optimizer's behavior and defaults to a named Oracle release. Default: Set at creation.","body":{"engine":"oracle","slug":"optimizer-features-enable","name":"optimizer_features_enable","topic":"optimizer","summary":"Umbrella switch that pins the optimizer's behavior and defaults to a named Oracle release.","detail":"Values are release identifiers such as 11.2.0.4, 19.1.0 or 23.1.0, each enabling the optimizer features of that release. Changing it invalidates existing cursors, so plans can flip in either direction; per session it is the standard way to compare an upgraded database against its old behavior.","default":"Set at creation","default_note":"The release the database was created with: 23.1.0 on a 23ai-created database (Oracle 23ai/26ai).","range":"Valid release identifiers, 8.0.0 up to the current release","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER optimizer_features_enable\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'optimizer_features_enable';","change":"ALTER SESSION SET optimizer_features_enable = 19.1.0;   -- this session\n\nALTER SYSTEM SET optimizer_features_enable = 19.1.0 SCOPE=BOTH;","when":"After an upgrade whose plans regressed, per session or per service, while baselines and SQL plan management catch up.","risk":"A value pinned years back hides every fix and better plan since then, and mixed values across sessions make plans hard to compare or reproduce.","related":["optimizer-mode","optimizer-adaptive-plans"],"faqs":[{"question":"What is the default value of optimizer_features_enable in Oracle?","answer":"Set at creation. The release the database was created with: 23.1.0 on a 23ai-created database (Oracle 23ai/26ai)."},{"question":"Does changing optimizer_features_enable require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change optimizer_features_enable?","answer":"After an upgrade whose plans regressed, per session or per service, while baselines and SQL plan management catch up."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/optimizer-features-enable","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/optimizer-mode","corpus":"sql-configuration","engine":"oracle","language":"en","title":"optimizer_mode (Oracle)","description":"Oracle optimizer_mode: Optimizer goal: total throughput (ALL_ROWS) or fastest first rows. Default: ALL_ROWS.","body":{"engine":"oracle","slug":"optimizer-mode","name":"optimizer_mode","topic":"optimizer","summary":"Optimizer goal: total throughput (ALL_ROWS) or fastest first rows.","detail":"FIRST_ROWS_n optimizes for returning the first n rows quickly (n = 1, 10, 100, 1000), which favors nested loops and index access.","default":"ALL_ROWS","default_note":"ALL_ROWS (Oracle 23ai/26ai).","range":"ALL_ROWS, FIRST_ROWS_1, FIRST_ROWS_10, FIRST_ROWS_100, FIRST_ROWS_1000, FIRST_ROWS","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER optimizer_mode\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'optimizer_mode';","change":"ALTER SESSION SET optimizer_mode = FIRST_ROWS_10;   -- this session\n\nALTER SYSTEM SET optimizer_mode = FIRST_ROWS_10 SCOPE=BOTH;","when":"Per session for interactive applications that show the first page of results; leave the instance on ALL_ROWS.","risk":"Instance-wide FIRST_ROWS can make batch and reporting plans much slower.","related":["optimizer-adaptive-plans","cursor-sharing"],"faqs":[{"question":"What is the default value of optimizer_mode in Oracle?","answer":"ALL_ROWS. ALL_ROWS (Oracle 23ai/26ai)."},{"question":"Does changing optimizer_mode require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change optimizer_mode?","answer":"Per session for interactive applications that show the first page of results; leave the instance on ALL_ROWS."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/optimizer-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/parallel-degree-policy","corpus":"sql-configuration","engine":"oracle","language":"en","title":"parallel_degree_policy (Oracle)","description":"Oracle parallel_degree_policy: Whether Oracle picks the degree of parallelism automatically. Default: MANUAL.","body":{"engine":"oracle","slug":"parallel-degree-policy","name":"parallel_degree_policy","topic":"parallelism","summary":"Whether Oracle picks the degree of parallelism automatically.","detail":"MANUAL uses table and hint DOP only. LIMITED applies automatic DOP to tables decorated with PARALLEL. AUTO adds automatic DOP for all statements, parallel statement queuing and in-memory parallel execution.","default":"MANUAL","default_note":"MANUAL (Oracle 23ai/26ai).","range":"MANUAL, LIMITED, AUTO, ADAPTIVE","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER parallel_degree_policy\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'parallel_degree_policy';","change":"ALTER SESSION SET parallel_degree_policy = AUTO;   -- this session\n\nALTER SYSTEM SET parallel_degree_policy = AUTO SCOPE=BOTH;","when":"Data warehouses where tuning DOP per table is impractical; test with parallel_min_time_threshold.","risk":"AUTO can parallelize queries that ran serially before and change resource usage system-wide.","related":["parallel-max-servers"],"faqs":[{"question":"What is the default value of parallel_degree_policy in Oracle?","answer":"MANUAL. MANUAL (Oracle 23ai/26ai)."},{"question":"Does changing parallel_degree_policy require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change parallel_degree_policy?","answer":"Data warehouses where tuning DOP per table is impractical; test with parallel_min_time_threshold."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/parallel-degree-policy","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/parallel-max-servers","corpus":"sql-configuration","engine":"oracle","language":"en","title":"parallel_max_servers (Oracle)","description":"Oracle parallel_max_servers: Maximum parallel execution server processes for the instance. Default: Derived.","body":{"engine":"oracle","slug":"parallel-max-servers","name":"parallel_max_servers","topic":"parallelism","summary":"Maximum parallel execution server processes for the instance.","detail":"When all are busy, parallel statements run with fewer servers or, with parallel_degree_policy = AUTO, wait in the statement queue.","default":"Derived","default_note":"Derived from CPU_COUNT, PARALLEL_THREADS_PER_CPU and memory settings (Oracle 23ai/26ai). Oracle Free limits CPU_COUNT to 2 and reports parallel_max_servers = 1.","range":"0 to 32767","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER parallel_max_servers\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'parallel_max_servers';","change":"ALTER SYSTEM SET parallel_max_servers = 64 SCOPE=BOTH;","when":"Lower it on mixed workloads where parallel queries starve OLTP; raise it on data warehouses with spare CPU.","risk":"Each server is a process with its own PGA and the ceiling applies per instance, so on RAC the total multiplies by node count; a high limit on a small host lets a handful of parallel statements take most of the memory and CPU.","related":["parallel-degree-policy","processes"],"faqs":[{"question":"What is the default value of parallel_max_servers in Oracle?","answer":"Derived. Derived from CPU_COUNT, PARALLEL_THREADS_PER_CPU and memory settings (Oracle 23ai/26ai). Oracle Free limits CPU_COUNT to 2 and reports parallel_max_servers = 1."},{"question":"Does changing parallel_max_servers require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change parallel_max_servers?","answer":"Lower it on mixed workloads where parallel queries starve OLTP; raise it on data warehouses with spare CPU."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/parallel-max-servers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/pga-aggregate-limit","corpus":"sql-configuration","engine":"oracle","language":"en","title":"pga_aggregate_limit (Oracle)","description":"Oracle pga_aggregate_limit: Hard limit on total PGA; past it, sessions using the most untunable memory are terminated.","body":{"engine":"oracle","slug":"pga-aggregate-limit","name":"pga_aggregate_limit","topic":"memory","summary":"Hard limit on total PGA; past it, sessions using the most untunable memory are terminated.","detail":"Added in Oracle 12c. When the limit is exceeded, Oracle aborts the calls (or terminates the sessions) of the largest untunable PGA consumers with ORA-04036. 0 removes the limit.","default":"Max(2GB, 2 x target, 3MB x processes)","default_note":"The greater of 2GB, 200% of pga_aggregate_target, and 3MB x processes, capped at 120% of physical memory minus the SGA (Oracle 23ai/26ai). 2GB on Oracle Free.","range":"0, or at least the default formula's minimum","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER pga_aggregate_limit\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'pga_aggregate_limit';","change":"ALTER SYSTEM SET pga_aggregate_limit = 8G SCOPE=BOTH;","when":"Raise it when legitimate batch jobs fail with ORA-04036; lower it only to protect a shared host.","risk":"0 lets a runaway PL/SQL collection use all memory and swap the server.","related":["pga-aggregate-target","processes"],"faqs":[{"question":"What is the default value of pga_aggregate_limit in Oracle?","answer":"Max(2GB, 2 x target, 3MB x processes). The greater of 2GB, 200% of pga_aggregate_target, and 3MB x processes, capped at 120% of physical memory minus the SGA (Oracle 23ai/26ai). 2GB on Oracle Free."},{"question":"Does changing pga_aggregate_limit require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change pga_aggregate_limit?","answer":"Raise it when legitimate batch jobs fail with ORA-04036; lower it only to protect a shared host."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/pga-aggregate-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/pga-aggregate-target","corpus":"sql-configuration","engine":"oracle","language":"en","title":"pga_aggregate_target (Oracle)","description":"Oracle pga_aggregate_target: Target total memory for all sessions' private work areas (sorts, hash joins, bitmap merges). Default: 10MB or 20% of SGA.","body":{"engine":"oracle","slug":"pga-aggregate-target","name":"pga_aggregate_target","topic":"memory","summary":"Target total memory for all sessions' private work areas (sorts, hash joins, bitmap merges).","detail":"A target, not a limit: Oracle sizes each work area so the total stays near it and spills to temp when it cannot. V$PGA_TARGET_ADVICE estimates the effect of other sizes.","default":"10MB or 20% of SGA","default_note":"10MB or 20% of the SGA, whichever is greater (Oracle 23ai/26ai). Oracle Free sets 512MB. Inside a PDB it must be smaller than the root's value.","range":"10MB up to 4096GB minus 1","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER pga_aggregate_target\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'pga_aggregate_target';","change":"ALTER SYSTEM SET pga_aggregate_target = 2G SCOPE=BOTH;","when":"When V$SQL_WORKAREA_HISTOGRAM shows many one-pass or multi-pass executions, or temp spills dominate reports.","risk":"Too large lets PGA grow past physical memory before pga_aggregate_limit stops it.","related":["pga-aggregate-limit","sga-target"],"faqs":[{"question":"What is the default value of pga_aggregate_target in Oracle?","answer":"10MB or 20% of SGA. 10MB or 20% of the SGA, whichever is greater (Oracle 23ai/26ai). Oracle Free sets 512MB. Inside a PDB it must be smaller than the root's value."},{"question":"Does changing pga_aggregate_target require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change pga_aggregate_target?","answer":"When V$SQL_WORKAREA_HISTOGRAM shows many one-pass or multi-pass executions, or temp spills dominate reports."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/pga-aggregate-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/processes","corpus":"sql-configuration","engine":"oracle","language":"en","title":"processes (Oracle)","description":"Oracle processes: Maximum operating system processes that can connect to the instance, background processes included. Default: Set at creation.","body":{"engine":"oracle","slug":"processes","name":"processes","topic":"connections","summary":"Maximum operating system processes that can connect to the instance, background processes included.","detail":"Sizes many other structures: sessions, transactions and pga_aggregate_limit derive from it. When the limit is reached, new connections fail with ORA-00020.","default":"Set at creation","default_note":"No useful fixed default: DBCA writes a value into the SPFILE; Oracle Free has 200. V$PARAMETER reports ISSYS_MODIFIABLE = IMMEDIATE, but ALTER SYSTEM rejects SCOPE=MEMORY with ORA-02095 on Oracle 23ai/26ai: it is static.","range":"6 to an OS-dependent maximum","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER processes\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'processes';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'processes';","change":"ALTER SYSTEM SET processes = 1000 SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"When the application or connection pools need more sessions than processes allows; check V$RESOURCE_LIMIT for max_utilization.","risk":"Each process costs memory; raising it also raises sessions and pga_aggregate_limit.","related":["sessions","pga-aggregate-limit","open-cursors"],"faqs":[{"question":"What is the default value of processes in Oracle?","answer":"Set at creation. No useful fixed default: DBCA writes a value into the SPFILE; Oracle Free has 200. V$PARAMETER reports ISSYS_MODIFIABLE = IMMEDIATE, but ALTER SYSTEM rejects SCOPE=MEMORY with ORA-02095 on Oracle 23ai/26ai: it is static."},{"question":"Does changing processes require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change processes?","answer":"When the application or connection pools need more sessions than processes allows; check V$RESOURCE_LIMIT for max_utilization."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/processes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/remote-login-passwordfile","corpus":"sql-configuration","engine":"oracle","language":"en","title":"remote_login_passwordfile (Oracle)","description":"Oracle remote_login_passwordfile: Whether the password file authenticates remote administrative logins such as SYSDBA and SYSOPER. Default: EXCLUSIVE.","body":{"engine":"oracle","slug":"remote-login-passwordfile","name":"remote_login_passwordfile","topic":"security","summary":"Whether the password file authenticates remote administrative logins such as SYSDBA and SYSOPER.","detail":"NONE refuses password-file logins over the network; EXCLUSIVE lets one database grant SYSDBA, SYSOPER, SYSBACKUP, SYSDG and SYSKM to its own users; SHARED shares one file among several databases on the host and holds only the built-in accounts. V$PWFILE_USERS lists the members.","default":"EXCLUSIVE","default_note":"EXCLUSIVE (Oracle 23ai/26ai); the file itself is created with orapwd as orapw$ORACLE_SID under dbs on Linux.","range":"NONE, SHARED, EXCLUSIVE","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER remote_login_passwordfile\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'remote_login_passwordfile';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'remote_login_passwordfile';","change":"ALTER SYSTEM SET remote_login_passwordfile = EXCLUSIVE SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"EXCLUSIVE on any database administered over the network; NONE only where every administrator can authenticate locally through the operating system.","risk":"The file holds password verifiers readable by the oracle OS user, so host access is offline-attack access, and deleting or corrupting it locks out every remote administrative login until it is rebuilt.","related":["audit-trail"],"faqs":[{"question":"What is the default value of remote_login_passwordfile in Oracle?","answer":"EXCLUSIVE. EXCLUSIVE (Oracle 23ai/26ai); the file itself is created with orapwd as orapw$ORACLE_SID under dbs on Linux."},{"question":"Does changing remote_login_passwordfile require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change remote_login_passwordfile?","answer":"EXCLUSIVE on any database administered over the network; NONE only where every administrator can authenticate locally through the operating system."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/remote-login-passwordfile","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/result-cache-mode","corpus":"sql-configuration","engine":"oracle","language":"en","title":"result_cache_mode (Oracle)","description":"Oracle result_cache_mode: Which queries use the server result cache. Default: MANUAL.","body":{"engine":"oracle","slug":"result-cache-mode","name":"result_cache_mode","topic":"optimizer","summary":"Which queries use the server result cache.","detail":"MANUAL caches only queries with the RESULT_CACHE hint or tables annotated RESULT_CACHE (MODE FORCE). FORCE caches every eligible query.","default":"MANUAL","default_note":"MANUAL (Oracle 23ai/26ai).","range":"MANUAL, FORCE, MANUAL_TEMP, FORCE_TEMP","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER result_cache_mode\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'result_cache_mode';","change":"ALTER SESSION SET result_cache_mode = FORCE;   -- this session\n\nALTER SYSTEM SET result_cache_mode = FORCE SCOPE=BOTH;","when":"Keep MANUAL and hint the specific lookup queries that are read often and change rarely.","risk":"FORCE on a write-heavy system causes latch contention on the result cache and constant invalidation.","related":["optimizer-mode"],"faqs":[{"question":"What is the default value of result_cache_mode in Oracle?","answer":"MANUAL. MANUAL (Oracle 23ai/26ai)."},{"question":"Does changing result_cache_mode require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change result_cache_mode?","answer":"Keep MANUAL and hint the specific lookup queries that are read often and change rarely."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/result-cache-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/session-cached-cursors","corpus":"sql-configuration","engine":"oracle","language":"en","title":"session_cached_cursors (Oracle)","description":"Oracle session_cached_cursors: Cursors per session kept in the session cursor cache after they close. Default: 50.","body":{"engine":"oracle","slug":"session-cached-cursors","name":"session_cached_cursors","topic":"connections","summary":"Cursors per session kept in the session cursor cache after they close.","detail":"Repeated parse calls for a cached statement skip the library cache search (a 'softer' soft parse).","default":"50","default_note":"50 (Oracle 23ai/26ai).","range":"0 to an OS-dependent maximum","restart_required":false,"apply":"No restart, but ALTER SYSTEM needs the DEFERRED keyword and the value applies only to sessions that connect afterwards. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER session_cached_cursors\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'session_cached_cursors';","change":"ALTER SESSION SET session_cached_cursors = 200;   -- this session\n\nALTER SYSTEM SET session_cached_cursors = 200 DEFERRED SCOPE=BOTH;   -- new sessions","when":"Applications that parse the same statements repeatedly, visible as high 'session cursor cache hits' relative to parse count (total).","risk":"Each cached cursor costs PGA and a library cache slot, so values far above a session's working set waste memory; the cache softens repeated parses but never replaces fixing an application that reparses.","related":["open-cursors","cursor-sharing"],"faqs":[{"question":"What is the default value of session_cached_cursors in Oracle?","answer":"50. 50 (Oracle 23ai/26ai)."},{"question":"Does changing session_cached_cursors require a restart?","answer":"No. No restart, but ALTER SYSTEM needs the DEFERRED keyword and the value applies only to sessions that connect afterwards. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change session_cached_cursors?","answer":"Applications that parse the same statements repeatedly, visible as high 'session cursor cache hits' relative to parse count (total)."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/session-cached-cursors","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/sessions","corpus":"sql-configuration","engine":"oracle","language":"en","title":"sessions (Oracle)","description":"Oracle sessions: Maximum sessions; derived from processes when not set. Default: 1.5 x processes + 22.","body":{"engine":"oracle","slug":"sessions","name":"sessions","topic":"connections","summary":"Maximum sessions; derived from processes when not set.","detail":"One process can host several sessions (shared server, recursive sessions), so sessions is higher than processes.","default":"1.5 x processes + 22","default_note":"Derived as (1.5 x processes) + 22 (Oracle 23ai/26ai): 322 with processes = 200, as on Oracle Free.","range":"1 to 65536","restart_required":true,"apply":"Restart required at the instance level: V$PARAMETER reports ISSYS_MODIFIABLE = IMMEDIATE, but in CDB$ROOT ALTER SYSTEM accepts only SCOPE=SPFILE (SCOPE=MEMORY fails with ORA-00046). Inside a PDB, ALTER SYSTEM SET sessions = n SCOPE=BOTH sets a per-PDB cap immediately, no higher than the CDB value (ORA-00047 otherwise).","view":"SHOW PARAMETER sessions\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'sessions';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'sessions';","change":"ALTER SYSTEM SET sessions = 1522 SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Usually leave it derived and change processes instead.","risk":"Setting it below the derived value can cause ORA-00018 under load.","related":["processes"],"faqs":[{"question":"What is the default value of sessions in Oracle?","answer":"1.5 x processes + 22. Derived as (1.5 x processes) + 22 (Oracle 23ai/26ai): 322 with processes = 200, as on Oracle Free."},{"question":"Does changing sessions require a restart?","answer":"Yes. Restart required at the instance level: V$PARAMETER reports ISSYS_MODIFIABLE = IMMEDIATE, but in CDB$ROOT ALTER SYSTEM accepts only SCOPE=SPFILE (SCOPE=MEMORY fails with ORA-00046). Inside a PDB, ALTER SYSTEM SET sessions = n SCOPE=BOTH sets a per-PDB cap immediately, no higher than the CDB value (ORA-00047 otherwise)."},{"question":"When should I change sessions?","answer":"Usually leave it derived and change processes instead."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/sessions","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/sga-max-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"sga_max_size (Oracle)","description":"Oracle sga_max_size: Largest the SGA can grow to without a restart. Default: Initial SGA size.","body":{"engine":"oracle","slug":"sga-max-size","name":"sga_max_size","topic":"memory","summary":"Largest the SGA can grow to without a restart.","detail":"Oracle reserves address space for this much at startup; sga_target can then move freely below it.","default":"Initial SGA size","default_note":"Derived from the SGA components at startup when not set (Oracle 23ai/26ai). 1.5GB on Oracle Free.","range":"Platform-dependent","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER sga_max_size\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'sga_max_size';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'sga_max_size';","change":"ALTER SYSTEM SET sga_max_size = 16G SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Set it above sga_target if you want room to grow the SGA online later.","risk":"On some platforms the memory is committed at startup, so an oversized value wastes RAM.","related":["sga-target"],"faqs":[{"question":"What is the default value of sga_max_size in Oracle?","answer":"Initial SGA size. Derived from the SGA components at startup when not set (Oracle 23ai/26ai). 1.5GB on Oracle Free."},{"question":"Does changing sga_max_size require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change sga_max_size?","answer":"Set it above sga_target if you want room to grow the SGA online later."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/sga-max-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/sga-target","corpus":"sql-configuration","engine":"oracle","language":"en","title":"sga_target (Oracle)","description":"Oracle sga_target: Total SGA size under Automatic Shared Memory Management; Oracle divides it among buffer cache, shared pool and other pools. Default: 0.","body":{"engine":"oracle","slug":"sga-target","name":"sga_target","topic":"memory","summary":"Total SGA size under Automatic Shared Memory Management; Oracle divides it among buffer cache, shared pool and other pools.","detail":"Values set for db_cache_size, shared_pool_size and similar become minimums. It can be changed online up to sga_max_size. Set inside a PDB, it limits that PDB's share of the SGA and must be smaller than the root's sga_target (ORA-56747).","default":"0","default_note":"0 when not set (Oracle 23ai/26ai); DBCA sets it at creation. Oracle Free caps the instance at 2GB of RAM and has 1.5GB in CDB$ROOT.","range":"0, or up to sga_max_size","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER sga_target\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'sga_target';","change":"ALTER SYSTEM SET sga_target = 8G SCOPE=BOTH;","when":"When the buffer cache advisory (V$DB_CACHE_ADVICE) or V$SGA_TARGET_ADVICE shows a larger SGA would cut physical reads.","risk":"Above sga_max_size the change needs a restart; too large leaves the OS and PGA short.","related":["sga-max-size","pga-aggregate-target","memory-target","use-large-pages","shared-pool-size","db-cache-size"],"faqs":[{"question":"What is the default value of sga_target in Oracle?","answer":"0. 0 when not set (Oracle 23ai/26ai); DBCA sets it at creation. Oracle Free caps the instance at 2GB of RAM and has 1.5GB in CDB$ROOT."},{"question":"Does changing sga_target require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change sga_target?","answer":"When the buffer cache advisory (V$DB_CACHE_ADVICE) or V$SGA_TARGET_ADVICE shows a larger SGA would cut physical reads."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/sga-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/shared-pool-size","corpus":"sql-configuration","engine":"oracle","language":"en","title":"shared_pool_size (Oracle)","description":"Oracle shared_pool_size: Minimum size of the shared pool, which holds the library cache, dictionary cache and server-side PL/SQL state. Default: 0.","body":{"engine":"oracle","slug":"shared-pool-size","name":"shared_pool_size","topic":"memory","summary":"Minimum size of the shared pool, which holds the library cache, dictionary cache and server-side PL/SQL state.","detail":"With sga_target or memory_target set, an explicit value is a floor that automatic tuning cannot shrink below. Without them, the value fixes the pool and every other SGA component is sized manually too. Inside a PDB it guarantees that PDB a minimum share, which must stay below the root's value.","default":"0","default_note":"0, so ASMM or AMM sizes the pool when sga_target or memory_target is set (Oracle 23ai/26ai).","range":"0, or a value inside the SGA up to sga_max_size","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER shared_pool_size\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'shared_pool_size';","change":"ALTER SYSTEM SET shared_pool_size = 2G SCOPE=BOTH;","when":"As a floor when ORA-04031 keeps hitting despite an adequate sga_target, or to guarantee a busy PDB its share of the SGA.","risk":"A high floor starves the buffer cache and other pools inside the same SGA, and a pool sized without ASMM never adapts or gives memory back.","related":["sga-target","cursor-sharing","open-cursors"],"faqs":[{"question":"What is the default value of shared_pool_size in Oracle?","answer":"0. 0, so ASMM or AMM sizes the pool when sga_target or memory_target is set (Oracle 23ai/26ai)."},{"question":"Does changing shared_pool_size require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change shared_pool_size?","answer":"As a floor when ORA-04031 keeps hitting despite an adequate sga_target, or to guarantee a busy PDB its share of the SGA."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/shared-pool-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/statistics-level","corpus":"sql-configuration","engine":"oracle","language":"en","title":"statistics_level (Oracle)","description":"Oracle statistics_level: How much database and OS statistics Oracle collects. Default: TYPICAL.","body":{"engine":"oracle","slug":"statistics-level","name":"statistics_level","topic":"logging","summary":"How much database and OS statistics Oracle collects.","detail":"TYPICAL collects what AWR, ADDM, the advisories and automatic statistics gathering need. ALL adds timed OS statistics and row source execution statistics. BASIC turns most of that off.","default":"TYPICAL","default_note":"TYPICAL (Oracle 23ai/26ai).","range":"BASIC, TYPICAL, ALL","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER statistics_level\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'statistics_level';","change":"ALTER SESSION SET statistics_level = ALL;   -- this session\n\nALTER SYSTEM SET statistics_level = ALL SCOPE=BOTH;","when":"Set ALL in a session while tuning a statement (or use the GATHER_PLAN_STATISTICS hint) to see actual row counts per plan step.","risk":"BASIC disables AWR snapshots, memory advisories and automatic SGA tuning; ALL instance-wide adds measurable overhead.","related":["optimizer-mode"],"faqs":[{"question":"What is the default value of statistics_level in Oracle?","answer":"TYPICAL. TYPICAL (Oracle 23ai/26ai)."},{"question":"Does changing statistics_level require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. A session can also change its own value with ALTER SESSION. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change statistics_level?","answer":"Set ALL in a session while tuning a statement (or use the GATHER_PLAN_STATISTICS hint) to see actual row counts per plan step."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/statistics-level","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/undo-retention","corpus":"sql-configuration","engine":"oracle","language":"en","title":"undo_retention (Oracle)","description":"Oracle undo_retention: Seconds of committed undo Oracle tries to keep for consistent reads and flashback query. Default: 900.","body":{"engine":"oracle","slug":"undo-retention","name":"undo_retention","topic":"durability","summary":"Seconds of committed undo Oracle tries to keep for consistent reads and flashback query.","detail":"With an autoextending undo tablespace Oracle tunes retention up to cover the longest query; with a fixed-size one it keeps as much as space allows. Retention is only guaranteed with ALTER TABLESPACE ... RETENTION GUARANTEE.","default":"900","default_note":"900 seconds (Oracle 23ai/26ai).","range":"0 to 2^32-1 seconds","restart_required":false,"apply":"No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).","view":"SHOW PARAMETER undo_retention\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'undo_retention';","change":"ALTER SYSTEM SET undo_retention = 3600 SCOPE=BOTH;","when":"When long reports fail with ORA-01555 (snapshot too old), or Flashback Query needs a longer window.","risk":"Larger values need more undo space; with RETENTION GUARANTEE, DML can fail for lack of undo.","related":["db-recovery-file-dest-size"],"faqs":[{"question":"What is the default value of undo_retention in Oracle?","answer":"900. 900 seconds (Oracle 23ai/26ai)."},{"question":"Does changing undo_retention require a restart?","answer":"No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE)."},{"question":"When should I change undo_retention?","answer":"When long reports fail with ORA-01555 (snapshot too old), or Flashback Query needs a longer window."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/undo-retention","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/oracle/use-large-pages","corpus":"sql-configuration","engine":"oracle","language":"en","title":"use_large_pages (Oracle)","description":"Oracle use_large_pages: Whether the SGA uses Linux HugePages. Default: TRUE.","body":{"engine":"oracle","slug":"use-large-pages","name":"use_large_pages","topic":"memory","summary":"Whether the SGA uses Linux HugePages.","detail":"TRUE uses huge pages when available and falls back otherwise; ONLY refuses to start without enough of them; AUTO and AUTO_ONLY let Oracle configure them through the OS.","default":"TRUE","default_note":"TRUE (Oracle 23ai/26ai). Linux only.","range":"TRUE, FALSE, ONLY, AUTO, AUTO_ONLY","restart_required":true,"apply":"Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040.","view":"SHOW PARAMETER use_large_pages\n\nSELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable\nFROM v$parameter\nWHERE name = 'use_large_pages';\n\n-- What the SPFILE holds, which is what applies at the next startup:\nSELECT value FROM v$sppparameter WHERE name = 'use_large_pages';","change":"ALTER SYSTEM SET use_large_pages = ONLY SCOPE=SPFILE;\n-- then SHUTDOWN IMMEDIATE and STARTUP","when":"Set ONLY on production Linux once vm.nr_hugepages covers the SGA, so a misconfiguration stops startup instead of silently using 4KB pages.","risk":"ONLY fails startup if HugePages are short. AMM (memory_target) cannot use huge pages at all.","related":["sga-target","memory-target"],"faqs":[{"question":"What is the default value of use_large_pages in Oracle?","answer":"TRUE. TRUE (Oracle 23ai/26ai). Linux only."},{"question":"Does changing use_large_pages require a restart?","answer":"Yes. Restart required: the parameter is static (ISSYS_MODIFIABLE = FALSE), so only SCOPE=SPFILE is accepted and the value applies at the next startup. It is instance-wide: set it from CDB$ROOT, because a PDB gets ORA-65040."},{"question":"When should I change use_large_pages?","answer":"Set ONLY on production Linux once vm.nr_hugepages covers the SGA, so a misconfiguration stops startup instead of silently using 4KB pages."}]},"source_url":"https://sqlly.app/sql-configuration/oracle/use-large-pages","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum (PostgreSQL)","description":"PostgreSQL autovacuum: Whether the autovacuum launcher runs. Default: on.","body":{"engine":"postgresql","slug":"autovacuum","name":"autovacuum","topic":"maintenance","summary":"Whether the autovacuum launcher runs.","detail":"Autovacuum removes dead row versions, updates the visibility map, refreshes planner statistics and freezes old transaction IDs. Even with it off, the server still launches anti-wraparound vacuums when needed.","default":"on","default_note":"on (PostgreSQL 18).","range":"on, off","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum';","change":"ALTER SYSTEM SET autovacuum = on;\nSELECT pg_reload_conf();","when":"Leave it on. To exempt one table during a bulk load, use ALTER TABLE ... SET (autovacuum_enabled = false) and re-enable it afterwards.","risk":"Off server-wide leads to table bloat, stale statistics and eventually forced anti-wraparound vacuums at a bad moment.","related":["autovacuum-max-workers","autovacuum-vacuum-scale-factor","autovacuum-freeze-max-age"],"faqs":[{"question":"What is the default value of autovacuum in PostgreSQL?","answer":"on. on (PostgreSQL 18)."},{"question":"Does changing autovacuum require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum?","answer":"Leave it on. To exempt one table during a bulk load, use ALTER TABLE ... SET (autovacuum_enabled = false) and re-enable it afterwards."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-analyze-scale-factor","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_analyze_scale_factor (PostgreSQL)","description":"PostgreSQL autovacuum_analyze_scale_factor: Fraction of a table that must change before autovacuum re-collects its statistics. Default: 0.1.","body":{"engine":"postgresql","slug":"autovacuum-analyze-scale-factor","name":"autovacuum_analyze_scale_factor","topic":"maintenance","summary":"Fraction of a table that must change before autovacuum re-collects its statistics.","detail":"The trigger is autovacuum_analyze_threshold (50) + scale_factor x rows changed since the last ANALYZE.","default":"0.1","default_note":"0.1 (PostgreSQL 18).","range":"0 to 100","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_analyze_scale_factor;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_analyze_scale_factor';","change":"ALTER SYSTEM SET autovacuum_analyze_scale_factor = 0.02;\nSELECT pg_reload_conf();","when":"For large tables whose newest rows matter most, such as time-series tables queried for 'today', where 10% change takes days and estimates go stale.","risk":"Frequent ANALYZE on huge tables costs I/O; per-table settings keep it targeted.","related":["autovacuum-vacuum-scale-factor","default-statistics-target"],"faqs":[{"question":"What is the default value of autovacuum_analyze_scale_factor in PostgreSQL?","answer":"0.1. 0.1 (PostgreSQL 18)."},{"question":"Does changing autovacuum_analyze_scale_factor require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_analyze_scale_factor?","answer":"For large tables whose newest rows matter most, such as time-series tables queried for 'today', where 10% change takes days and estimates go stale."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-analyze-scale-factor","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-freeze-max-age","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_freeze_max_age (PostgreSQL)","description":"PostgreSQL autovacuum_freeze_max_age: Transaction age at which a table gets a forced anti-wraparound vacuum. Default: 200000000.","body":{"engine":"postgresql","slug":"autovacuum-freeze-max-age","name":"autovacuum_freeze_max_age","topic":"maintenance","summary":"Transaction age at which a table gets a forced anti-wraparound vacuum.","detail":"Transaction IDs are 32-bit, so old rows must be frozen before the counter wraps around. When a table's relfrozenxid gets this old, autovacuum vacuums it even if autovacuum is off, and that vacuum cannot be cancelled by lock conflicts.","default":"200000000","default_note":"200 million (PostgreSQL 18).","range":"100000 to 2000000000","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW autovacuum_freeze_max_age;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_freeze_max_age';","change":"ALTER SYSTEM SET autovacuum_freeze_max_age = 400000000;\n-- applies only after a server restart","when":"Some high-write systems raise it to 400-500 million to space out forced vacuums, provided normal autovacuum keeps freezing.","risk":"Too high leaves less margin before the database stops accepting writes to prevent wraparound.","related":["autovacuum","autovacuum-vacuum-cost-limit"],"faqs":[{"question":"What is the default value of autovacuum_freeze_max_age in PostgreSQL?","answer":"200000000. 200 million (PostgreSQL 18)."},{"question":"Does changing autovacuum_freeze_max_age require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change autovacuum_freeze_max_age?","answer":"Some high-write systems raise it to 400-500 million to space out forced vacuums, provided normal autovacuum keeps freezing."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-freeze-max-age","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-max-workers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_max_workers (PostgreSQL)","description":"PostgreSQL autovacuum_max_workers: How many autovacuum workers can run at the same time. Default: 3.","body":{"engine":"postgresql","slug":"autovacuum-max-workers","name":"autovacuum_max_workers","topic":"maintenance","summary":"How many autovacuum workers can run at the same time.","detail":"Each worker vacuums one table at a time. From PostgreSQL 18 it can be raised with a reload up to autovacuum_worker_slots (default 16); before 18 it needed a restart.","default":"3","default_note":"3 (PostgreSQL 18). Context changed from postmaster to sighup in 18.","range":"1 to autovacuum_worker_slots (262143 maximum)","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_max_workers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_max_workers';","change":"ALTER SYSTEM SET autovacuum_max_workers = 6;\nSELECT pg_reload_conf();","when":"Databases with many busy tables where pg_stat_user_tables shows n_dead_tup climbing and last_autovacuum lagging. More workers share the same cost limit, so raise autovacuum_vacuum_cost_limit too.","risk":"Without a higher cost limit, more workers each run slower; with one, they add I/O.","related":["autovacuum-vacuum-cost-limit","autovacuum-work-mem","autovacuum-naptime"],"faqs":[{"question":"What is the default value of autovacuum_max_workers in PostgreSQL?","answer":"3. 3 (PostgreSQL 18). Context changed from postmaster to sighup in 18."},{"question":"Does changing autovacuum_max_workers require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_max_workers?","answer":"Databases with many busy tables where pg_stat_user_tables shows n_dead_tup climbing and last_autovacuum lagging. More workers share the same cost limit, so raise autovacuum_vacuum_cost_limit too."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-max-workers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-naptime","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_naptime (PostgreSQL)","description":"PostgreSQL autovacuum_naptime: Delay between autovacuum runs on any given database. Default: 1min.","body":{"engine":"postgresql","slug":"autovacuum-naptime","name":"autovacuum_naptime","topic":"maintenance","summary":"Delay between autovacuum runs on any given database.","detail":"The launcher starts a worker for each database once per naptime, so with many databases workers start more often.","default":"1min","default_note":"1min (PostgreSQL 18).","range":"1s to about 24 days","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_naptime;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_naptime';","change":"ALTER SYSTEM SET autovacuum_naptime = '15s';\nSELECT pg_reload_conf();","when":"Shorten it for databases with a few very hot tables that bloat within a minute.","risk":"Very short values add catalog-scanning overhead on clusters with many databases.","related":["autovacuum-max-workers"],"faqs":[{"question":"What is the default value of autovacuum_naptime in PostgreSQL?","answer":"1min. 1min (PostgreSQL 18)."},{"question":"Does changing autovacuum_naptime require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_naptime?","answer":"Shorten it for databases with a few very hot tables that bloat within a minute."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-naptime","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-vacuum-cost-limit","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_vacuum_cost_limit (PostgreSQL)","description":"PostgreSQL autovacuum_vacuum_cost_limit: I/O budget autovacuum spends before sleeping for autovacuum_vacuum_cost_delay; -1 uses vacuum_cost_limit.","body":{"engine":"postgresql","slug":"autovacuum-vacuum-cost-limit","name":"autovacuum_vacuum_cost_limit","topic":"maintenance","summary":"I/O budget autovacuum spends before sleeping for autovacuum_vacuum_cost_delay; -1 uses vacuum_cost_limit.","detail":"The budget is shared across all running workers. With the defaults (200 and a 2ms delay) autovacuum is throttled to a modest share of disk bandwidth.","default":"-1 (uses vacuum_cost_limit = 200)","default_note":"-1 (PostgreSQL 18). The delay default has been 2ms since PostgreSQL 12 (it was 20ms).","range":"-1, or 1 to 10000","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_vacuum_cost_limit;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_vacuum_cost_limit';","change":"ALTER SYSTEM SET autovacuum_vacuum_cost_limit = 2000;\nSELECT pg_reload_conf();","when":"When autovacuum cannot keep up on fast storage. Values of 1000-2000 are common on SSDs.","risk":"Higher values let autovacuum compete harder with queries for I/O.","related":["autovacuum-max-workers","autovacuum-vacuum-scale-factor"],"faqs":[{"question":"What is the default value of autovacuum_vacuum_cost_limit in PostgreSQL?","answer":"-1 (uses vacuum_cost_limit = 200). -1 (PostgreSQL 18). The delay default has been 2ms since PostgreSQL 12 (it was 20ms)."},{"question":"Does changing autovacuum_vacuum_cost_limit require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_vacuum_cost_limit?","answer":"When autovacuum cannot keep up on fast storage. Values of 1000-2000 are common on SSDs."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-vacuum-cost-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-vacuum-scale-factor","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_vacuum_scale_factor (PostgreSQL)","description":"PostgreSQL autovacuum_vacuum_scale_factor: Fraction of a table that must be dead rows before autovacuum vacuums it. Default: 0.2.","body":{"engine":"postgresql","slug":"autovacuum-vacuum-scale-factor","name":"autovacuum_vacuum_scale_factor","topic":"maintenance","summary":"Fraction of a table that must be dead rows before autovacuum vacuums it.","detail":"The trigger is autovacuum_vacuum_threshold (50) + scale_factor x rows. With 0.2, a 100-million-row table waits for 20 million dead rows. PostgreSQL 18 adds autovacuum_vacuum_max_threshold (default 100,000,000) as an upper cap.","default":"0.2","default_note":"0.2 (PostgreSQL 18).","range":"0 to 100","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_vacuum_scale_factor;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_vacuum_scale_factor';","change":"ALTER SYSTEM SET autovacuum_vacuum_scale_factor = 0.05;\nSELECT pg_reload_conf();","when":"Lower it, usually per table with ALTER TABLE big_table SET (autovacuum_vacuum_scale_factor = 0.01), for large tables with steady updates or deletes.","risk":"Very low values on small tables make autovacuum run constantly; prefer per-table overrides.","related":["autovacuum-analyze-scale-factor","autovacuum-vacuum-cost-limit","autovacuum"],"faqs":[{"question":"What is the default value of autovacuum_vacuum_scale_factor in PostgreSQL?","answer":"0.2. 0.2 (PostgreSQL 18)."},{"question":"Does changing autovacuum_vacuum_scale_factor require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_vacuum_scale_factor?","answer":"Lower it, usually per table with ALTER TABLE big_table SET (autovacuum_vacuum_scale_factor = 0.01), for large tables with steady updates or deletes."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-vacuum-scale-factor","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/autovacuum-work-mem","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"autovacuum_work_mem (PostgreSQL)","description":"PostgreSQL autovacuum_work_mem: Memory each autovacuum worker uses to track dead rows; -1 means use maintenance_work_mem. Default: -1.","body":{"engine":"postgresql","slug":"autovacuum-work-mem","name":"autovacuum_work_mem","topic":"memory","summary":"Memory each autovacuum worker uses to track dead rows; -1 means use maintenance_work_mem.","detail":"Lets you give manual maintenance a large maintenance_work_mem without multiplying it across every autovacuum worker.","default":"-1","default_note":"-1, meaning inherit maintenance_work_mem (PostgreSQL 18).","range":"-1, or 64kB to 2TB","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW autovacuum_work_mem;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'autovacuum_work_mem';","change":"ALTER SYSTEM SET autovacuum_work_mem = '512MB';\nSELECT pg_reload_conf();","when":"Set it explicitly when maintenance_work_mem is large (several GB) and autovacuum_max_workers is above the default.","risk":"Too small makes autovacuum scan every index several times on big tables, which is slow and I/O heavy.","related":["maintenance-work-mem","autovacuum-max-workers"],"faqs":[{"question":"What is the default value of autovacuum_work_mem in PostgreSQL?","answer":"-1. -1, meaning inherit maintenance_work_mem (PostgreSQL 18)."},{"question":"Does changing autovacuum_work_mem require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change autovacuum_work_mem?","answer":"Set it explicitly when maintenance_work_mem is large (several GB) and autovacuum_max_workers is above the default."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/autovacuum-work-mem","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/bgwriter-delay","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"bgwriter_delay (PostgreSQL)","description":"PostgreSQL bgwriter_delay: Time between rounds of the background writer, which cleans buffers ahead of other sessions. Default: 200ms.","body":{"engine":"postgresql","slug":"bgwriter-delay","name":"bgwriter_delay","topic":"checkpoints","summary":"Time between rounds of the background writer, which cleans buffers ahead of other sessions.","detail":"Each round the background writer writes dirty buffers picked from behind the clock-sweep hand, then sleeps this long; when it finds nothing dirty it sleeps longer regardless. bgwriter_lru_maxpages bounds what it writes per round.","default":"200ms","default_note":"200ms (PostgreSQL 18).","range":"1ms to 10s","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW bgwriter_delay;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'bgwriter_delay';","change":"ALTER SYSTEM SET bgwriter_delay = '500ms';\nSELECT pg_reload_conf();","when":"Rarely. Compare buffers_backend with buffers_clean in pg_stat_bgwriter: when backends write most buffers themselves, a shorter delay or larger bgwriter_lru_maxpages shifts some of that work off the query path.","risk":"Too short burns CPU on rounds that find little to write; too long leaves backends writing their own buffers and adds latency to their queries. It is not the checkpoint writer: checkpoints flush their own bulk, so this cannot fix checkpoint I/O spikes.","related":["shared-buffers","checkpoint-completion-target","max-wal-size"],"faqs":[{"question":"What is the default value of bgwriter_delay in PostgreSQL?","answer":"200ms. 200ms (PostgreSQL 18)."},{"question":"Does changing bgwriter_delay require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change bgwriter_delay?","answer":"Rarely. Compare buffers_backend with buffers_clean in pg_stat_bgwriter: when backends write most buffers themselves, a shorter delay or larger bgwriter_lru_maxpages shifts some of that work off the query path."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/bgwriter-delay","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/checkpoint-completion-target","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"checkpoint_completion_target (PostgreSQL)","description":"PostgreSQL checkpoint_completion_target: Fraction of the checkpoint interval over which the checkpoint's writes are spread. Default: 0.9.","body":{"engine":"postgresql","slug":"checkpoint-completion-target","name":"checkpoint_completion_target","topic":"checkpoints","summary":"Fraction of the checkpoint interval over which the checkpoint's writes are spread.","detail":"With 0.9, a checkpoint spreads its writes over 90% of the time until the next one is due, which keeps I/O smooth instead of bursting.","default":"0.9","default_note":"0.9 since PostgreSQL 14 (it was 0.5 before). Same in 18.","range":"0 to 1","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW checkpoint_completion_target;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'checkpoint_completion_target';","change":"ALTER SYSTEM SET checkpoint_completion_target = 0.9;\nSELECT pg_reload_conf();","when":"Rarely now that the default is 0.9. Check it on servers upgraded with an old postgresql.conf that still says 0.5.","risk":"Low values compress the checkpoint's writes into a short window and can saturate the disk twice per interval; a postgresql.conf carried forward from an old server and still pinning 0.5 quietly keeps that spiky behavior.","related":["checkpoint-timeout","max-wal-size"],"faqs":[{"question":"What is the default value of checkpoint_completion_target in PostgreSQL?","answer":"0.9. 0.9 since PostgreSQL 14 (it was 0.5 before). Same in 18."},{"question":"Does changing checkpoint_completion_target require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change checkpoint_completion_target?","answer":"Rarely now that the default is 0.9. Check it on servers upgraded with an old postgresql.conf that still says 0.5."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/checkpoint-completion-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/checkpoint-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"checkpoint_timeout (PostgreSQL)","description":"PostgreSQL checkpoint_timeout: Longest time between automatic checkpoints. Default: 5min.","body":{"engine":"postgresql","slug":"checkpoint-timeout","name":"checkpoint_timeout","topic":"checkpoints","summary":"Longest time between automatic checkpoints.","detail":"Bounds crash recovery time and the WAL generated between checkpoints. Each checkpoint also restarts the cycle of full-page writes.","default":"5min","default_note":"5min (PostgreSQL 18).","range":"30s to 1d","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW checkpoint_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'checkpoint_timeout';","change":"ALTER SYSTEM SET checkpoint_timeout = '15min';\nSELECT pg_reload_conf();","when":"Often raised to 15-30 minutes on write-heavy servers to cut full-page-write volume, together with max_wal_size.","risk":"Longer intervals stretch crash recovery, and each checkpoint boundary writes a wave of full-page images; pair a long timeout with a small max_wal_size and WAL volume just triggers the checkpoints anyway.","related":["max-wal-size","checkpoint-completion-target","log-checkpoints"],"faqs":[{"question":"What is the default value of checkpoint_timeout in PostgreSQL?","answer":"5min. 5min (PostgreSQL 18)."},{"question":"Does changing checkpoint_timeout require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change checkpoint_timeout?","answer":"Often raised to 15-30 minutes on write-heavy servers to cut full-page-write volume, together with max_wal_size."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/checkpoint-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/deadlock-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"deadlock_timeout (PostgreSQL)","description":"PostgreSQL deadlock_timeout: How long to wait on a lock before checking for a deadlock. Default: 1s.","body":{"engine":"postgresql","slug":"deadlock-timeout","name":"deadlock_timeout","topic":"timeouts","summary":"How long to wait on a lock before checking for a deadlock.","detail":"Deadlock detection is expensive, so it runs only after a wait reaches this length. The same delay decides when log_lock_waits writes its message.","default":"1s","default_note":"1s (PostgreSQL 18).","range":"1ms to about 24 days","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW deadlock_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'deadlock_timeout';","change":"SET deadlock_timeout = '200ms';   -- this session\n\nALTER SYSTEM SET deadlock_timeout = '200ms';\nSELECT pg_reload_conf();","when":"Lower it a little if deadlocks are frequent and you want them broken faster, or raise it on servers with heavy, short lock waits to avoid needless checks.","risk":"Very low values run the deadlock detector on every ordinary lock wait and waste CPU on busy servers; very high ones leave a real deadlock in place for that long before the server cancels a victim, and log_lock_waits waits just as long to log the wait.","related":["lock-timeout","log-lock-waits"],"faqs":[{"question":"What is the default value of deadlock_timeout in PostgreSQL?","answer":"1s. 1s (PostgreSQL 18)."},{"question":"Does changing deadlock_timeout require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change deadlock_timeout?","answer":"Lower it a little if deadlocks are frequent and you want them broken faster, or raise it on servers with heavy, short lock waits to avoid needless checks."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/deadlock-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/default-statistics-target","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"default_statistics_target (PostgreSQL)","description":"PostgreSQL default_statistics_target: How detailed the statistics ANALYZE collects per column. Default: 100.","body":{"engine":"postgresql","slug":"default-statistics-target","name":"default_statistics_target","topic":"maintenance","summary":"How detailed the statistics ANALYZE collects per column.","detail":"Controls the number of most-common values and histogram buckets per column (and the sample size: 300 x target rows). Override per column with ALTER TABLE ... ALTER COLUMN ... SET STATISTICS.","default":"100","default_note":"100 (PostgreSQL 18).","range":"1 to 10000","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW default_statistics_target;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'default_statistics_target';","change":"SET default_statistics_target = 500;   -- this session\nALTER ROLE reporting SET default_statistics_target = 500;   -- new sessions of one role\n\nALTER SYSTEM SET default_statistics_target = 500;\nSELECT pg_reload_conf();","when":"When row estimates in EXPLAIN ANALYZE are far off for skewed columns. Prefer raising it on the specific columns.","risk":"Higher values make ANALYZE slower and planning slightly slower.","related":["autovacuum-analyze-scale-factor"],"faqs":[{"question":"What is the default value of default_statistics_target in PostgreSQL?","answer":"100. 100 (PostgreSQL 18)."},{"question":"Does changing default_statistics_target require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change default_statistics_target?","answer":"When row estimates in EXPLAIN ANALYZE are far off for skewed columns. Prefer raising it on the specific columns."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/default-statistics-target","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/effective-cache-size","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"effective_cache_size (PostgreSQL)","description":"PostgreSQL effective_cache_size: The planner's estimate of how much memory is available for caching data, shared buffers plus the OS cache. Default: 4GB.","body":{"engine":"postgresql","slug":"effective-cache-size","name":"effective_cache_size","topic":"memory","summary":"The planner's estimate of how much memory is available for caching data, shared buffers plus the OS cache.","detail":"Allocates nothing. The planner uses it to judge whether repeated index lookups will hit cache, so a higher value makes index scans look cheaper relative to sequential scans.","default":"4GB","default_note":"4GB (PostgreSQL 18), unchanged since 9.4.","range":"8kB upward, in 8kB pages","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW effective_cache_size;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'effective_cache_size';","change":"SET effective_cache_size = '24GB';   -- this session\nALTER ROLE reporting SET effective_cache_size = '24GB';   -- new sessions of one role\n\nALTER SYSTEM SET effective_cache_size = '24GB';\nSELECT pg_reload_conf();","when":"Set it to about 50-75% of RAM on a dedicated database server. It is safe to set per session for experiments.","risk":"Set far too high, the planner picks index scans that thrash disk once the data is not actually cached; far too low, it avoids indexes that would have been fast.","related":["shared-buffers","random-page-cost"],"faqs":[{"question":"What is the default value of effective_cache_size in PostgreSQL?","answer":"4GB. 4GB (PostgreSQL 18), unchanged since 9.4."},{"question":"Does changing effective_cache_size require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change effective_cache_size?","answer":"Set it to about 50-75% of RAM on a dedicated database server. It is safe to set per session for experiments."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/effective-cache-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/effective-io-concurrency","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"effective_io_concurrency (PostgreSQL)","description":"PostgreSQL effective_io_concurrency: How many concurrent read requests a session may issue ahead of time. Default: 16.","body":{"engine":"postgresql","slug":"effective-io-concurrency","name":"effective_io_concurrency","topic":"io","summary":"How many concurrent read requests a session may issue ahead of time.","detail":"Used for prefetching in bitmap heap scans and, from PostgreSQL 18, by the asynchronous read stream used in sequential scans and vacuum.","default":"16","default_note":"16 since PostgreSQL 18 (it was 1 before). Only effective on platforms with prefetch or asynchronous I/O support.","range":"0 to 1000","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW effective_io_concurrency;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'effective_io_concurrency';","change":"SET effective_io_concurrency = 200;   -- this session\nALTER ROLE reporting SET effective_io_concurrency = 200;   -- new sessions of one role\n\nALTER SYSTEM SET effective_io_concurrency = 200;\nSELECT pg_reload_conf();","when":"Raise to the low hundreds on SSD or NVMe storage; cloud block storage often also benefits.","risk":"Too high on spinning disks causes seek storms; 0 disables prefetching.","related":["io-method","random-page-cost"],"faqs":[{"question":"What is the default value of effective_io_concurrency in PostgreSQL?","answer":"16. 16 since PostgreSQL 18 (it was 1 before). Only effective on platforms with prefetch or asynchronous I/O support."},{"question":"Does changing effective_io_concurrency require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change effective_io_concurrency?","answer":"Raise to the low hundreds on SSD or NVMe storage; cloud block storage often also benefits."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/effective-io-concurrency","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/fsync","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"fsync (PostgreSQL)","description":"PostgreSQL fsync: Flush WAL and data changes to disk before a commit reports success. Default: on.","body":{"engine":"postgresql","slug":"fsync","name":"fsync","topic":"durability","summary":"Flush WAL and data changes to disk before a commit reports success.","detail":"The master switch for durability. With it off, the server hands writes to the OS and acknowledges commits without waiting for the disk; a crash can then lose or tear data. synchronous_commit = off buys much of the same speed without the corruption risk.","default":"on","default_note":"on (PostgreSQL 18).","range":"on, off","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW fsync;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'fsync';","change":"ALTER SYSTEM SET fsync = off;\nSELECT pg_reload_conf();","when":"Almost never in production. The legitimate cases are throwaway load tests and an initial bulk load into a cluster you will back up or rebuild before serving traffic.","risk":"Off leaves acknowledged commits in the OS page cache, so a crash, power loss or disk error can corrupt the cluster beyond repair; docs advise considering full_page_writes = off alongside, which removes torn-page protection on top. Turning it back on does not undo damage taken while it was off.","related":["synchronous-commit","full-page-writes","wal-compression"],"faqs":[{"question":"What is the default value of fsync in PostgreSQL?","answer":"on. on (PostgreSQL 18)."},{"question":"Does changing fsync require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change fsync?","answer":"Almost never in production. The legitimate cases are throwaway load tests and an initial bulk load into a cluster you will back up or rebuild before serving traffic."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/fsync","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/full-page-writes","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"full_page_writes (PostgreSQL)","description":"PostgreSQL full_page_writes: Write a full copy of each page to WAL the first time it changes after a checkpoint. Default: on.","body":{"engine":"postgresql","slug":"full-page-writes","name":"full_page_writes","topic":"durability","summary":"Write a full copy of each page to WAL the first time it changes after a checkpoint.","detail":"Protects against torn pages: if the OS crashes mid-write, recovery restores the whole page from WAL. It is a major source of WAL volume right after each checkpoint.","default":"on","default_note":"on (PostgreSQL 18).","range":"on, off","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW full_page_writes;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'full_page_writes';","change":"ALTER SYSTEM SET full_page_writes = on;\nSELECT pg_reload_conf();","when":"Leave it on unless the storage guarantees atomic 8kB writes (some copy-on-write file systems such as ZFS do). Reduce its cost with longer checkpoint intervals and wal_compression instead.","risk":"off on storage without atomic page writes can leave unrecoverable corruption after a power loss.","related":["wal-compression","checkpoint-timeout"],"faqs":[{"question":"What is the default value of full_page_writes in PostgreSQL?","answer":"on. on (PostgreSQL 18)."},{"question":"Does changing full_page_writes require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change full_page_writes?","answer":"Leave it on unless the storage guarantees atomic 8kB writes (some copy-on-write file systems such as ZFS do). Reduce its cost with longer checkpoint intervals and wal_compression instead."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/full-page-writes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/hash-mem-multiplier","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"hash_mem_multiplier (PostgreSQL)","description":"PostgreSQL hash_mem_multiplier: Multiplier on work_mem for hash joins and hash aggregates. Default: 2.0.","body":{"engine":"postgresql","slug":"hash-mem-multiplier","name":"hash_mem_multiplier","topic":"memory","summary":"Multiplier on work_mem for hash joins and hash aggregates.","detail":"Hash tables degrade more sharply than sorts when they spill, so PostgreSQL lets them use more memory: the limit for a hash node is work_mem x hash_mem_multiplier.","default":"2.0","default_note":"2.0 since PostgreSQL 15 (it was 1.0 when introduced in 13). Same in PostgreSQL 18.","range":"1 to 1000","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW hash_mem_multiplier;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'hash_mem_multiplier';","change":"SET hash_mem_multiplier = 3;   -- this session\nALTER ROLE reporting SET hash_mem_multiplier = 3;   -- new sessions of one role\n\nALTER SYSTEM SET hash_mem_multiplier = 3;\nSELECT pg_reload_conf();","when":"If hash aggregates or hash joins spill while sorts are fine, raise this instead of raising work_mem for everything.","risk":"The same multiplication risk as work_mem: each hash node in each worker can use the full amount.","related":["work-mem"],"faqs":[{"question":"What is the default value of hash_mem_multiplier in PostgreSQL?","answer":"2.0. 2.0 since PostgreSQL 15 (it was 1.0 when introduced in 13). Same in PostgreSQL 18."},{"question":"Does changing hash_mem_multiplier require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change hash_mem_multiplier?","answer":"If hash aggregates or hash joins spill while sorts are fine, raise this instead of raising work_mem for everything."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/hash-mem-multiplier","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/huge-pages","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"huge_pages (PostgreSQL)","description":"PostgreSQL huge_pages: Whether the shared memory segment uses huge pages (Linux and Windows). Default: try.","body":{"engine":"postgresql","slug":"huge-pages","name":"huge_pages","topic":"memory","summary":"Whether the shared memory segment uses huge pages (Linux and Windows).","detail":"try uses huge pages if the OS has enough reserved and silently falls back otherwise; on refuses to start without them. With a large shared_buffers, huge pages cut page-table memory and TLB misses.","default":"try","default_note":"try (PostgreSQL 18).","range":"off, on, try","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW huge_pages;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'huge_pages';","change":"ALTER SYSTEM SET huge_pages = on;\n-- applies only after a server restart","when":"Set it to on once vm.nr_hugepages is sized (shared_memory_size_in_huge_pages, PostgreSQL 15+, reports how many are needed), so a misconfiguration fails loudly instead of quietly falling back.","risk":"With on, the server will not start if the huge pages are not reserved.","related":["shared-buffers"],"faqs":[{"question":"What is the default value of huge_pages in PostgreSQL?","answer":"try. try (PostgreSQL 18)."},{"question":"Does changing huge_pages require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change huge_pages?","answer":"Set it to on once vm.nr_hugepages is sized (shared_memory_size_in_huge_pages, PostgreSQL 15+, reports how many are needed), so a misconfiguration fails loudly instead of quietly falling back."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/huge-pages","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/idle-in-transaction-session-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"idle_in_transaction_session_timeout (PostgreSQL)","description":"PostgreSQL idle_in_transaction_session_timeout: Terminate sessions that sit idle inside an open transaction for longer than this; 0 disables. Default: 0 (disabled).","body":{"engine":"postgresql","slug":"idle-in-transaction-session-timeout","name":"idle_in_transaction_session_timeout","topic":"timeouts","summary":"Terminate sessions that sit idle inside an open transaction for longer than this; 0 disables.","detail":"An open transaction holds locks and stops VACUUM from removing rows newer than its snapshot. This ends the whole session, not just the transaction.","default":"0 (disabled)","default_note":"0 (PostgreSQL 18).","range":"0 to about 24 days, in ms","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW idle_in_transaction_session_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'idle_in_transaction_session_timeout';","change":"SET idle_in_transaction_session_timeout = '5min';   -- this session\nALTER ROLE reporting SET idle_in_transaction_session_timeout = '5min';   -- new sessions of one role\n\nALTER SYSTEM SET idle_in_transaction_session_timeout = '5min';\nSELECT pg_reload_conf();","when":"On almost every application server: forgotten transactions from crashed clients or debuggers are a common cause of bloat and lock pile-ups.","risk":"Clients get a terminated connection and must reconnect; pools usually handle that.","related":["statement-timeout","transaction-timeout"],"faqs":[{"question":"What is the default value of idle_in_transaction_session_timeout in PostgreSQL?","answer":"0 (disabled). 0 (PostgreSQL 18)."},{"question":"Does changing idle_in_transaction_session_timeout require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change idle_in_transaction_session_timeout?","answer":"On almost every application server: forgotten transactions from crashed clients or debuggers are a common cause of bloat and lock pile-ups."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/idle-in-transaction-session-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/idle-session-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"idle_session_timeout (PostgreSQL)","description":"PostgreSQL idle_session_timeout: Terminate sessions that sit idle waiting for a client query longer than this; 0 disables. Default: 0 (disabled).","body":{"engine":"postgresql","slug":"idle-session-timeout","name":"idle_session_timeout","topic":"timeouts","summary":"Terminate sessions that sit idle waiting for a client query longer than this; 0 disables.","detail":"Unlike idle_in_transaction_session_timeout it leaves sessions parked inside an open transaction alone, and an idle session without a transaction costs the server little. Added in PostgreSQL 14.","default":"0 (disabled)","default_note":"0 (PostgreSQL 18); the parameter exists from PostgreSQL 14.","range":"0 to about 24 days, in ms","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW idle_session_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'idle_session_timeout';","change":"ALTER SYSTEM SET idle_session_timeout = '10min';\nSELECT pg_reload_conf();","when":"Against half-dead clients and forgotten sessions, especially where no connection pool sits in front of the application; scope it per role with ALTER ROLE rather than server-wide.","risk":"It kills sessions the client still considers parked, so dashboards, schedulers or IDEs that hold a connection between jobs see it vanish with 'terminating connection due to idle-session timeout'. Sessions idle inside a transaction are exempt.","related":["idle-in-transaction-session-timeout","statement-timeout","tcp-keepalives-idle"],"faqs":[{"question":"What is the default value of idle_session_timeout in PostgreSQL?","answer":"0 (disabled). 0 (PostgreSQL 18); the parameter exists from PostgreSQL 14."},{"question":"Does changing idle_session_timeout require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change idle_session_timeout?","answer":"Against half-dead clients and forgotten sessions, especially where no connection pool sits in front of the application; scope it per role with ALTER ROLE rather than server-wide."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/idle-session-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/io-method","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"io_method (PostgreSQL)","description":"PostgreSQL io_method: How PostgreSQL issues asynchronous reads: worker processes, io_uring or synchronously. Default: worker.","body":{"engine":"postgresql","slug":"io-method","name":"io_method","topic":"io","summary":"How PostgreSQL issues asynchronous reads: worker processes, io_uring or synchronously.","detail":"New in PostgreSQL 18. worker hands reads to io_workers background processes; io_uring (Linux, when built with liburing) submits them from the backend directly; sync restores pre-18 behavior.","default":"worker","default_note":"worker (PostgreSQL 18; the setting does not exist before 18).","range":"sync, worker, io_uring","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW io_method;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'io_method';","change":"ALTER SYSTEM SET io_method = 'io_uring';\n-- applies only after a server restart","when":"Try io_uring on recent Linux kernels with fast storage after benchmarking; use sync to rule out the new I/O path when diagnosing a regression after upgrading.","risk":"io_uring is unavailable on builds without liburing and in some container sandboxes that block the syscalls.","related":["effective-io-concurrency"],"faqs":[{"question":"What is the default value of io_method in PostgreSQL?","answer":"worker. worker (PostgreSQL 18; the setting does not exist before 18)."},{"question":"Does changing io_method require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change io_method?","answer":"Try io_uring on recent Linux kernels with fast storage after benchmarking; use sync to rule out the new I/O path when diagnosing a regression after upgrading."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/io-method","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/jit","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"jit (PostgreSQL)","description":"PostgreSQL jit: Whether queries may be compiled with LLVM JIT. Default: on.","body":{"engine":"postgresql","slug":"jit","name":"jit","topic":"optimizer","summary":"Whether queries may be compiled with LLVM JIT.","detail":"JIT kicks in only for queries whose estimated cost exceeds jit_above_cost (100000). It helps long CPU-bound analytic queries and often hurts short ones, where compile time dominates.","default":"on","default_note":"on since PostgreSQL 12 (off in 11). Has no effect if the server was built without LLVM.","range":"on, off","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW jit;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'jit';","change":"SET jit = off;   -- this session\nALTER ROLE reporting SET jit = off;   -- new sessions of one role\n\nALTER SYSTEM SET jit = off;\nSELECT pg_reload_conf();","when":"Turn it off for OLTP roles if EXPLAIN ANALYZE shows JIT time in the hundreds of milliseconds on queries that are otherwise fast.","risk":"Off leaves heavy scans, joins and aggregations unoptimized, which can cost minutes-long analytic queries tens of percent; the on side is the mirror risk, short OLTP queries paying compile time for plans that never amortize it.","related":["random-page-cost"],"faqs":[{"question":"What is the default value of jit in PostgreSQL?","answer":"on. on since PostgreSQL 12 (off in 11). Has no effect if the server was built without LLVM."},{"question":"Does changing jit require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change jit?","answer":"Turn it off for OLTP roles if EXPLAIN ANALYZE shows JIT time in the hundreds of milliseconds on queries that are otherwise fast."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/jit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/listen-addresses","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"listen_addresses (PostgreSQL)","description":"PostgreSQL listen_addresses: Network interfaces the server accepts TCP connections on. Default: localhost.","body":{"engine":"postgresql","slug":"listen-addresses","name":"listen_addresses","topic":"security","summary":"Network interfaces the server accepts TCP connections on.","detail":"A comma-separated list of host names or IP addresses; '*' means all interfaces and an empty string means Unix sockets only. Which clients may log in is still decided by pg_hba.conf.","default":"localhost","default_note":"localhost (PostgreSQL 18). The official Docker image sets '*' so the port can be published; this reference's test container reports '*'.","range":"Host names, IP addresses, '*' or ''","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW listen_addresses;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'listen_addresses';","change":"ALTER SYSTEM SET listen_addresses = '10.0.0.5,localhost';\n-- applies only after a server restart","when":"Bind to the private interface the application uses when the server must accept remote connections.","risk":"'*' on a host with a public interface exposes the port to the internet; keep pg_hba.conf restrictive and require scram-sha-256.","related":["max-connections"],"faqs":[{"question":"What is the default value of listen_addresses in PostgreSQL?","answer":"localhost. localhost (PostgreSQL 18). The official Docker image sets '*' so the port can be published; this reference's test container reports '*'."},{"question":"Does changing listen_addresses require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change listen_addresses?","answer":"Bind to the private interface the application uses when the server must accept remote connections."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/listen-addresses","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/lock-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"lock_timeout (PostgreSQL)","description":"PostgreSQL lock_timeout: Abort a statement that waits longer than this to acquire a lock; 0 disables. Default: 0 (disabled).","body":{"engine":"postgresql","slug":"lock-timeout","name":"lock_timeout","topic":"timeouts","summary":"Abort a statement that waits longer than this to acquire a lock; 0 disables.","detail":"Applies to each lock wait separately. Most useful for DDL: ALTER TABLE waits for an ACCESS EXCLUSIVE lock and blocks every query behind it while it waits.","default":"0 (disabled)","default_note":"0 (PostgreSQL 18).","range":"0 to about 24 days, in ms","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW lock_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'lock_timeout';","change":"SET lock_timeout = '5s';   -- this session\nALTER ROLE reporting SET lock_timeout = '5s';   -- new sessions of one role\n\nALTER SYSTEM SET lock_timeout = '5s';\nSELECT pg_reload_conf();","when":"Set it in migration scripts (SET lock_timeout = '5s') so DDL gives up instead of queueing behind a long transaction and stalling the application.","risk":"Statements fail with 'canceling statement due to lock timeout' and need a retry.","related":["statement-timeout","deadlock-timeout","log-lock-waits"],"faqs":[{"question":"What is the default value of lock_timeout in PostgreSQL?","answer":"0 (disabled). 0 (PostgreSQL 18)."},{"question":"Does changing lock_timeout require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change lock_timeout?","answer":"Set it in migration scripts (SET lock_timeout = '5s') so DDL gives up instead of queueing behind a long transaction and stalling the application."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/lock-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-autovacuum-min-duration","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_autovacuum_min_duration (PostgreSQL)","description":"PostgreSQL log_autovacuum_min_duration: Log autovacuum runs that take at least this long; -1 disables, 0 logs all. Default: 10min.","body":{"engine":"postgresql","slug":"log-autovacuum-min-duration","name":"log_autovacuum_min_duration","topic":"logging","summary":"Log autovacuum runs that take at least this long; -1 disables, 0 logs all.","detail":"The message includes pages removed, dead tuples left and I/O timing, which shows whether autovacuum is keeping up.","default":"10min","default_note":"10min since PostgreSQL 15 (-1, disabled, before). Same in 18.","range":"-1 to about 24 days, in ms","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW log_autovacuum_min_duration;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_autovacuum_min_duration';","change":"ALTER SYSTEM SET log_autovacuum_min_duration = '1s';\nSELECT pg_reload_conf();","when":"Lower it while investigating bloat or autovacuum throughput.","risk":"0 on databases with many small tables produces a lot of log lines.","related":["autovacuum","autovacuum-vacuum-cost-limit"],"faqs":[{"question":"What is the default value of log_autovacuum_min_duration in PostgreSQL?","answer":"10min. 10min since PostgreSQL 15 (-1, disabled, before). Same in 18."},{"question":"Does changing log_autovacuum_min_duration require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change log_autovacuum_min_duration?","answer":"Lower it while investigating bloat or autovacuum throughput."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-autovacuum-min-duration","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-checkpoints","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_checkpoints (PostgreSQL)","description":"PostgreSQL log_checkpoints: Log each checkpoint with buffers written and timings. Default: on.","body":{"engine":"postgresql","slug":"log-checkpoints","name":"log_checkpoints","topic":"logging","summary":"Log each checkpoint with buffers written and timings.","detail":"Shows whether checkpoints are triggered by time or by WAL volume (max_wal_size) and how long writing and syncing take.","default":"on","default_note":"on since PostgreSQL 15 (off before). Same in 18.","range":"on, off","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW log_checkpoints;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_checkpoints';","change":"ALTER SYSTEM SET log_checkpoints = on;\nSELECT pg_reload_conf();","when":"Leave on. On older versions turn it on.","risk":"One log line per checkpoint, which is negligible; the real failure is silent version skew, where an old postgresql.conf carried through an upgrade keeps log_checkpoints = off and the server loses exactly the diagnostics that explain slow checkpoints.","related":["max-wal-size","checkpoint-timeout"],"faqs":[{"question":"What is the default value of log_checkpoints in PostgreSQL?","answer":"on. on since PostgreSQL 15 (off before). Same in 18."},{"question":"Does changing log_checkpoints require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change log_checkpoints?","answer":"Leave on. On older versions turn it on."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-checkpoints","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-lock-waits","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_lock_waits (PostgreSQL)","description":"PostgreSQL log_lock_waits: Log a message when a session waits longer than deadlock_timeout for a lock. Default: off.","body":{"engine":"postgresql","slug":"log-lock-waits","name":"log_lock_waits","topic":"logging","summary":"Log a message when a session waits longer than deadlock_timeout for a lock.","detail":"The log line names the waiting and the blocking process IDs, which is often the only record of a lock pile-up after it clears.","default":"off","default_note":"off (PostgreSQL 18).","range":"on, off","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW log_lock_waits;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_lock_waits';","change":"SET log_lock_waits = on;   -- this session\n\nALTER SYSTEM SET log_lock_waits = on;\nSELECT pg_reload_conf();","when":"Turn it on in production; the overhead is negligible and it explains intermittent slowness.","risk":"Every wait that passes deadlock_timeout produces at least one log line, so systems with constant short lock waits generate steady log traffic; that volume is the price of knowing which process blocked which, which the default throws away.","related":["deadlock-timeout","lock-timeout"],"faqs":[{"question":"What is the default value of log_lock_waits in PostgreSQL?","answer":"off. off (PostgreSQL 18)."},{"question":"Does changing log_lock_waits require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change log_lock_waits?","answer":"Turn it on in production; the overhead is negligible and it explains intermittent slowness."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-lock-waits","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-min-duration-statement","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_min_duration_statement (PostgreSQL)","description":"PostgreSQL log_min_duration_statement: Log every statement that runs at least this long; -1 disables, 0 logs everything. Default: -1 (disabled).","body":{"engine":"postgresql","slug":"log-min-duration-statement","name":"log_min_duration_statement","topic":"logging","summary":"Log every statement that runs at least this long; -1 disables, 0 logs everything.","detail":"The simplest slow-query log. Combine with pg_stat_statements for aggregates and auto_explain for plans.","default":"-1 (disabled)","default_note":"-1 (PostgreSQL 18).","range":"-1 to about 24 days, in ms","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW log_min_duration_statement;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_min_duration_statement';","change":"SET log_min_duration_statement = '500ms';   -- this session\n\nALTER SYSTEM SET log_min_duration_statement = '500ms';\nSELECT pg_reload_conf();","when":"Turn it on in production at a threshold that logs a manageable number of statements, often 250ms-1s.","risk":"0 on a busy server floods the log and costs I/O. Logged statements include their parameter values, which can contain personal data.","related":["log-lock-waits","log-temp-files","track-io-timing"],"faqs":[{"question":"What is the default value of log_min_duration_statement in PostgreSQL?","answer":"-1 (disabled). -1 (PostgreSQL 18)."},{"question":"Does changing log_min_duration_statement require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change log_min_duration_statement?","answer":"Turn it on in production at a threshold that logs a manageable number of statements, often 250ms-1s."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-min-duration-statement","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-min-error-statement","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_min_error_statement (PostgreSQL)","description":"PostgreSQL log_min_error_statement: Also log the SQL text of every statement that raises an error at this severity or higher. Default: error.","body":{"engine":"postgresql","slug":"log-min-error-statement","name":"log_min_error_statement","topic":"logging","summary":"Also log the SQL text of every statement that raises an error at this severity or higher.","detail":"The counterpart of log_min_duration_statement, which logs slow statements that succeed. At the default, statements causing ERROR, LOG, FATAL or PANIC are logged with their text; set PANIC to stop logging failing statements entirely.","default":"error","default_note":"error (PostgreSQL 18).","range":"debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, panic","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW log_min_error_statement;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_min_error_statement';","change":"SET log_min_error_statement = warning;   -- this session\n\nALTER SYSTEM SET log_min_error_statement = warning;\nSELECT pg_reload_conf();","when":"Raise it to warning or notice while hunting an application error whose SQL you need to see; lower it to panic only on high-volume systems where the application handles errors and logs them itself.","risk":"Every logged statement carries its full text with parameter values filled in, so errors on tables with personal data put that data in the log. The debug levels on a busy server can produce a log line for most statements the application runs.","related":["log-min-duration-statement","log-lock-waits"],"faqs":[{"question":"What is the default value of log_min_error_statement in PostgreSQL?","answer":"error. error (PostgreSQL 18)."},{"question":"Does changing log_min_error_statement require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change log_min_error_statement?","answer":"Raise it to warning or notice while hunting an application error whose SQL you need to see; lower it to panic only on high-volume systems where the application handles errors and logs them itself."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-min-error-statement","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/log-temp-files","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"log_temp_files (PostgreSQL)","description":"PostgreSQL log_temp_files: Log temporary files at or above this size when they are deleted; -1 disables, 0 logs all. Default: -1 (disabled).","body":{"engine":"postgresql","slug":"log-temp-files","name":"log_temp_files","topic":"logging","summary":"Log temporary files at or above this size when they are deleted; -1 disables, 0 logs all.","detail":"Every sort or hash that spills past work_mem creates a temp file; this shows which statements spill and by how much.","default":"-1 (disabled)","default_note":"-1 (PostgreSQL 18).","range":"-1 to 2TB, in kB","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW log_temp_files;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'log_temp_files';","change":"SET log_temp_files = '10MB';   -- this session\n\nALTER SYSTEM SET log_temp_files = '10MB';\nSELECT pg_reload_conf();","when":"Set to a few MB when tuning work_mem.","risk":"0 logs every spilled sort and hash, which on a reporting server means a line per heavy query and extra I/O on the log volume; -1 hides spills completely, and the first sign of trouble is temp disk quietly filling up.","related":["work-mem","temp-file-limit"],"faqs":[{"question":"What is the default value of log_temp_files in PostgreSQL?","answer":"-1 (disabled). -1 (PostgreSQL 18)."},{"question":"Does changing log_temp_files require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change log_temp_files?","answer":"Set to a few MB when tuning work_mem."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/log-temp-files","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/maintenance-work-mem","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"maintenance_work_mem (PostgreSQL)","description":"PostgreSQL maintenance_work_mem: Memory for VACUUM, CREATE INDEX, ALTER TABLE ADD FOREIGN KEY and similar maintenance. Default: 64MB.","body":{"engine":"postgresql","slug":"maintenance-work-mem","name":"maintenance_work_mem","topic":"memory","summary":"Memory for VACUUM, CREATE INDEX, ALTER TABLE ADD FOREIGN KEY and similar maintenance.","detail":"Only one maintenance operation runs per session, so this can be much larger than work_mem. A larger value makes index builds sort in memory and lets VACUUM remember more dead row IDs per pass over the indexes.","default":"64MB","default_note":"64MB (PostgreSQL 18), unchanged since 9.4. From PostgreSQL 17 VACUUM can use more than 1GB of it; earlier versions capped dead-tuple storage at 1GB.","range":"64kB to 2TB","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW maintenance_work_mem;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'maintenance_work_mem';","change":"SET maintenance_work_mem = '1GB';   -- this session\nALTER ROLE reporting SET maintenance_work_mem = '1GB';   -- new sessions of one role\n\nALTER SYSTEM SET maintenance_work_mem = '1GB';\nSELECT pg_reload_conf();","when":"Raise it to 1GB or more on servers with RAM to spare, or SET it in the session that builds a big index.","risk":"Autovacuum workers also use it unless autovacuum_work_mem is set, so autovacuum_max_workers x this value can be allocated at once.","related":["autovacuum-work-mem","work-mem","max-parallel-maintenance-workers"],"faqs":[{"question":"What is the default value of maintenance_work_mem in PostgreSQL?","answer":"64MB. 64MB (PostgreSQL 18), unchanged since 9.4. From PostgreSQL 17 VACUUM can use more than 1GB of it; earlier versions capped dead-tuple storage at 1GB."},{"question":"Does changing maintenance_work_mem require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change maintenance_work_mem?","answer":"Raise it to 1GB or more on servers with RAM to spare, or SET it in the session that builds a big index."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/maintenance-work-mem","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-connections","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_connections (PostgreSQL)","description":"PostgreSQL max_connections: Maximum number of concurrent client connections. Default: 100.","body":{"engine":"postgresql","slug":"max-connections","name":"max_connections","topic":"connections","summary":"Maximum number of concurrent client connections.","detail":"Each connection is a separate backend process with its own memory, and several shared structures (lock table, snapshot arrays) are sized from this number at startup.","default":"100","default_note":"100 (PostgreSQL 18); initdb lowers it if the machine cannot support 100. The Docker image writes 100.","range":"1 to 262143","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW max_connections;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_connections';","change":"ALTER SYSTEM SET max_connections = 200;\n-- applies only after a server restart","when":"When applications legitimately need more sessions. If the count comes from many idle pooled connections, put PgBouncer or the app's pool in front instead; a few hundred active backends is already a lot.","risk":"Every slot costs memory even when idle, and many active backends contend for locks and CPU. Standbys must have max_connections at least as high as the primary.","related":["superuser-reserved-connections","reserved-connections","work-mem"],"faqs":[{"question":"What is the default value of max_connections in PostgreSQL?","answer":"100. 100 (PostgreSQL 18); initdb lowers it if the machine cannot support 100. The Docker image writes 100."},{"question":"Does changing max_connections require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change max_connections?","answer":"When applications legitimately need more sessions. If the count comes from many idle pooled connections, put PgBouncer or the app's pool in front instead; a few hundred active backends is already a lot."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-locks-per-transaction","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_locks_per_transaction (PostgreSQL)","description":"PostgreSQL max_locks_per_transaction: Average number of object locks per transaction used to size the shared lock table. Default: 64.","body":{"engine":"postgresql","slug":"max-locks-per-transaction","name":"max_locks_per_transaction","topic":"behavior","summary":"Average number of object locks per transaction used to size the shared lock table.","detail":"The lock table holds max_locks_per_transaction x (max_connections + max_prepared_transactions) entries. Touching many partitions or tables in one transaction (pg_dump, partitioned tables) uses one lock per relation.","default":"64","default_note":"64 (PostgreSQL 18).","range":"10 to 2147483647","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW max_locks_per_transaction;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_locks_per_transaction';","change":"ALTER SYSTEM SET max_locks_per_transaction = 256;\n-- applies only after a server restart","when":"When you see 'out of shared memory' with a hint to increase max_locks_per_transaction, typically with heavily partitioned tables or pg_dump of thousands of tables.","risk":"Uses a little more shared memory; standbys need at least the primary's value.","related":["max-connections"],"faqs":[{"question":"What is the default value of max_locks_per_transaction in PostgreSQL?","answer":"64. 64 (PostgreSQL 18)."},{"question":"Does changing max_locks_per_transaction require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change max_locks_per_transaction?","answer":"When you see 'out of shared memory' with a hint to increase max_locks_per_transaction, typically with heavily partitioned tables or pg_dump of thousands of tables."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-locks-per-transaction","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-parallel-maintenance-workers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_parallel_maintenance_workers (PostgreSQL)","description":"PostgreSQL max_parallel_maintenance_workers: Parallel workers one CREATE INDEX (B-tree, BRIN, GIN in 18) or VACUUM can use. Default: 2.","body":{"engine":"postgresql","slug":"max-parallel-maintenance-workers","name":"max_parallel_maintenance_workers","topic":"parallelism","summary":"Parallel workers one CREATE INDEX (B-tree, BRIN, GIN in 18) or VACUUM can use.","detail":"Parallel index builds arrived in PostgreSQL 11 for B-tree, BRIN in 17 and GIN in 18; VACUUM can process indexes in parallel from 13 (not autovacuum).","default":"2","default_note":"2 (PostgreSQL 18).","range":"0 to 1024","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW max_parallel_maintenance_workers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_parallel_maintenance_workers';","change":"SET max_parallel_maintenance_workers = 4;   -- this session\nALTER ROLE reporting SET max_parallel_maintenance_workers = 4;   -- new sessions of one role\n\nALTER SYSTEM SET max_parallel_maintenance_workers = 4;\nSELECT pg_reload_conf();","when":"Raise in the session that rebuilds large indexes during a maintenance window.","risk":"The workers share maintenance_work_mem; they also draw from max_parallel_workers.","related":["maintenance-work-mem","max-parallel-workers"],"faqs":[{"question":"What is the default value of max_parallel_maintenance_workers in PostgreSQL?","answer":"2. 2 (PostgreSQL 18)."},{"question":"Does changing max_parallel_maintenance_workers require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change max_parallel_maintenance_workers?","answer":"Raise in the session that rebuilds large indexes during a maintenance window."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-parallel-maintenance-workers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-parallel-workers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_parallel_workers (PostgreSQL)","description":"PostgreSQL max_parallel_workers: Maximum parallel query workers active at once across the server. Default: 8.","body":{"engine":"postgresql","slug":"max-parallel-workers","name":"max_parallel_workers","topic":"parallelism","summary":"Maximum parallel query workers active at once across the server.","detail":"Caps parallel query and parallel maintenance workers together; limited in turn by max_worker_processes.","default":"8","default_note":"8 (PostgreSQL 18).","range":"0 to 1024","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW max_parallel_workers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_parallel_workers';","change":"SET max_parallel_workers = 16;   -- this session\nALTER ROLE reporting SET max_parallel_workers = 16;   -- new sessions of one role\n\nALTER SYSTEM SET max_parallel_workers = 16;\nSELECT pg_reload_conf();","when":"Raise together with max_worker_processes on large machines, typically to the number of cores.","risk":"Too high lets a few big queries take every core away from OLTP traffic.","related":["max-worker-processes","max-parallel-workers-per-gather","max-parallel-maintenance-workers"],"faqs":[{"question":"What is the default value of max_parallel_workers in PostgreSQL?","answer":"8. 8 (PostgreSQL 18)."},{"question":"Does changing max_parallel_workers require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change max_parallel_workers?","answer":"Raise together with max_worker_processes on large machines, typically to the number of cores."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-parallel-workers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-parallel-workers-per-gather","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_parallel_workers_per_gather (PostgreSQL)","description":"PostgreSQL max_parallel_workers_per_gather: Workers a single Gather node may start; 0 disables parallel query. Default: 2.","body":{"engine":"postgresql","slug":"max-parallel-workers-per-gather","name":"max_parallel_workers_per_gather","topic":"parallelism","summary":"Workers a single Gather node may start; 0 disables parallel query.","detail":"The leader process also participates, so 2 workers means up to 3 processes on that plan node. Workers are only used when the planner estimates parallelism pays off (see parallel_setup_cost and min_parallel_table_scan_size).","default":"2","default_note":"2 (PostgreSQL 18).","range":"0 to 1024","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW max_parallel_workers_per_gather;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_parallel_workers_per_gather';","change":"SET max_parallel_workers_per_gather = 4;   -- this session\nALTER ROLE reporting SET max_parallel_workers_per_gather = 4;   -- new sessions of one role\n\nALTER SYSTEM SET max_parallel_workers_per_gather = 4;\nSELECT pg_reload_conf();","when":"Raise for analytics roles or reporting sessions on machines with idle cores; set to 0 for latency-sensitive OLTP roles if parallel plans cause jitter.","risk":"Every worker gets its own work_mem per node, so memory use rises with parallelism.","related":["max-parallel-workers","work-mem"],"faqs":[{"question":"What is the default value of max_parallel_workers_per_gather in PostgreSQL?","answer":"2. 2 (PostgreSQL 18)."},{"question":"Does changing max_parallel_workers_per_gather require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change max_parallel_workers_per_gather?","answer":"Raise for analytics roles or reporting sessions on machines with idle cores; set to 0 for latency-sensitive OLTP roles if parallel plans cause jitter."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-parallel-workers-per-gather","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-slot-wal-keep-size","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_slot_wal_keep_size (PostgreSQL)","description":"PostgreSQL max_slot_wal_keep_size: Most WAL a replication slot may hold back before it is invalidated; -1 is unlimited. Default: -1 (unlimited).","body":{"engine":"postgresql","slug":"max-slot-wal-keep-size","name":"max_slot_wal_keep_size","topic":"durability","summary":"Most WAL a replication slot may hold back before it is invalidated; -1 is unlimited.","detail":"A replication slot keeps WAL until its consumer has received it. With an abandoned slot or a stalled subscriber, WAL grows until the disk fills. This setting caps it (PostgreSQL 13 and later).","default":"-1 (unlimited)","default_note":"-1 (PostgreSQL 18).","range":"-1, or 0MB to 2PB","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW max_slot_wal_keep_size;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_slot_wal_keep_size';","change":"ALTER SYSTEM SET max_slot_wal_keep_size = '100GB';\nSELECT pg_reload_conf();","when":"On every server that uses replication slots (logical replication, CDC tools, standbys with slots). Size it to the disk you can spare.","risk":"When the limit is hit the slot is invalidated and the subscriber or standby must be re-synced.","related":["wal-level","max-wal-size"],"faqs":[{"question":"What is the default value of max_slot_wal_keep_size in PostgreSQL?","answer":"-1 (unlimited). -1 (PostgreSQL 18)."},{"question":"Does changing max_slot_wal_keep_size require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change max_slot_wal_keep_size?","answer":"On every server that uses replication slots (logical replication, CDC tools, standbys with slots). Size it to the disk you can spare."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-slot-wal-keep-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-wal-senders","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_wal_senders (PostgreSQL)","description":"PostgreSQL max_wal_senders: How many clients can stream WAL from this server at the same time. Default: 10.","body":{"engine":"postgresql","slug":"max-wal-senders","name":"max_wal_senders","topic":"durability","summary":"How many clients can stream WAL from this server at the same time.","detail":"Each physical standby, pg_basebackup run and logical replication subscriber holds one sender process while it works, and wal_level = minimal requires this to be 0. A streaming client that disconnects abruptly can hold its sender slot until wal_sender_timeout (60s) expires.","default":"10","default_note":"10 (PostgreSQL 18), unchanged since PostgreSQL 10.","range":"0 to 262143","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW max_wal_senders;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_wal_senders';","change":"ALTER SYSTEM SET max_wal_senders = 20;\n-- applies only after a server restart","when":"Count one per concurrent standby plus one per base backup in flight, then add headroom for reconnects; the docs suggest setting it slightly above the expected client count for exactly that orphaned-slot reason.","risk":"Run out and a standby or pg_basebackup connect fails with 'number of requested standby connections exceeds max_wal_senders'. A value of 0 disables replication outright, and with wal_level = minimal the server refuses to start unless this is 0.","related":["wal-level","max-slot-wal-keep-size","max-connections"],"faqs":[{"question":"What is the default value of max_wal_senders in PostgreSQL?","answer":"10. 10 (PostgreSQL 18), unchanged since PostgreSQL 10."},{"question":"Does changing max_wal_senders require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change max_wal_senders?","answer":"Count one per concurrent standby plus one per base backup in flight, then add headroom for reconnects; the docs suggest setting it slightly above the expected client count for exactly that orphaned-slot reason."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-wal-senders","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-wal-size","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_wal_size (PostgreSQL)","description":"PostgreSQL max_wal_size: WAL volume that triggers a checkpoint before checkpoint_timeout is reached. Default: 1GB.","body":{"engine":"postgresql","slug":"max-wal-size","name":"max_wal_size","topic":"checkpoints","summary":"WAL volume that triggers a checkpoint before checkpoint_timeout is reached.","detail":"A soft limit: when this much WAL accumulates since the last checkpoint, a new one starts. Larger values mean fewer checkpoints and fewer full-page writes, at the cost of longer crash recovery and more disk for pg_wal.","default":"1GB","default_note":"1GB (PostgreSQL 18); initdb writes 1GB into postgresql.conf.","range":"2MB to about 2PB","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW max_wal_size;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_wal_size';","change":"ALTER SYSTEM SET max_wal_size = '16GB';\nSELECT pg_reload_conf();","when":"If the log shows 'checkpoints are occurring too frequently' or pg_stat_checkpointer (pg_stat_bgwriter before 17) shows many requested checkpoints. Busy write workloads commonly use 8-64GB.","risk":"pg_wal can grow past this during bursts; make sure the volume has room. Crash recovery replays up to this much WAL.","related":["min-wal-size","checkpoint-timeout","checkpoint-completion-target"],"faqs":[{"question":"What is the default value of max_wal_size in PostgreSQL?","answer":"1GB. 1GB (PostgreSQL 18); initdb writes 1GB into postgresql.conf."},{"question":"Does changing max_wal_size require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change max_wal_size?","answer":"If the log shows 'checkpoints are occurring too frequently' or pg_stat_checkpointer (pg_stat_bgwriter before 17) shows many requested checkpoints. Busy write workloads commonly use 8-64GB."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-wal-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/max-worker-processes","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"max_worker_processes (PostgreSQL)","description":"PostgreSQL max_worker_processes: Total background worker processes the server can run. Default: 8.","body":{"engine":"postgresql","slug":"max-worker-processes","name":"max_worker_processes","topic":"parallelism","summary":"Total background worker processes the server can run.","detail":"The pool that parallel query workers, logical replication workers and extension background workers all draw from. max_parallel_workers cannot exceed it in practice.","default":"8","default_note":"8 (PostgreSQL 18).","range":"0 to 262143","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW max_worker_processes;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'max_worker_processes';","change":"ALTER SYSTEM SET max_worker_processes = 16;\n-- applies only after a server restart","when":"On machines with more than 8 cores that run parallel queries, or when extensions (pg_cron, TimescaleDB) need background workers. Standbys must have at least the primary's value.","risk":"Each worker is a process with its own memory; the setting itself only reserves slots.","related":["max-parallel-workers","max-parallel-workers-per-gather"],"faqs":[{"question":"What is the default value of max_worker_processes in PostgreSQL?","answer":"8. 8 (PostgreSQL 18)."},{"question":"Does changing max_worker_processes require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change max_worker_processes?","answer":"On machines with more than 8 cores that run parallel queries, or when extensions (pg_cron, TimescaleDB) need background workers. Standbys must have at least the primary's value."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/max-worker-processes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/min-wal-size","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"min_wal_size (PostgreSQL)","description":"PostgreSQL min_wal_size: WAL kept as recycled segments instead of being removed after a checkpoint. Default: 80MB.","body":{"engine":"postgresql","slug":"min-wal-size","name":"min_wal_size","topic":"checkpoints","summary":"WAL kept as recycled segments instead of being removed after a checkpoint.","detail":"Below this size, old WAL files are renamed for reuse rather than deleted, which absorbs write bursts without creating new files.","default":"80MB","default_note":"80MB (PostgreSQL 18).","range":"2MB to about 2PB","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW min_wal_size;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'min_wal_size';","change":"ALTER SYSTEM SET min_wal_size = '2GB';\nSELECT pg_reload_conf();","when":"Raise it on servers with periodic write spikes, such as batch loads.","risk":"The disk is committed to pg_wal permanently, so a large value on a small pg_wal volume is pure waste; the sharper failure is the opposite, a low value on a write-burst server that churns through segment creation and deletion at every spike.","related":["max-wal-size"],"faqs":[{"question":"What is the default value of min_wal_size in PostgreSQL?","answer":"80MB. 80MB (PostgreSQL 18)."},{"question":"Does changing min_wal_size require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change min_wal_size?","answer":"Raise it on servers with periodic write spikes, such as batch loads."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/min-wal-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/password-encryption","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"password_encryption (PostgreSQL)","description":"PostgreSQL password_encryption: How CREATE ROLE and ALTER ROLE store new passwords: SCRAM-SHA-256 or the legacy MD5 hash. Default: scram-sha-256.","body":{"engine":"postgresql","slug":"password-encryption","name":"password_encryption","topic":"security","summary":"How CREATE ROLE and ALTER ROLE store new passwords: SCRAM-SHA-256 or the legacy MD5 hash.","detail":"SCRAM-SHA-256 is the default and the only format to choose on a new server. MD5 is deprecated and slated for removal; PostgreSQL 18 already warns when a statement sets an MD5 password (md5_password_warnings, on by default).","default":"scram-sha-256","default_note":"scram-sha-256 since PostgreSQL 14 (md5 before). Same in PostgreSQL 18.","range":"scram-sha-256, md5","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW password_encryption;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'password_encryption';","change":"SET password_encryption = 'scram-sha-256';   -- this session\nALTER ROLE reporting SET password_encryption = 'scram-sha-256';   -- new sessions of one role\n\nALTER SYSTEM SET password_encryption = 'scram-sha-256';\nSELECT pg_reload_conf();","when":"Leave it alone; check it after restoring or migrating from old servers, where an md5 value can ride along and silently hash every password you reset from then on.","risk":"It affects only future passwords: existing roles keep their old verifier until they set a new one. A role whose stored verifier is still MD5 cannot log in where pg_hba.conf demands scram-sha-256, which is the usual post-migration 'password authentication failed'.","related":["ssl"],"faqs":[{"question":"What is the default value of password_encryption in PostgreSQL?","answer":"scram-sha-256. scram-sha-256 since PostgreSQL 14 (md5 before). Same in PostgreSQL 18."},{"question":"Does changing password_encryption require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change password_encryption?","answer":"Leave it alone; check it after restoring or migrating from old servers, where an md5 value can ride along and silently hash every password you reset from then on."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/password-encryption","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/random-page-cost","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"random_page_cost (PostgreSQL)","description":"PostgreSQL random_page_cost: Planner cost of a non-sequential page read, relative to seq_page_cost (1.0). Default: 4.0.","body":{"engine":"postgresql","slug":"random-page-cost","name":"random_page_cost","topic":"optimizer","summary":"Planner cost of a non-sequential page read, relative to seq_page_cost (1.0).","detail":"The default 4.0 models spinning disks with mostly cached data. On SSDs random reads cost little more than sequential ones, and a high value makes the planner shy away from index scans.","default":"4.0","default_note":"4.0 (PostgreSQL 18); seq_page_cost is 1.0.","range":"0 upward (float)","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW random_page_cost;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'random_page_cost';","change":"SET random_page_cost = 1.1;   -- this session\nALTER ROLE reporting SET random_page_cost = 1.1;   -- new sessions of one role\n\nALTER SYSTEM SET random_page_cost = 1.1;\nSELECT pg_reload_conf();","when":"On SSD, NVMe or cloud storage, 1.1-1.5 is common. Can also be set per tablespace.","risk":"Too low leads to index scans on data that is not cached and not fast to read randomly.","related":["effective-cache-size","effective-io-concurrency"],"faqs":[{"question":"What is the default value of random_page_cost in PostgreSQL?","answer":"4.0. 4.0 (PostgreSQL 18); seq_page_cost is 1.0."},{"question":"Does changing random_page_cost require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change random_page_cost?","answer":"On SSD, NVMe or cloud storage, 1.1-1.5 is common. Can also be set per tablespace."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/random-page-cost","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/reserved-connections","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"reserved_connections (PostgreSQL)","description":"PostgreSQL reserved_connections: Connection slots kept back for roles granted pg_use_reserved_connections. Default: 0.","body":{"engine":"postgresql","slug":"reserved-connections","name":"reserved_connections","topic":"connections","summary":"Connection slots kept back for roles granted pg_use_reserved_connections.","detail":"Added in PostgreSQL 16 so monitoring or replication-management roles can keep a guaranteed slot without being superusers. Both kinds of reserved slot come out of max_connections: once free slots fall to superuser_reserved_connections + reserved_connections, only superusers and pg_use_reserved_connections members can connect.","default":"0","default_note":"0 (PostgreSQL 18); the parameter exists from PostgreSQL 16.","range":"0 to 262143","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW reserved_connections;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'reserved_connections';","change":"ALTER SYSTEM SET reserved_connections = 3;\n-- applies only after a server restart","when":"When a non-superuser monitoring or operations role must always be able to connect.","risk":"Reserved slots are unavailable to the application, so its effective limit drops by this amount.","related":["max-connections","superuser-reserved-connections"],"faqs":[{"question":"What is the default value of reserved_connections in PostgreSQL?","answer":"0. 0 (PostgreSQL 18); the parameter exists from PostgreSQL 16."},{"question":"Does changing reserved_connections require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change reserved_connections?","answer":"When a non-superuser monitoring or operations role must always be able to connect."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/reserved-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/shared-buffers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"shared_buffers (PostgreSQL)","description":"PostgreSQL shared_buffers: Size of PostgreSQL's own page cache, shared by all sessions. Default: 128MB.","body":{"engine":"postgresql","slug":"shared-buffers","name":"shared_buffers","topic":"memory","summary":"Size of PostgreSQL's own page cache, shared by all sessions.","detail":"Every table and index page is read through shared buffers. PostgreSQL also relies on the OS page cache, so a page can be cached twice; that is why the usual starting point is about 25% of RAM rather than most of it. The value is allocated at startup as one shared memory segment.","default":"128MB","default_note":"Compiled-in default is 128MB (PostgreSQL 18); initdb writes 128MB into postgresql.conf, or less if the machine's shared memory is too small. The official Docker image keeps 128MB.","range":"128kB to about 8TB, in 8kB pages (minimum 16 pages)","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW shared_buffers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'shared_buffers';","change":"ALTER SYSTEM SET shared_buffers = '4GB';\n-- applies only after a server restart","when":"Almost always, on any server with more than a couple of GB of RAM. Start at 25% of RAM on a dedicated host, then compare the buffer hit ratio in pg_stat_database and pg_statio_user_tables before going much higher.","risk":"Too large leaves little room for the OS cache and per-query work_mem, and checkpoints have more dirty pages to write. Above roughly 8-16GB, enable huge pages or the page tables themselves get expensive.","related":["effective-cache-size","huge-pages","work-mem","wal-buffers"],"faqs":[{"question":"What is the default value of shared_buffers in PostgreSQL?","answer":"128MB. Compiled-in default is 128MB (PostgreSQL 18); initdb writes 128MB into postgresql.conf, or less if the machine's shared memory is too small. The official Docker image keeps 128MB."},{"question":"Does changing shared_buffers require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change shared_buffers?","answer":"Almost always, on any server with more than a couple of GB of RAM. Start at 25% of RAM on a dedicated host, then compare the buffer hit ratio in pg_stat_database and pg_statio_user_tables before going much higher."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/shared-buffers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/shared-preload-libraries","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"shared_preload_libraries (PostgreSQL)","description":"PostgreSQL shared_preload_libraries: Libraries loaded into the server at startup, such as pg_stat_statements or auto_explain. Default: '' (empty).","body":{"engine":"postgresql","slug":"shared-preload-libraries","name":"shared_preload_libraries","topic":"behavior","summary":"Libraries loaded into the server at startup, such as pg_stat_statements or auto_explain.","detail":"Extensions that need shared memory or hooks at startup must be listed here before CREATE EXTENSION works fully.","default":"'' (empty)","default_note":"Empty (PostgreSQL 18). Managed services usually preload pg_stat_statements.","range":"Comma-separated library names","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW shared_preload_libraries;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'shared_preload_libraries';","change":"ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements,auto_explain';\n-- applies only after a server restart","when":"Add pg_stat_statements on every server you care about; it is the most useful single diagnostic.","risk":"A misspelled or missing library prevents the server from starting.","related":["max-locks-per-transaction"],"faqs":[{"question":"What is the default value of shared_preload_libraries in PostgreSQL?","answer":"'' (empty). Empty (PostgreSQL 18). Managed services usually preload pg_stat_statements."},{"question":"Does changing shared_preload_libraries require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change shared_preload_libraries?","answer":"Add pg_stat_statements on every server you care about; it is the most useful single diagnostic."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/shared-preload-libraries","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/ssl","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"ssl (PostgreSQL)","description":"PostgreSQL ssl: Accept TLS connections on the normal PostgreSQL port. Default: off.","body":{"engine":"postgresql","slug":"ssl","name":"ssl","topic":"security","summary":"Accept TLS connections on the normal PostgreSQL port.","detail":"Needs a certificate (ssl_cert_file, default server.crt) and matching private key (ssl_key_file, default server.key), normally in the data directory. Turning ssl on does not force clients to use TLS; a hostssl line in pg_hba.conf does.","default":"off","default_note":"off (PostgreSQL 18). The official Docker image ships no certificates, so it stays off unless you mount them.","range":"on, off","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW ssl;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'ssl';","change":"ALTER SYSTEM SET ssl = on;\nSELECT pg_reload_conf();","when":"On any server whose traffic crosses a network you do not control, together with hostssl rules in pg_hba.conf and password_encryption = scram-sha-256.","risk":"A server.key that is not owned by the server's OS user, or readable by group or others, fails the start or the reload with a permission error, and a failed reload keeps the old settings running. With ssl on but no hostssl rules, clients that never ask for TLS keep connecting in the clear.","related":["password-encryption","listen-addresses"],"faqs":[{"question":"What is the default value of ssl in PostgreSQL?","answer":"off. off (PostgreSQL 18). The official Docker image ships no certificates, so it stays off unless you mount them."},{"question":"Does changing ssl require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change ssl?","answer":"On any server whose traffic crosses a network you do not control, together with hostssl rules in pg_hba.conf and password_encryption = scram-sha-256."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/ssl","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/statement-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"statement_timeout (PostgreSQL)","description":"PostgreSQL statement_timeout: Abort any statement that runs longer than this; 0 disables. Default: 0 (disabled).","body":{"engine":"postgresql","slug":"statement-timeout","name":"statement_timeout","topic":"timeouts","summary":"Abort any statement that runs longer than this; 0 disables.","detail":"Measured from when the command arrives at the server. Each statement in a multi-statement query string gets its own limit; statements run inside a function count toward the statement that called it. Best set per role or per database rather than server-wide.","default":"0 (disabled)","default_note":"0 (PostgreSQL 18).","range":"0 to about 24 days, in ms","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW statement_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'statement_timeout';","change":"SET statement_timeout = '30s';   -- this session\nALTER ROLE reporting SET statement_timeout = '30s';   -- new sessions of one role\n\nALTER SYSTEM SET statement_timeout = '30s';\nSELECT pg_reload_conf();","when":"Set it for application and reporting roles (ALTER ROLE app SET statement_timeout = '30s') so a bad query cannot run for hours.","risk":"Server-wide it also cancels legitimate long jobs: index builds, migrations and batch jobs need it overridden (pg_dump already sets it to 0 for its own session).","related":["lock-timeout","idle-in-transaction-session-timeout","transaction-timeout"],"faqs":[{"question":"What is the default value of statement_timeout in PostgreSQL?","answer":"0 (disabled). 0 (PostgreSQL 18)."},{"question":"Does changing statement_timeout require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change statement_timeout?","answer":"Set it for application and reporting roles (ALTER ROLE app SET statement_timeout = '30s') so a bad query cannot run for hours."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/statement-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/superuser-reserved-connections","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"superuser_reserved_connections (PostgreSQL)","description":"PostgreSQL superuser_reserved_connections: Connection slots kept back for superusers. Default: 3.","body":{"engine":"postgresql","slug":"superuser-reserved-connections","name":"superuser_reserved_connections","topic":"connections","summary":"Connection slots kept back for superusers.","detail":"When max_connections minus these slots is reached, only superusers can connect, so an administrator can still get in to kill runaway sessions.","default":"3","default_note":"3 (PostgreSQL 18).","range":"0 to 262143, less than max_connections","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW superuser_reserved_connections;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'superuser_reserved_connections';","change":"ALTER SYSTEM SET superuser_reserved_connections = 5;\n-- applies only after a server restart","when":"Rarely. Raise it if monitoring and admin tools connecting as superuser regularly use up the 3 slots.","risk":"Setting it to 0 means a connection storm can lock administrators out.","related":["max-connections","reserved-connections"],"faqs":[{"question":"What is the default value of superuser_reserved_connections in PostgreSQL?","answer":"3. 3 (PostgreSQL 18)."},{"question":"Does changing superuser_reserved_connections require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change superuser_reserved_connections?","answer":"Rarely. Raise it if monitoring and admin tools connecting as superuser regularly use up the 3 slots."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/superuser-reserved-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/synchronous-commit","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"synchronous_commit (PostgreSQL)","description":"PostgreSQL synchronous_commit: Whether COMMIT waits for its WAL to reach disk (and standbys) before reporting success. Default: on.","body":{"engine":"postgresql","slug":"synchronous-commit","name":"synchronous_commit","topic":"durability","summary":"Whether COMMIT waits for its WAL to reach disk (and standbys) before reporting success.","detail":"on waits for the local WAL flush and, with synchronous standbys, their flush. off returns before the flush: a crash can lose the last few hundred milliseconds of commits (up to three times wal_writer_delay) but never corrupts data. local, remote_write and remote_apply choose how far a synchronous standby must get.","default":"on","default_note":"on (PostgreSQL 18).","range":"on, off, local, remote_write, remote_apply","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW synchronous_commit;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'synchronous_commit';","change":"SET synchronous_commit = off;   -- this session\nALTER ROLE reporting SET synchronous_commit = off;   -- new sessions of one role\n\nALTER SYSTEM SET synchronous_commit = off;\nSELECT pg_reload_conf();","when":"Turn it off per transaction (SET LOCAL synchronous_commit = off) for data you can afford to lose, such as logs or metrics, to cut commit latency without risking the rest.","risk":"off loses acknowledged commits on a crash. Unlike fsync = off, it cannot corrupt the database.","related":["wal-level","wal-buffers","full-page-writes"],"faqs":[{"question":"What is the default value of synchronous_commit in PostgreSQL?","answer":"on. on (PostgreSQL 18)."},{"question":"Does changing synchronous_commit require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change synchronous_commit?","answer":"Turn it off per transaction (SET LOCAL synchronous_commit = off) for data you can afford to lose, such as logs or metrics, to cut commit latency without risking the rest."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/synchronous-commit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/tcp-keepalives-idle","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"tcp_keepalives_idle (PostgreSQL)","description":"PostgreSQL tcp_keepalives_idle: Seconds of connection inactivity before the server probes the client with TCP keepalives. Default: 0 (OS default).","body":{"engine":"postgresql","slug":"tcp-keepalives-idle","name":"tcp_keepalives_idle","topic":"connections","summary":"Seconds of connection inactivity before the server probes the client with TCP keepalives.","detail":"0 uses the OS default, commonly 2 hours. The probe rhythm is tuned by tcp_keepalives_interval and, where the OS allows it, tcp_keepalives_count. It covers the server's own socket: with PgBouncer in front, it applies to the pooler-to-server leg, not client to pooler.","default":"0 (OS default)","default_note":"0, the OS default (PostgreSQL 18).","range":"0, or 1 second upward; the accepted maximum is platform dependent","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW tcp_keepalives_idle;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'tcp_keepalives_idle';","change":"SET tcp_keepalives_idle = 60;   -- this session\nALTER ROLE reporting SET tcp_keepalives_idle = 60;   -- new sessions of one role\n\nALTER SYSTEM SET tcp_keepalives_idle = 60;\nSELECT pg_reload_conf();","when":"Behind NAT gateways or stateful firewalls that drop idle sessions after a few minutes, a 60s idle time keeps the mapping alive. Also useful to notice dead clients faster than the OS default.","risk":"On systems without the needed socket options it must stay 0, and a nonzero value is rejected when the SET runs. On Windows, 0 does not mean the OS default but a hard 2 hours, because Windows cannot read the system value; Unix-socket sessions ignore it and report 0.","related":["idle-session-timeout","idle-in-transaction-session-timeout"],"faqs":[{"question":"What is the default value of tcp_keepalives_idle in PostgreSQL?","answer":"0 (OS default). 0, the OS default (PostgreSQL 18)."},{"question":"Does changing tcp_keepalives_idle require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change tcp_keepalives_idle?","answer":"Behind NAT gateways or stateful firewalls that drop idle sessions after a few minutes, a 60s idle time keeps the mapping alive. Also useful to notice dead clients faster than the OS default."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/tcp-keepalives-idle","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/temp-buffers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"temp_buffers (PostgreSQL)","description":"PostgreSQL temp_buffers: Per-session buffer cache for temporary tables. Default: 8MB.","body":{"engine":"postgresql","slug":"temp-buffers","name":"temp_buffers","topic":"memory","summary":"Per-session buffer cache for temporary tables.","detail":"Temporary tables bypass shared_buffers. Each session allocates up to this much, and only if it uses temporary tables.","default":"8MB","default_note":"8MB (PostgreSQL 18).","range":"800kB to 8TB, in 8kB pages","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW temp_buffers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'temp_buffers';","change":"SET temp_buffers = '64MB';   -- this session\nALTER ROLE reporting SET temp_buffers = '64MB';   -- new sessions of one role\n\nALTER SYSTEM SET temp_buffers = '64MB';\nSELECT pg_reload_conf();","when":"For sessions that build large temporary tables. Set it before the session first touches a temporary table; changes after that are accepted without error but have no effect for the rest of the session.","risk":"Low: memory is only taken when used. Large values on many sessions that all use temp tables add up.","related":["work-mem"],"faqs":[{"question":"What is the default value of temp_buffers in PostgreSQL?","answer":"8MB. 8MB (PostgreSQL 18)."},{"question":"Does changing temp_buffers require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change temp_buffers?","answer":"For sessions that build large temporary tables. Set it before the session first touches a temporary table; changes after that are accepted without error but have no effect for the rest of the session."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/temp-buffers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/temp-file-limit","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"temp_file_limit (PostgreSQL)","description":"PostgreSQL temp_file_limit: Most temporary-file space one process may use; -1 is unlimited. Default: -1 (unlimited).","body":{"engine":"postgresql","slug":"temp-file-limit","name":"temp_file_limit","topic":"temp","summary":"Most temporary-file space one process may use; -1 is unlimited.","detail":"Stops a single runaway sort or hash join from filling the disk. A query that exceeds it is cancelled.","default":"-1 (unlimited)","default_note":"-1 (PostgreSQL 18).","range":"-1 to 2TB, in kB","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW temp_file_limit;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'temp_file_limit';","change":"SET temp_file_limit = '50GB';   -- this session\n\nALTER SYSTEM SET temp_file_limit = '50GB';\nSELECT pg_reload_conf();","when":"On shared servers where one bad query filling the data volume would take the database down.","risk":"A query that crosses the limit is cancelled with 'temporary file size exceeds temp_file_limit', so legitimate large sorts die too when the value is undersized; -1 instead lets one runaway query fill the temp volume and take other sessions down with it.","related":["work-mem","log-temp-files"],"faqs":[{"question":"What is the default value of temp_file_limit in PostgreSQL?","answer":"-1 (unlimited). -1 (PostgreSQL 18)."},{"question":"Does changing temp_file_limit require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change temp_file_limit?","answer":"On shared servers where one bad query filling the data volume would take the database down."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/temp-file-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/track-io-timing","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"track_io_timing (PostgreSQL)","description":"PostgreSQL track_io_timing: Collect timing for data file reads and writes. Default: off.","body":{"engine":"postgresql","slug":"track-io-timing","name":"track_io_timing","topic":"logging","summary":"Collect timing for data file reads and writes.","detail":"Adds I/O time to EXPLAIN (ANALYZE, BUFFERS), pg_stat_statements and pg_stat_database. Costs two clock reads per I/O.","default":"off","default_note":"off (PostgreSQL 18).","range":"on, off","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW track_io_timing;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'track_io_timing';","change":"SET track_io_timing = on;   -- this session\n\nALTER SYSTEM SET track_io_timing = on;\nSELECT pg_reload_conf();","when":"Turn it on unless pg_test_timing shows slow clock reads on your platform; on modern Linux the cost is negligible.","risk":"Every block read and write pays extra clock reads, and on platforms where pg_test_timing shows slow timing, such as some VMs, that overhead lands on every query; leaving it off instead hides I/O time from EXPLAIN (ANALYZE, BUFFERS) and pg_stat_statements.","related":["log-min-duration-statement"],"faqs":[{"question":"What is the default value of track_io_timing in PostgreSQL?","answer":"off. off (PostgreSQL 18)."},{"question":"Does changing track_io_timing require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change track_io_timing?","answer":"Turn it on unless pg_test_timing shows slow clock reads on your platform; on modern Linux the cost is negligible."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/track-io-timing","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/transaction-timeout","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"transaction_timeout (PostgreSQL)","description":"PostgreSQL transaction_timeout: Terminate any session whose transaction has run longer than this; 0 disables. Default: 0 (disabled).","body":{"engine":"postgresql","slug":"transaction-timeout","name":"transaction_timeout","topic":"timeouts","summary":"Terminate any session whose transaction has run longer than this; 0 disables.","detail":"Added in PostgreSQL 17. Covers explicit transactions and single statements outside one. Like idle_in_transaction_session_timeout, it ends the session.","default":"0 (disabled)","default_note":"0 (PostgreSQL 18); the parameter exists from PostgreSQL 17.","range":"0 to about 24 days, in ms","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW transaction_timeout;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'transaction_timeout';","change":"SET transaction_timeout = '10min';   -- this session\nALTER ROLE reporting SET transaction_timeout = '10min';   -- new sessions of one role\n\nALTER SYSTEM SET transaction_timeout = '10min';\nSELECT pg_reload_conf();","when":"For roles that should never hold a transaction open long, so their snapshots cannot block vacuum.","risk":"Ends the session, so a long batch job under that role fails outright.","related":["statement-timeout","idle-in-transaction-session-timeout"],"faqs":[{"question":"What is the default value of transaction_timeout in PostgreSQL?","answer":"0 (disabled). 0 (PostgreSQL 18); the parameter exists from PostgreSQL 17."},{"question":"Does changing transaction_timeout require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change transaction_timeout?","answer":"For roles that should never hold a transaction open long, so their snapshots cannot block vacuum."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/transaction-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/vacuum-cost-delay","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"vacuum_cost_delay (PostgreSQL)","description":"PostgreSQL vacuum_cost_delay: How long VACUUM sleeps each time it exhausts its I/O cost budget; 0 runs unthrottled. Default: 0 (unthrottled).","body":{"engine":"postgresql","slug":"vacuum-cost-delay","name":"vacuum_cost_delay","topic":"maintenance","summary":"How long VACUUM sleeps each time it exhausts its I/O cost budget; 0 runs unthrottled.","detail":"Cost-based vacuum spreads a manual VACUUM's writes over time instead of taking all the bandwidth it can, one budget of vacuum_cost_limit (200) per process. Autovacuum keeps its own delay, autovacuum_vacuum_cost_delay (2ms), unless that is set to -1 to inherit this value.","default":"0 (unthrottled)","default_note":"0 (PostgreSQL 18); the default has been 0 since PostgreSQL 12 (it was 20ms).","range":"0 to 100ms","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW vacuum_cost_delay;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'vacuum_cost_delay';","change":"SET vacuum_cost_delay = '2ms';   -- this session\nALTER ROLE reporting SET vacuum_cost_delay = '2ms';   -- new sessions of one role\n\nALTER SYSTEM SET vacuum_cost_delay = '2ms';\nSELECT pg_reload_conf();","when":"SET it in the session running a deliberate VACUUM on a busy server during business hours; 1-2ms is usually enough to keep VACUUM from dominating the disk.","risk":"A few milliseconds of delay per cost budget caps VACUUM far below what the disk can do, so a vacuum that would finish in minutes can take hours. Operations holding critical locks skip the delay, so the throttle never becomes a hard bound on vacuum progress.","related":["autovacuum-vacuum-cost-limit","autovacuum-max-workers","maintenance-work-mem"],"faqs":[{"question":"What is the default value of vacuum_cost_delay in PostgreSQL?","answer":"0 (unthrottled). 0 (PostgreSQL 18); the default has been 0 since PostgreSQL 12 (it was 20ms)."},{"question":"Does changing vacuum_cost_delay require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change vacuum_cost_delay?","answer":"SET it in the session running a deliberate VACUUM on a busy server during business hours; 1-2ms is usually enough to keep VACUUM from dominating the disk."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/vacuum-cost-delay","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/wal-buffers","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"wal_buffers (PostgreSQL)","description":"PostgreSQL wal_buffers: Shared memory for WAL not yet written to disk; -1 sizes it automatically. Default: -1 (auto).","body":{"engine":"postgresql","slug":"wal-buffers","name":"wal_buffers","topic":"durability","summary":"Shared memory for WAL not yet written to disk; -1 sizes it automatically.","detail":"-1 means 1/32 of shared_buffers, at least 64kB and at most one WAL segment (16MB by default). With shared_buffers at 128MB that is 4MB.","default":"-1 (auto)","default_note":"-1 (PostgreSQL 18); with the default 128MB shared_buffers it resolves to 4MB.","range":"-1, or 32kB to about 2GB (smaller positive values are raised to 32kB)","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW wal_buffers;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'wal_buffers';","change":"ALTER SYSTEM SET wal_buffers = '64MB';\n-- applies only after a server restart","when":"Rarely: the auto value is right for most servers. Very write-heavy servers with many concurrent commits sometimes gain from 64MB.","risk":"Too small and backends spend more time waiting on WAL buffer space during bursts of concurrent commits; too large just reserves idle shared memory. Any change needs a restart.","related":["shared-buffers","synchronous-commit"],"faqs":[{"question":"What is the default value of wal_buffers in PostgreSQL?","answer":"-1 (auto). -1 (PostgreSQL 18); with the default 128MB shared_buffers it resolves to 4MB."},{"question":"Does changing wal_buffers require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change wal_buffers?","answer":"Rarely: the auto value is right for most servers. Very write-heavy servers with many concurrent commits sometimes gain from 64MB."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/wal-buffers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/wal-compression","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"wal_compression (PostgreSQL)","description":"PostgreSQL wal_compression: Compress full-page images written to the WAL. Default: off.","body":{"engine":"postgresql","slug":"wal-compression","name":"wal_compression","topic":"durability","summary":"Compress full-page images written to the WAL.","detail":"Full-page writes are often most of the WAL volume after a checkpoint. Compressing them trades CPU for less WAL, less replication traffic and smaller archives. lz4 and zstd are available from PostgreSQL 15 if the server was built with them.","default":"off","default_note":"off (PostgreSQL 18).","range":"off, on (pglz), pglz, lz4, zstd","restart_required":false,"apply":"No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser).","view":"SHOW wal_compression;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'wal_compression';","change":"SET wal_compression = lz4;   -- this session\n\nALTER SYSTEM SET wal_compression = lz4;\nSELECT pg_reload_conf();","when":"On write-heavy servers where WAL volume, replication lag or archive size is a problem; lz4 costs little CPU.","risk":"Compressing every full-page image costs CPU exactly at checkpoint-heavy moments, so on a CPU-saturated server the throughput loss can cancel the WAL savings; measure both sides before switching it on. zstd compresses better than lz4 and costs more.","related":["full-page-writes","max-wal-size"],"faqs":[{"question":"What is the default value of wal_compression in PostgreSQL?","answer":"off. off (PostgreSQL 18)."},{"question":"Does changing wal_compression require a restart?","answer":"No. No restart. Superusers, or roles granted SET on the parameter (PostgreSQL 15 and later), can SET it per session; a server-wide ALTER SYSTEM change applies after a reload (context is superuser)."},{"question":"When should I change wal_compression?","answer":"On write-heavy servers where WAL volume, replication lag or archive size is a problem; lz4 costs little CPU."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/wal-compression","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/wal-keep-size","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"wal_keep_size (PostgreSQL)","description":"PostgreSQL wal_keep_size: WAL held back in pg_wal so a streaming standby that reconnects can catch up. Default: 0.","body":{"engine":"postgresql","slug":"wal-keep-size","name":"wal_keep_size","topic":"durability","summary":"WAL held back in pg_wal so a streaming standby that reconnects can catch up.","detail":"The minimum size of past WAL segments reserved for standby servers. A standby that disconnects briefly re-reads what it missed; segments already recycled force a fresh base backup. Renamed from wal_keep_segments in PostgreSQL 13, which counted 16MB segments rather than megabytes.","default":"0","default_note":"0 (PostgreSQL 18); exists as wal_keep_size since PostgreSQL 13 (wal_keep_segments before).","range":"0 to about 2PB, in MB","restart_required":false,"apply":"No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).","view":"SHOW wal_keep_size;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'wal_keep_size';","change":"ALTER SYSTEM SET wal_keep_size = '1GB';\nSELECT pg_reload_conf();","when":"On primaries with physical standbys that do not use replication slots, or as extra margin next to a slot sized by max_slot_wal_keep_size.","risk":"The space is held in pg_wal even when no standby is connected, so a value far above what the standbys need is wasted disk. A standby that falls further behind than this plus any slot allowance cannot rejoin without a base backup.","related":["max-slot-wal-keep-size","wal-level","max-wal-size"],"faqs":[{"question":"What is the default value of wal_keep_size in PostgreSQL?","answer":"0. 0 (PostgreSQL 18); exists as wal_keep_size since PostgreSQL 13 (wal_keep_segments before)."},{"question":"Does changing wal_keep_size require a restart?","answer":"No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup)."},{"question":"When should I change wal_keep_size?","answer":"On primaries with physical standbys that do not use replication slots, or as extra margin next to a slot sized by max_slot_wal_keep_size."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/wal-keep-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/wal-level","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"wal_level (PostgreSQL)","description":"PostgreSQL wal_level: How much information is written to the WAL. Default: replica.","body":{"engine":"postgresql","slug":"wal-level","name":"wal_level","topic":"durability","summary":"How much information is written to the WAL.","detail":"minimal writes only what crash recovery needs; replica (default) adds what archiving and physical standbys need; logical adds what logical decoding and logical replication need.","default":"replica","default_note":"replica since PostgreSQL 10 (it was minimal before). Same in 18.","range":"minimal, replica, logical","restart_required":true,"apply":"Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf.","view":"SHOW wal_level;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'wal_level';","change":"ALTER SYSTEM SET wal_level = logical;\n-- applies only after a server restart","when":"Set logical before using logical replication, Debezium or another change-data-capture tool. minimal can speed bulk loads into tables created or truncated in the same transaction, but rules out replication and point-in-time recovery.","risk":"Changing it means a restart. logical adds some WAL volume. minimal also requires max_wal_senders = 0 (default 10) and archive_mode = off, or the server refuses to start; existing standbys and base backups stop being usable.","related":["synchronous-commit","max-wal-size"],"faqs":[{"question":"What is the default value of wal_level in PostgreSQL?","answer":"replica. replica since PostgreSQL 10 (it was minimal before). Same in 18."},{"question":"Does changing wal_level require a restart?","answer":"Yes. Server restart required (pg_settings.context is postmaster). ALTER SYSTEM only stages the new value in postgresql.auto.conf."},{"question":"When should I change wal_level?","answer":"Set logical before using logical replication, Debezium or another change-data-capture tool. minimal can speed bulk loads into tables created or truncated in the same transaction, but rules out replication and point-in-time recovery."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/wal-level","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/postgresql/work-mem","corpus":"sql-configuration","engine":"postgresql","language":"en","title":"work_mem (PostgreSQL)","description":"PostgreSQL work_mem: Memory each sort or hash operation may use before it spills to temporary files. Default: 4MB.","body":{"engine":"postgresql","slug":"work-mem","name":"work_mem","topic":"memory","summary":"Memory each sort or hash operation may use before it spills to temporary files.","detail":"The limit is per plan node, not per query or per connection: a query with three sorts and two hash joins can use five times work_mem, and every parallel worker gets its own allowance. Hash operations may use work_mem times hash_mem_multiplier.","default":"4MB","default_note":"4MB (PostgreSQL 18), unchanged since 9.4.","range":"64kB to 2TB","restart_required":false,"apply":"No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).","view":"SHOW work_mem;\n\nSELECT setting, unit, boot_val, context, source, pending_restart\nFROM pg_settings\nWHERE name = 'work_mem';","change":"SET work_mem = '64MB';   -- this session\nALTER ROLE reporting SET work_mem = '64MB';   -- new sessions of one role\n\nALTER SYSTEM SET work_mem = '64MB';\nSELECT pg_reload_conf();","when":"When EXPLAIN (ANALYZE) shows 'Sort Method: external merge' or hash batches greater than 1, or log_temp_files logs frequent spills. Raise it for the reporting role or the session that needs it rather than server-wide.","risk":"Memory use is roughly work_mem x operations x active connections. A large server-wide value with many connections can push the OS into swap or the OOM killer.","related":["hash-mem-multiplier","maintenance-work-mem","log-temp-files","temp-file-limit"],"faqs":[{"question":"What is the default value of work_mem in PostgreSQL?","answer":"4MB. 4MB (PostgreSQL 18), unchanged since 9.4."},{"question":"Does changing work_mem require a restart?","answer":"No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user)."},{"question":"When should I change work_mem?","answer":"When EXPLAIN (ANALYZE) shows 'Sort Method: external merge' or hash batches greater than 1, or log_temp_files logs frequent spills. Raise it for the reporting role or the session that needs it rather than server-wide."}]},"source_url":"https://sqlly.app/sql-configuration/postgresql/work-mem","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/accelerated-database-recovery","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"ACCELERATED_DATABASE_RECOVERY (SQL Server)","description":"SQL Server ACCELERATED_DATABASE_RECOVERY: Accelerated database recovery (ADR): near-instant rollback and crash recovery using a persistent version store.","body":{"engine":"sql-server","slug":"accelerated-database-recovery","name":"ACCELERATED_DATABASE_RECOVERY","topic":"checkpoints","summary":"Accelerated database recovery (ADR): near-instant rollback and crash recovery using a persistent version store.","detail":"Row versions are kept in the database itself, so a long transaction can be rolled back without undoing it record by record, and the log can be truncated past active transactions. Available from SQL Server 2019; always on in Azure SQL Database.","default":"OFF","default_note":"OFF (SQL Server 2025).","range":"ON, OFF (optionally WITH PERSISTENT_VERSION_STORE_FILEGROUP)","restart_required":false,"apply":"No restart, but it needs exclusive access to the database to switch, so other sessions must be out or rolled back.","view":"SELECT name, is_accelerated_database_recovery_on\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET ACCELERATED_DATABASE_RECOVERY = ON;","when":"Databases where long-running transactions get killed and then take ages to roll back, or where the log cannot truncate because of an old open transaction.","risk":"The persistent version store takes space in the data files and adds some write overhead; monitor sys.dm_tran_persistent_version_store_stats.","related":["target-recovery-time","read-committed-snapshot"],"faqs":[{"question":"What is the default value of ACCELERATED_DATABASE_RECOVERY in SQL Server?","answer":"OFF. OFF (SQL Server 2025)."},{"question":"Does changing ACCELERATED_DATABASE_RECOVERY require a restart?","answer":"No. No restart, but it needs exclusive access to the database to switch, so other sessions must be out or rolled back."},{"question":"When should I change ACCELERATED_DATABASE_RECOVERY?","answer":"Databases where long-running transactions get killed and then take ages to roll back, or where the log cannot truncate because of an old open transaction."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/accelerated-database-recovery","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/affinity-mask","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"affinity mask (SQL Server)","description":"SQL Server affinity mask: Bitmask of the CPUs this instance's schedulers may use; 0 lets Windows place the threads. Default: 0 (Windows decides).","body":{"engine":"sql-server","slug":"affinity-mask","name":"affinity mask","topic":"parallelism","summary":"Bitmask of the CPUs this instance's schedulers may use; 0 lets Windows place the threads.","detail":"Each set bit names a CPU for SQL Server and each clear bit takes it away: on an 8-CPU system, 38 (0x26) is processors 1, 2 and 5. Affinity support for 33 to 64 processors needs a 64-bit OS, and above 64 CPUs the bitmask route gives out; ALTER SERVER CONFIGURATION SET PROCESS AFFINITY is the clearer tool anyway. On SQL Server Express the change takes effect only after a restart.","default":"0 (Windows decides)","default_note":"0 (SQL Server 2025). A nonzero value turns thread placement over to SQL Server.","range":"0, or a bitmask over the instance's CPUs","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'affinity mask';\n\n-- EXEC sp_configure 'affinity mask'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'affinity mask', 38;\nRECONFIGURE;","when":"Deliberate core pinning only, such as keeping a co-located engine on its own cores or shrinking a licensed footprint. For workload isolation, Resource Governor fits better, and ALTER SERVER CONFIGURATION reads clearer than a bitmask.","risk":"A miscounted bitmask shrinks the scheduler pool silently: CPUs you meant to include end up excluded, worker threads crowd onto the rest, and the symptom is generic THREADPOOL pressure with no error naming the cause. A CPU set in both this mask and the affinity I/O mask is a conflict the engine does not allow, so compute the bits once and keep them in one place.","related":["max-worker-threads","lightweight-pooling","max-degree-of-parallelism"],"faqs":[{"question":"What is the default value of affinity mask in SQL Server?","answer":"0 (Windows decides). 0 (SQL Server 2025). A nonzero value turns thread placement over to SQL Server."},{"question":"Does changing affinity mask require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change affinity mask?","answer":"Deliberate core pinning only, such as keeping a co-located engine on its own cores or shrinking a licensed footprint. For workload isolation, Resource Governor fits better, and ALTER SERVER CONFIGURATION reads clearer than a bitmask."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/affinity-mask","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/allow-snapshot-isolation","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"ALLOW_SNAPSHOT_ISOLATION (SQL Server)","description":"SQL Server ALLOW_SNAPSHOT_ISOLATION: Allow transactions to use SNAPSHOT isolation. Default: OFF.","body":{"engine":"sql-server","slug":"allow-snapshot-isolation","name":"ALLOW_SNAPSHOT_ISOLATION","topic":"behavior","summary":"Allow transactions to use SNAPSHOT isolation.","detail":"SNAPSHOT gives a transaction-wide consistent view and detects update conflicts (error 3960). Unlike READ_COMMITTED_SNAPSHOT, sessions must opt in with SET TRANSACTION ISOLATION LEVEL SNAPSHOT.","default":"OFF","default_note":"OFF for new user databases (SQL Server 2025); master and msdb have it ON.","range":"ON, OFF","restart_required":false,"apply":"No restart; the switch waits for active transactions to finish.","view":"SELECT name, snapshot_isolation_state_desc\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET ALLOW_SNAPSHOT_ISOLATION ON;","when":"For reports that need a consistent view across several statements without blocking writers.","risk":"Row versioning overhead on every update even if no session uses SNAPSHOT.","related":["read-committed-snapshot"],"faqs":[{"question":"What is the default value of ALLOW_SNAPSHOT_ISOLATION in SQL Server?","answer":"OFF. OFF for new user databases (SQL Server 2025); master and msdb have it ON."},{"question":"Does changing ALLOW_SNAPSHOT_ISOLATION require a restart?","answer":"No. No restart; the switch waits for active transactions to finish."},{"question":"When should I change ALLOW_SNAPSHOT_ISOLATION?","answer":"For reports that need a consistent view across several statements without blocking writers."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/allow-snapshot-isolation","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/auto-shrink","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"AUTO_SHRINK (SQL Server)","description":"SQL Server AUTO_SHRINK: Periodically shrink data and log files with free space. Default: OFF.","body":{"engine":"sql-server","slug":"auto-shrink","name":"AUTO_SHRINK","topic":"maintenance","summary":"Periodically shrink data and log files with free space.","detail":"A background task shrinks files with more than 25% free space. The space is usually needed again, so files grow and shrink repeatedly, and shrinking data files fragments indexes.","default":"OFF","default_note":"OFF (SQL Server 2025).","range":"ON, OFF","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT name, is_auto_shrink_on\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET AUTO_SHRINK OFF;","when":"Never turn it on. If you find it on, turn it off.","risk":"Shrinking rewrites data pages, fragments every index it touches, and the space usually fills again, so the files grow back with expensive growth pauses in the middle of production load. Reclaim space deliberately instead: DBCC SHRINKFILE in a window, followed by an index rebuild.","related":["filegrowth"],"faqs":[{"question":"What is the default value of AUTO_SHRINK in SQL Server?","answer":"OFF. OFF (SQL Server 2025)."},{"question":"Does changing AUTO_SHRINK require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change AUTO_SHRINK?","answer":"Never turn it on. If you find it on, turn it off."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/auto-shrink","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/auto-update-statistics","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"AUTO_UPDATE_STATISTICS (SQL Server)","description":"SQL Server AUTO_UPDATE_STATISTICS: Update statistics automatically when enough rows have changed. Default: ON.","body":{"engine":"sql-server","slug":"auto-update-statistics","name":"AUTO_UPDATE_STATISTICS","topic":"maintenance","summary":"Update statistics automatically when enough rows have changed.","detail":"Since compatibility level 130 the threshold is dynamic: roughly the square root of 1000 x rows for large tables, instead of 20% of rows. Updates happen synchronously when a query compiles, unless AUTO_UPDATE_STATISTICS_ASYNC is on.","default":"ON","default_note":"ON (SQL Server 2025), inherited from model. AUTO_CREATE_STATISTICS is also ON.","range":"ON, OFF","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT name, is_auto_create_stats_on, is_auto_update_stats_on, is_auto_update_stats_async_on\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET AUTO_UPDATE_STATISTICS ON;","when":"Keep it on. Add scheduled updates (UPDATE STATISTICS or a maintenance solution) for large tables whose recent rows matter.","risk":"Off, plans are built on stale estimates and degrade over time.","related":["auto-update-statistics-async","legacy-cardinality-estimation"],"faqs":[{"question":"What is the default value of AUTO_UPDATE_STATISTICS in SQL Server?","answer":"ON. ON (SQL Server 2025), inherited from model. AUTO_CREATE_STATISTICS is also ON."},{"question":"Does changing AUTO_UPDATE_STATISTICS require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change AUTO_UPDATE_STATISTICS?","answer":"Keep it on. Add scheduled updates (UPDATE STATISTICS or a maintenance solution) for large tables whose recent rows matter."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/auto-update-statistics","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/auto-update-statistics-async","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"AUTO_UPDATE_STATISTICS_ASYNC (SQL Server)","description":"SQL Server AUTO_UPDATE_STATISTICS_ASYNC: Let a query compile with existing statistics while the update runs in the background. Default: OFF.","body":{"engine":"sql-server","slug":"auto-update-statistics-async","name":"AUTO_UPDATE_STATISTICS_ASYNC","topic":"maintenance","summary":"Let a query compile with existing statistics while the update runs in the background.","detail":"With it off, the query that triggers a statistics update waits for it, which can stall a request for seconds on a large table.","default":"OFF","default_note":"OFF (SQL Server 2025).","range":"ON, OFF","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT name, is_auto_update_stats_async_on\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET AUTO_UPDATE_STATISTICS_ASYNC ON;","when":"On OLTP databases where occasional compile stalls on large tables are worse than one execution with old statistics.","risk":"The query that triggered the update runs with the old statistics and possibly a poor plan.","related":["auto-update-statistics"],"faqs":[{"question":"What is the default value of AUTO_UPDATE_STATISTICS_ASYNC in SQL Server?","answer":"OFF. OFF (SQL Server 2025)."},{"question":"Does changing AUTO_UPDATE_STATISTICS_ASYNC require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change AUTO_UPDATE_STATISTICS_ASYNC?","answer":"On OLTP databases where occasional compile stalls on large tables are worse than one execution with old statistics."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/auto-update-statistics-async","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/backup-checksum-default","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"backup checksum default (SQL Server)","description":"SQL Server backup checksum default: Verify page checksums and add a backup checksum on every BACKUP by default. Default: 0.","body":{"engine":"sql-server","slug":"backup-checksum-default","name":"backup checksum default","topic":"durability","summary":"Verify page checksums and add a backup checksum on every BACKUP by default.","detail":"The same as adding WITH CHECKSUM to each backup command: a damaged page fails the backup instead of being copied silently.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'backup checksum default';\n\nEXEC sp_configure 'backup checksum default';","change":"EXEC sp_configure 'backup checksum default', 1;\nRECONFIGURE;","when":"On every server; the CPU cost is small.","risk":"A backup now fails on a corrupt page, which is what you want but can surprise a job that never failed before.","related":["backup-compression-default"],"faqs":[{"question":"What is the default value of backup checksum default in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing backup checksum default require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change backup checksum default?","answer":"On every server; the CPU cost is small."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/backup-checksum-default","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/backup-compression-default","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"backup compression default (SQL Server)","description":"SQL Server backup compression default: Compress backups unless the BACKUP statement says otherwise. Default: 0.","body":{"engine":"sql-server","slug":"backup-compression-default","name":"backup compression default","topic":"io","summary":"Compress backups unless the BACKUP statement says otherwise.","detail":"Compressed backups are smaller and usually faster because less is written. The separate backup compression algorithm option picks the algorithm: MS_XPRESS by default, Intel QAT hardware offload from SQL Server 2022, ZSTD from SQL Server 2025.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'backup compression default';\n\nEXEC sp_configure 'backup compression default';","change":"EXEC sp_configure 'backup compression default', 1;\nRECONFIGURE;","when":"On most servers, unless the backup target deduplicates or compresses itself.","risk":"More CPU while backups run, and little gain on data that is already compressed, such as columnstore indexes or compressed files in VARBINARY columns.","related":["backup-checksum-default"],"faqs":[{"question":"What is the default value of backup compression default in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing backup compression default require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change backup compression default?","answer":"On most servers, unless the backup target deduplicates or compresses itself."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/backup-compression-default","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/blocked-process-threshold","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"blocked process threshold (s) (SQL Server)","description":"SQL Server blocked process threshold (s): Seconds a task must be blocked before a blocked process report event fires; 0 disables. Default: 0 (off).","body":{"engine":"sql-server","slug":"blocked-process-threshold","name":"blocked process threshold (s)","topic":"logging","summary":"Seconds a task must be blocked before a blocked process report event fires; 0 disables.","detail":"The report shows the blocked and blocking sessions with their statements. Capture it with an Extended Events session on sqlserver.blocked_process_report.","default":"0 (off)","default_note":"0 (SQL Server 2025).","range":"0 to 86400 seconds","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'blocked process threshold (s)';\n\n-- EXEC sp_configure 'blocked process threshold (s)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'blocked process threshold (s)', 10;\nRECONFIGURE;","when":"On production servers where blocking is suspected; 10-20 seconds is typical.","risk":"Low values produce a report for every short wait and add monitoring overhead. Detection is best effort and can lag the threshold by several seconds.","related":["lock-timeout","read-committed-snapshot"],"faqs":[{"question":"What is the default value of blocked process threshold (s) in SQL Server?","answer":"0 (off). 0 (SQL Server 2025)."},{"question":"Does changing blocked process threshold (s) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change blocked process threshold (s)?","answer":"On production servers where blocking is suspected; 10-20 seconds is typical."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/blocked-process-threshold","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/clr-enabled","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"clr enabled (SQL Server)","description":"SQL Server clr enabled: Allow user CLR assemblies to run. Default: 0.","body":{"engine":"sql-server","slug":"clr-enabled","name":"clr enabled","topic":"security","summary":"Allow user CLR assemblies to run.","detail":"Since SQL Server 2017, clr strict security (on by default) treats every assembly as UNSAFE unless it is signed and trusted.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'clr enabled';\n\nEXEC sp_configure 'clr enabled';","change":"EXEC sp_configure 'clr enabled', 1;\nRECONFIGURE;","when":"Only when you deploy CLR assemblies you have reviewed and signed.","risk":"Widens the attack surface; unsigned assemblies need sys.sp_add_trusted_assembly.","related":["xp-cmdshell"],"faqs":[{"question":"What is the default value of clr enabled in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing clr enabled require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change clr enabled?","answer":"Only when you deploy CLR assemblies you have reviewed and signed."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/clr-enabled","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/compatibility-level","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"COMPATIBILITY_LEVEL (SQL Server)","description":"SQL Server COMPATIBILITY_LEVEL: Which version's query optimizer and T-SQL behavior a database uses. Default: 170.","body":{"engine":"sql-server","slug":"compatibility-level","name":"COMPATIBILITY_LEVEL","topic":"optimizer","summary":"Which version's query optimizer and T-SQL behavior a database uses.","detail":"Controls cardinality estimator version and Intelligent Query Processing features such as batch mode on rowstore (150+) and parameter-sensitive plan optimization (160+). New databases copy model's level.","default":"170","default_note":"170 for new databases on SQL Server 2025 (160 on 2022, 150 on 2019). An upgraded or restored database keeps its old level.","range":"100 to 170 on SQL Server 2025","restart_required":false,"apply":"No restart; applies to plans compiled after the change.","view":"SELECT name, compatibility_level\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET COMPATIBILITY_LEVEL = 170;","when":"After an upgrade, raise it once Query Store has a baseline under the old level, so you can force old plans for any query that regresses.","risk":"Plan changes for many queries at once; test with Query Store capturing first.","related":["legacy-cardinality-estimation","query-store"],"faqs":[{"question":"What is the default value of COMPATIBILITY_LEVEL in SQL Server?","answer":"170. 170 for new databases on SQL Server 2025 (160 on 2022, 150 on 2019). An upgraded or restored database keeps its old level."},{"question":"Does changing COMPATIBILITY_LEVEL require a restart?","answer":"No. No restart; applies to plans compiled after the change."},{"question":"When should I change COMPATIBILITY_LEVEL?","answer":"After an upgrade, raise it once Query Store has a baseline under the old level, so you can force old plans for any query that regresses."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/compatibility-level","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/contained-database-authentication","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"contained database authentication (SQL Server)","description":"SQL Server contained database authentication: Allow contained databases with their own users and passwords. Default: 0.","body":{"engine":"sql-server","slug":"contained-database-authentication","name":"contained database authentication","topic":"security","summary":"Allow contained databases with their own users and passwords.","detail":"Contained users authenticate to the database without a server login, which makes databases portable between instances.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'contained database authentication';\n\nEXEC sp_configure 'contained database authentication';","change":"EXEC sp_configure 'contained database authentication', 1;\nRECONFIGURE;","when":"When you use contained databases, for example to move databases between availability group replicas without syncing logins.","risk":"Database owners can create users that can connect to the instance; review who owns contained databases.","related":["xp-cmdshell"],"faqs":[{"question":"What is the default value of contained database authentication in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing contained database authentication require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change contained database authentication?","answer":"When you use contained databases, for example to move databases between availability group replicas without syncing logins."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/contained-database-authentication","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/cost-threshold-for-parallelism","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"cost threshold for parallelism (SQL Server)","description":"SQL Server cost threshold for parallelism: Estimated plan cost above which the optimizer considers a parallel plan. Default: 5.","body":{"engine":"sql-server","slug":"cost-threshold-for-parallelism","name":"cost threshold for parallelism","topic":"parallelism","summary":"Estimated plan cost above which the optimizer considers a parallel plan.","detail":"The cost units come from an old reference machine and are not seconds on modern hardware, which is why the default of 5 sends many small queries parallel.","default":"5","default_note":"5 (SQL Server 2025), unchanged for decades.","range":"0 to 32767","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'cost threshold for parallelism';\n\n-- EXEC sp_configure 'cost threshold for parallelism'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'cost threshold for parallelism', 50;\nRECONFIGURE;","when":"Raise it on most OLTP servers: 25-50 is a common starting point, then check CXPACKET and CXCONSUMER waits and the plans that went serial.","risk":"Too high keeps genuinely parallel reports serial and slow, and too low burns worker threads on tiny lookups. The comparison uses estimated subtree cost from a decades-old benchmark machine, so the number is not seconds and a statistics drift can flip a plan's parallelism at its next recompile.","related":["max-degree-of-parallelism"],"faqs":[{"question":"What is the default value of cost threshold for parallelism in SQL Server?","answer":"5. 5 (SQL Server 2025), unchanged for decades."},{"question":"Does changing cost threshold for parallelism require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change cost threshold for parallelism?","answer":"Raise it on most OLTP servers: 25-50 is a common starting point, then check CXPACKET and CXCONSUMER waits and the plans that went serial."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/cost-threshold-for-parallelism","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/delayed-durability","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"DELAYED_DURABILITY (SQL Server)","description":"SQL Server DELAYED_DURABILITY: Let commits return before their log records are hardened to disk. Default: DISABLED.","body":{"engine":"sql-server","slug":"delayed-durability","name":"DELAYED_DURABILITY","topic":"durability","summary":"Let commits return before their log records are hardened to disk.","detail":"DISABLED: every commit waits for the log flush. ALLOWED: transactions that commit WITH (DELAYED_DURABILITY = ON) do not wait. FORCED: no commit waits. Log records are flushed when a 60KB log buffer fills, on sp_flush_log, or when a fully durable transaction commits.","default":"DISABLED","default_note":"DISABLED (SQL Server 2025); the option exists from SQL Server 2014.","range":"DISABLED, ALLOWED, FORCED","restart_required":false,"apply":"No restart; applies to transactions that commit after the change.","view":"SELECT name, delayed_durability_desc\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET DELAYED_DURABILITY = ALLOWED;\n\n-- then, per transaction:\nCOMMIT TRANSACTION WITH (DELAYED_DURABILITY = ON);","when":"When WRITELOG waits dominate on a workload of many tiny transactions whose last few can be lost, such as telemetry ingestion. Prefer ALLOWED and opt in per transaction.","risk":"A crash or failover loses commits that clients were told succeeded.","related":["recovery","accelerated-database-recovery"],"faqs":[{"question":"What is the default value of DELAYED_DURABILITY in SQL Server?","answer":"DISABLED. DISABLED (SQL Server 2025); the option exists from SQL Server 2014."},{"question":"Does changing DELAYED_DURABILITY require a restart?","answer":"No. No restart; applies to transactions that commit after the change."},{"question":"When should I change DELAYED_DURABILITY?","answer":"When WRITELOG waits dominate on a workload of many tiny transactions whose last few can be lost, such as telemetry ingestion. Prefer ALLOWED and opt in per transaction."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/delayed-durability","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/filegrowth","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"FILEGROWTH (SQL Server)","description":"SQL Server FILEGROWTH: How much a data or log file grows each time it fills. Default: 64MB.","body":{"engine":"sql-server","slug":"filegrowth","name":"FILEGROWTH","topic":"io","summary":"How much a data or log file grows each time it fills.","detail":"Every growth pauses writes to that file while it extends. Log files cannot use instant file initialization (except growths up to 64MB from SQL Server 2022), so large log growths are zeroed and slow.","default":"64MB","default_note":"64MB for data and log files of databases created on SQL Server 2016 and later, inherited from model.","range":"A fixed size (KB, MB, GB, TB) or a percentage; 0 disables growth","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT name, type_desc, size * 8 / 1024 AS size_mb,\n       CASE is_percent_growth WHEN 1 THEN CONCAT(growth, '%') ELSE CONCAT(growth * 8 / 1024, 'MB') END AS growth\nFROM sys.database_files;  -- current database","change":"-- NAME is the logical file name from sys.database_files.name\nALTER DATABASE CURRENT MODIFY FILE (NAME = SalesDb, FILEGROWTH = 1GB);\nALTER DATABASE CURRENT MODIFY FILE (NAME = SalesDb_log, FILEGROWTH = 512MB);","when":"Pre-size files for expected growth, and set fixed-MB growth (not a percentage) on large databases.","risk":"Percentage growth on a big file produces huge, slow growths; tiny growths fragment the log into thousands of VLFs.","related":["recovery","auto-shrink","instant-file-initialization"],"faqs":[{"question":"What is the default value of FILEGROWTH in SQL Server?","answer":"64MB. 64MB for data and log files of databases created on SQL Server 2016 and later, inherited from model."},{"question":"Does changing FILEGROWTH require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change FILEGROWTH?","answer":"Pre-size files for expected growth, and set fixed-MB growth (not a percentage) on large databases."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/filegrowth","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/fill-factor","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"fill factor (%) (SQL Server)","description":"SQL Server fill factor (%): Free space kept in index leaf pages when an index is created or rebuilt without its own FILLFACTOR. Default: 0 (= 100).","body":{"engine":"sql-server","slug":"fill-factor","name":"fill factor (%)","topic":"maintenance","summary":"Free space kept in index leaf pages when an index is created or rebuilt without its own FILLFACTOR.","detail":"0 means full pages, the same as 100. A lower value leaves room for updates to expand rows in place and delays page splits, and it costs more pages in cache and in scans. ALTER INDEX REBUILD reuses the fill factor the index was built with unless the rebuild names FILLFACTOR explicitly, so the server default reaches mainly new indexes.","default":"0 (= 100)","default_note":"0, full pages (SQL Server 2025). It only applies where the index does not carry its own FILLFACTOR.","range":"0 to 100","restart_required":true,"apply":"Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'fill factor (%)';\n\n-- EXEC sp_configure 'fill factor (%)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'fill factor (%)', 90;\nRECONFIGURE;\n-- then restart the SQL Server service","when":"Almost never as a server default. Set FILLFACTOR per index on hot tables that take frequent page splits, or for one rebuild campaign where you know the update pattern.","risk":"A low server-wide default pads every new index quietly: more pages to cache, more reads, more space, with no error pointing back at the option. The effect lands at index creation time, where nobody is looking, and shows up later as generic buffer pool pressure.","related":["auto-shrink","filegrowth"],"faqs":[{"question":"What is the default value of fill factor (%) in SQL Server?","answer":"0 (= 100). 0, full pages (SQL Server 2025). It only applies where the index does not carry its own FILLFACTOR."},{"question":"Does changing fill factor (%) require a restart?","answer":"Yes. Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change fill factor (%)?","answer":"Almost never as a server default. Set FILLFACTOR per index on hot tables that take frequent page splits, or for one rebuild campaign where you know the update pattern."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/fill-factor","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/index-create-memory","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"index create memory (KB) (SQL Server)","description":"SQL Server index create memory (KB): Memory given to the sort work of an index build at its start; 0 lets the engine size it. Default: 0 (auto).","body":{"engine":"sql-server","slug":"index-create-memory","name":"index create memory (KB)","topic":"memory","summary":"Memory given to the sort work of an index build at its start; 0 lets the engine size it.","detail":"The option sets the initial allocation, not a hard ceiling: when a build needs more and memory is free, the server takes it and goes past this value, and when memory is tight the build continues with what it already has. min memory per query takes precedence, and a value below it warns at RECONFIGURE and again at execution time.","default":"0 (auto)","default_note":"0, self-configuring (SQL Server 2025). sys.configurations reports a 704KB minimum.","range":"0, or 704 to 2147483647 KB","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'index create memory (KB)';\n\n-- EXEC sp_configure 'index create memory (KB)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'index create memory (KB)', 16384;\nRECONFIGURE;","when":"Rarely. Give concurrent index builds a known starting grant during maintenance windows on a busy server, so one rebuild does not win every arbitration.","risk":"The grant is per index operation, so several parallel rebuilds each carry one and the combined ask multiplies across the window. A value below min memory per query is accepted with a warning and then underdelivers at execution time.","related":["min-memory-per-query","max-server-memory"],"faqs":[{"question":"What is the default value of index create memory (KB) in SQL Server?","answer":"0 (auto). 0, self-configuring (SQL Server 2025). sys.configurations reports a 704KB minimum."},{"question":"Does changing index create memory (KB) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change index create memory (KB)?","answer":"Rarely. Give concurrent index builds a known starting grant during maintenance windows on a busy server, so one rebuild does not win every arbitration."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/index-create-memory","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/instant-file-initialization","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"instant file initialization (SQL Server)","description":"SQL Server instant file initialization: Windows right that lets SQL Server skip zeroing data files when they are created or grown. Default: Not granted.","body":{"engine":"sql-server","slug":"instant-file-initialization","name":"instant file initialization","topic":"io","summary":"Windows right that lets SQL Server skip zeroing data files when they are created or grown.","detail":"Grant the service account the Perform volume maintenance tasks right (SE_MANAGE_VOLUME_NAME) and data file creations and growths skip the zeroing pass, which turns a minutes-long growth into an instant one. Log files still zero, apart from autogrowths up to 64MB that skip it since SQL Server 2022. SQL Server on Linux has no equivalent and always zeroes files.","default":"Not granted","default_note":"Setup has offered to grant the right during installation since SQL Server 2022. sys.dm_server_services.instant_file_initialization_enabled reports Y or N.","range":"Granted or not granted","restart_required":false,"apply":"No sp_configure and no RECONFIGURE: the privilege is a Windows one. Grant Perform volume maintenance tasks to the service account or its service SID, then restart the SQL Server service so the running process picks it up.","view":"SELECT servicename, instant_file_initialization_enabled\nFROM sys.dm_server_services\nWHERE servicename LIKE 'SQL Server (%';","change":"-- Windows: Local Security Policy, Local Policies, User Rights Assignment,\n-- Perform volume maintenance tasks: add the Database Engine service account or its service SID,\n-- then restart the SQL Server service","when":"Windows servers that grow data files in production: big restores, ETL landings, databases that still rely on autogrow. Recheck after migrations or service account changes, because a fresh account starts without the right.","risk":"Unzeroed pages can hold readable fragments of files the OS deleted, until new data overwrites them, so deleted disk content is potentially accessible to anyone who can read the data files. Microsoft still recommends enabling it: the benefits outweigh the risk, and TDE closes the hole where the data is sensitive.","related":["filegrowth","tempdb-data-files"],"faqs":[{"question":"What is the default value of instant file initialization in SQL Server?","answer":"Not granted. Setup has offered to grant the right during installation since SQL Server 2022. sys.dm_server_services.instant_file_initialization_enabled reports Y or N."},{"question":"Does changing instant file initialization require a restart?","answer":"No. No sp_configure and no RECONFIGURE: the privilege is a Windows one. Grant Perform volume maintenance tasks to the service account or its service SID, then restart the SQL Server service so the running process picks it up."},{"question":"When should I change instant file initialization?","answer":"Windows servers that grow data files in production: big restores, ETL landings, databases that still rely on autogrow. Recheck after migrations or service account changes, because a fresh account starts without the right."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/instant-file-initialization","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/legacy-cardinality-estimation","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"LEGACY_CARDINALITY_ESTIMATION (SQL Server)","description":"SQL Server LEGACY_CARDINALITY_ESTIMATION: Use the pre-2014 cardinality estimator in this database regardless of compatibility level. Default: OFF.","body":{"engine":"sql-server","slug":"legacy-cardinality-estimation","name":"LEGACY_CARDINALITY_ESTIMATION","topic":"optimizer","summary":"Use the pre-2014 cardinality estimator in this database regardless of compatibility level.","detail":"Lets a database get the newer compatibility level's features while keeping the old estimator's row estimates. Per query, the hint USE HINT('FORCE_LEGACY_CARDINALITY_ESTIMATION') does the same.","default":"OFF","default_note":"OFF (SQL Server 2025).","range":"ON, OFF, PRIMARY (secondary only)","restart_required":false,"apply":"No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.","view":"-- run in the database you want to check\nSELECT name, value, value_for_secondary, is_value_default\nFROM sys.database_scoped_configurations\nWHERE name = 'LEGACY_CARDINALITY_ESTIMATION';","change":"-- run in the database to change\nALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = ON;","when":"After an upgrade where many queries regressed because of estimate changes and you need time to fix them.","risk":"Locks the database to the old model's blind spots; plan for it to be temporary.","related":["compatibility-level","query-optimizer-hotfixes"],"faqs":[{"question":"What is the default value of LEGACY_CARDINALITY_ESTIMATION in SQL Server?","answer":"OFF. OFF (SQL Server 2025)."},{"question":"Does changing LEGACY_CARDINALITY_ESTIMATION require a restart?","answer":"No. No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it."},{"question":"When should I change LEGACY_CARDINALITY_ESTIMATION?","answer":"After an upgrade where many queries regressed because of estimate changes and you need time to fix them."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/legacy-cardinality-estimation","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/lightweight-pooling","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"lightweight pooling (SQL Server)","description":"SQL Server lightweight pooling: Switch the engine's worker scheduling from thread mode to fiber mode. Default: 0 (thread mode).","body":{"engine":"sql-server","slug":"lightweight-pooling","name":"lightweight pooling","topic":"parallelism","summary":"Switch the engine's worker scheduling from thread mode to fiber mode.","detail":"In fiber mode workers are Windows fibers that yield cooperatively, an old answer to context-switch overhead on SMP machines. CLR execution is not supported under it, and hierarchyid methods, replication and some Policy-Based Management features misbehave in fiber mode. Deprecated in SQL Server 2025 and slated for removal, with Microsoft recommending against it in every version.","default":"0 (thread mode)","default_note":"0 (SQL Server 2025). Deprecated from SQL Server 2025; Microsoft recommends avoiding fiber mode in any version.","range":"0 or 1","restart_required":true,"apply":"Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'lightweight pooling';\n\n-- EXEC sp_configure 'lightweight pooling'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'lightweight pooling', 0;\nRECONFIGURE;\n-- then restart the SQL Server service","when":"Almost never. Thread mode is what every modern workload should run, and only a specific support case should ever point here.","risk":"The change needs a restart to try and another to undo, and features that assume thread mode fail under it: CLR is unsupported, so hierarchyid methods and replication can break after the restart. On SQL Server 2025 the mode is deprecated and planned for removal, so building on it today has a deadline attached.","related":["max-worker-threads","affinity-mask"],"faqs":[{"question":"What is the default value of lightweight pooling in SQL Server?","answer":"0 (thread mode). 0 (SQL Server 2025). Deprecated from SQL Server 2025; Microsoft recommends avoiding fiber mode in any version."},{"question":"Does changing lightweight pooling require a restart?","answer":"Yes. Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change lightweight pooling?","answer":"Almost never. Thread mode is what every modern workload should run, and only a specific support case should ever point here."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/lightweight-pooling","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/lock-timeout","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"LOCK_TIMEOUT (SQL Server)","description":"SQL Server LOCK_TIMEOUT: Milliseconds a statement waits for a lock before failing with error 1222; -1 waits forever. Default: -1 (wait forever).","body":{"engine":"sql-server","slug":"lock-timeout","name":"LOCK_TIMEOUT","topic":"timeouts","summary":"Milliseconds a statement waits for a lock before failing with error 1222; -1 waits forever.","detail":"A session setting (SET LOCK_TIMEOUT), not a server option. The statement fails but the transaction stays open unless XACT_ABORT is on. SQL Server has no server-wide statement timeout; command timeouts are set by the client driver (30 seconds in ADO.NET).","default":"-1 (wait forever)","default_note":"-1 (SQL Server 2025).","range":"-1, 0 (do not wait), or 1 to 2147483647 ms","restart_required":false,"apply":"No restart; applies to the current session from the next statement.","view":"SELECT @@LOCK_TIMEOUT;","change":"SET LOCK_TIMEOUT 5000;   -- 5 seconds, this session","when":"In migration scripts and admin jobs, so DDL fails fast instead of waiting in the lock queue and blocking users behind it.","risk":"The application must handle error 1222 and decide whether to roll back.","related":["blocked-process-threshold","read-committed-snapshot"],"faqs":[{"question":"What is the default value of LOCK_TIMEOUT in SQL Server?","answer":"-1 (wait forever). -1 (SQL Server 2025)."},{"question":"Does changing LOCK_TIMEOUT require a restart?","answer":"No. No restart; applies to the current session from the next statement."},{"question":"When should I change LOCK_TIMEOUT?","answer":"In migration scripts and admin jobs, so DDL fails fast instead of waiting in the lock queue and blocking users behind it."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/lock-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/locked-pages-in-memory","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"locked pages in memory (SQL Server)","description":"SQL Server locked pages in memory: Windows right that stops the OS paging the Database Engine's buffer pool memory to disk. Default: Not granted.","body":{"engine":"sql-server","slug":"locked-pages-in-memory","name":"locked pages in memory","topic":"memory","summary":"Windows right that stops the OS paging the Database Engine's buffer pool memory to disk.","detail":"With the Lock pages in memory right granted, SQL Server locks the pages its memory manager allocates, and the OS cannot page them out. LPIM does not stop SQL Server releasing memory on request, and max server memory still caps what it locks; Microsoft strongly recommends setting that upper limit before granting the right. On Linux the privilege does not exist: mssql-conf memory.memorylimitmb is the way to bound the process there.","default":"Not granted","default_note":"Windows only. sys.dm_os_sys_info.sql_memory_model_desc reports CONVENTIONAL, LOCK_PAGES or LARGE_PAGES (SQL Server 2016 SP1 and later).","range":"Granted or not granted","restart_required":false,"apply":"No sp_configure here either. Grant the Lock pages in memory right to the service account or its service SID in Local Security Policy, or use SQL Server Configuration Manager (SQL Server 2019 and later), then restart the instance.","view":"SELECT sql_memory_model_desc FROM sys.dm_os_sys_info;\n\n-- nonzero rows mean pages are actually locked\nSELECT memory_node_id, locked_page_allocations_kb\nFROM sys.dm_os_memory_nodes\nWHERE locked_page_allocations_kb > 0;","change":"-- Windows: Local Security Policy, Local Policies, User Rights Assignment,\n-- Lock pages in memory: add the Database Engine service SID, which keeps the grant\n-- across service account changes; then restart the instance","when":"Only on Windows servers that have really been paged out: SQL Server working set trims or PAGEIOLATCH bursts while Available MBytes still looks healthy. Set max server memory first, and do not grant it as a routine speedup.","risk":"Locked pages cannot be reclaimed, so without a firm max server memory the instance can lock away RAM until the OS starves and the box hangs. Set the ceiling first and leave the OS and other processes room, and remember a service SID grant survives service account changes, so audit it rather than assume it is fresh.","related":["max-server-memory","min-server-memory"],"faqs":[{"question":"What is the default value of locked pages in memory in SQL Server?","answer":"Not granted. Windows only. sys.dm_os_sys_info.sql_memory_model_desc reports CONVENTIONAL, LOCK_PAGES or LARGE_PAGES (SQL Server 2016 SP1 and later)."},{"question":"Does changing locked pages in memory require a restart?","answer":"No. No sp_configure here either. Grant the Lock pages in memory right to the service account or its service SID in Local Security Policy, or use SQL Server Configuration Manager (SQL Server 2019 and later), then restart the instance."},{"question":"When should I change locked pages in memory?","answer":"Only on Windows servers that have really been paged out: SQL Server working set trims or PAGEIOLATCH bursts while Available MBytes still looks healthy. Set max server memory first, and do not grant it as a routine speedup."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/locked-pages-in-memory","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/max-degree-of-parallelism","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"max degree of parallelism (SQL Server)","description":"SQL Server max degree of parallelism: Most schedulers one parallel query operator may use; 0 means all. Default: 0.","body":{"engine":"sql-server","slug":"max-degree-of-parallelism","name":"max degree of parallelism","topic":"parallelism","summary":"Most schedulers one parallel query operator may use; 0 means all.","detail":"Applies instance-wide unless overridden by the MAXDOP database scoped configuration, a Resource Governor workload group or a query's OPTION (MAXDOP n) hint.","default":"0","default_note":"0 (SQL Server 2025). Windows setup has proposed a value based on the core count since SQL Server 2019; the engine default, and this Linux container, keep 0.","range":"0 to 32767","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'max degree of parallelism';\n\n-- EXEC sp_configure 'max degree of parallelism'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'max degree of parallelism', 8;\nRECONFIGURE;","when":"On any server with more than 8 logical processors. Microsoft's guidance: at most the number of logical processors per NUMA node, and no more than 8 for typical workloads.","risk":"1 disables parallelism and slows large queries; 0 on big machines lets one query occupy every core.","related":["cost-threshold-for-parallelism","maxdop-database-scoped","max-worker-threads"],"faqs":[{"question":"What is the default value of max degree of parallelism in SQL Server?","answer":"0. 0 (SQL Server 2025). Windows setup has proposed a value based on the core count since SQL Server 2019; the engine default, and this Linux container, keep 0."},{"question":"Does changing max degree of parallelism require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change max degree of parallelism?","answer":"On any server with more than 8 logical processors. Microsoft's guidance: at most the number of logical processors per NUMA node, and no more than 8 for typical workloads."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/max-degree-of-parallelism","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/max-server-memory","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"max server memory (MB) (SQL Server)","description":"SQL Server max server memory (MB): Upper limit on the memory SQL Server's memory manager takes, buffer pool included. Default: 2147483647.","body":{"engine":"sql-server","slug":"max-server-memory","name":"max server memory (MB)","topic":"memory","summary":"Upper limit on the memory SQL Server's memory manager takes, buffer pool included.","detail":"Covers the buffer pool, plan cache, memory grants and most other memory clerks. Thread stacks and some allocations made by DLLs and linked server providers sit outside it, so the process can use somewhat more. On Linux, mssql-conf memory.memorylimitmb (80% of physical RAM by default) is an outer limit as well.","default":"2147483647","default_note":"2147483647, effectively unlimited (SQL Server 2025).","range":"128 to 2147483647 MB","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'max server memory (MB)';\n\n-- EXEC sp_configure 'max server memory (MB)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'max server memory (MB)', 57344;\nRECONFIGURE;","when":"On every production server. Leave the OS and other processes room: a common starting point is total RAM minus 10% or 4GB, whichever is larger, then watch Available MBytes.","risk":"Left at the default, SQL Server can take memory until the OS pages it out. Set too low, the buffer pool shrinks and reads go to disk.","related":["min-server-memory","min-memory-per-query","optimize-for-ad-hoc-workloads","locked-pages-in-memory"],"faqs":[{"question":"What is the default value of max server memory (MB) in SQL Server?","answer":"2147483647. 2147483647, effectively unlimited (SQL Server 2025)."},{"question":"Does changing max server memory (MB) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change max server memory (MB)?","answer":"On every production server. Leave the OS and other processes room: a common starting point is total RAM minus 10% or 4GB, whichever is larger, then watch Available MBytes."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/max-server-memory","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/max-text-repl-size","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"max text repl size (B) (SQL Server)","description":"SQL Server max text repl size (B): Largest LOB value one INSERT, UPDATE, WRITETEXT or UPDATETEXT may write to a replicated or CDC-captured column.","body":{"engine":"sql-server","slug":"max-text-repl-size","name":"max text repl size (B)","topic":"behavior","summary":"Largest LOB value one INSERT, UPDATE, WRITETEXT or UPDATETEXT may write to a replicated or CDC-captured column.","detail":"It applies to transactional replication and CDC, and snapshot and merge replication ignore it. text, ntext, image, varchar(max), nvarchar(max), varbinary(max), json, xml and similar columns all fall under it. Go past the limit and the statement fails with error 7139 instead of replicating a truncated value.","default":"65536 bytes","default_note":"65536 (SQL Server 2025). A value of -1 removes the limit, leaving only the data type's own.","range":"-1, or 0 to 2147483647 bytes","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'max text repl size (B)';\n\n-- EXEC sp_configure 'max text repl size (B)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'max text repl size (B)', -1;\nRECONFIGURE;","when":"When replication or CDC fails with error 7139 on a table whose rows carry large documents. Raising it is the point fix; dropping the LOB columns from the publication or capture list is the structural one.","risk":"Raising it lets one statement push a whole large document into the distribution database and onto every subscriber in one go, and log reader latency spikes return in a bigger shape. The same value governs CDC capture on the instance, and neither snapshot nor merge replication reads this option at all, so a fix tuned for one path says nothing about the others.","related":["remote-query-timeout"],"faqs":[{"question":"What is the default value of max text repl size (B) in SQL Server?","answer":"65536 bytes. 65536 (SQL Server 2025). A value of -1 removes the limit, leaving only the data type's own."},{"question":"Does changing max text repl size (B) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change max text repl size (B)?","answer":"When replication or CDC fails with error 7139 on a table whose rows carry large documents. Raising it is the point fix; dropping the LOB columns from the publication or capture list is the structural one."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/max-text-repl-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/max-worker-threads","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"max worker threads (SQL Server)","description":"SQL Server max worker threads: Size of the worker thread pool; 0 sizes it from the CPU count. Default: 0 (auto).","body":{"engine":"sql-server","slug":"max-worker-threads","name":"max worker threads","topic":"parallelism","summary":"Size of the worker thread pool; 0 sizes it from the CPU count.","detail":"With 0, a 64-bit server gets 512 workers for up to 4 logical CPUs, 512 + 16 x (CPUs - 4) for up to 64 CPUs, and 512 + 32 x (CPUs - 4) above 64. A 7-CPU server reports 560 in sys.dm_os_sys_info.max_workers_count.","default":"0 (auto)","default_note":"0 (SQL Server 2025).","range":"0, or 128 to 65535","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'max worker threads';\n\n-- EXEC sp_configure 'max worker threads'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'max worker threads', 1024;\nRECONFIGURE;","when":"Only on the advice of a specific diagnosis such as THREADPOOL waits with many idle-blocked sessions (often availability groups with many databases). Fix blocking first.","risk":"Each worker reserves stack memory outside max server memory; too many causes scheduler contention.","related":["max-degree-of-parallelism","user-connections"],"faqs":[{"question":"What is the default value of max worker threads in SQL Server?","answer":"0 (auto). 0 (SQL Server 2025)."},{"question":"Does changing max worker threads require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change max worker threads?","answer":"Only on the advice of a specific diagnosis such as THREADPOOL waits with many idle-blocked sessions (often availability groups with many databases). Fix blocking first."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/max-worker-threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/maxdop-database-scoped","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"MAXDOP (SQL Server)","description":"SQL Server MAXDOP: Per-database MAXDOP that overrides the instance setting for queries in this database. Default: 0.","body":{"engine":"sql-server","slug":"maxdop-database-scoped","name":"MAXDOP","topic":"parallelism","summary":"Per-database MAXDOP that overrides the instance setting for queries in this database.","detail":"0 means use the instance value. Available from SQL Server 2016; on Azure SQL Database it is the only way to set MAXDOP. A secondary replica can have its own value (FOR SECONDARY).","default":"0","default_note":"0, use the instance setting (SQL Server 2025). Azure SQL Database sets 8 for new databases.","range":"0 to 32767","restart_required":false,"apply":"No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.","view":"-- run in the database you want to check\nSELECT name, value, value_for_secondary, is_value_default\nFROM sys.database_scoped_configurations\nWHERE name = 'MAXDOP';","change":"-- run in the database to change\nALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 8;","when":"When one database (an analytics or reporting DB) needs different parallelism from the rest of the instance.","risk":"Same as the instance setting: too high starves concurrent queries, 1 makes big queries slow.","related":["max-degree-of-parallelism"],"faqs":[{"question":"What is the default value of MAXDOP in SQL Server?","answer":"0. 0, use the instance setting (SQL Server 2025). Azure SQL Database sets 8 for new databases."},{"question":"Does changing MAXDOP require a restart?","answer":"No. No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it."},{"question":"When should I change MAXDOP?","answer":"When one database (an analytics or reporting DB) needs different parallelism from the rest of the instance."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/maxdop-database-scoped","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/min-memory-per-query","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"min memory per query (KB) (SQL Server)","description":"SQL Server min memory per query (KB): Smallest memory grant a query that sorts or hashes receives. Default: 1024.","body":{"engine":"sql-server","slug":"min-memory-per-query","name":"min memory per query (KB)","topic":"memory","summary":"Smallest memory grant a query that sorts or hashes receives.","detail":"Each query with a sort or hash gets at least this much workspace memory, even if the optimizer estimated less.","default":"1024","default_note":"1024 KB (SQL Server 2025).","range":"512 to 2147483647 KB","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'min memory per query (KB)';\n\n-- EXEC sp_configure 'min memory per query (KB)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'min memory per query (KB)', 2048;\nRECONFIGURE;","when":"Rarely. Memory grant feedback and better statistics are the usual fixes for spills.","risk":"Higher values make every grant larger, so fewer queries run before others wait on RESOURCE_SEMAPHORE.","related":["max-server-memory"],"faqs":[{"question":"What is the default value of min memory per query (KB) in SQL Server?","answer":"1024. 1024 KB (SQL Server 2025)."},{"question":"Does changing min memory per query (KB) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change min memory per query (KB)?","answer":"Rarely. Memory grant feedback and better statistics are the usual fixes for spills."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/min-memory-per-query","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/min-server-memory","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"min server memory (MB) (SQL Server)","description":"SQL Server min server memory (MB): Memory SQL Server will not release back to the OS once it has acquired it. Default: 0.","body":{"engine":"sql-server","slug":"min-server-memory","name":"min server memory (MB)","topic":"memory","summary":"Memory SQL Server will not release back to the OS once it has acquired it.","detail":"SQL Server does not allocate this at startup; it only stops trimming below it after reaching it.","default":"0","default_note":"0 (SQL Server 2025). sys.configurations can show value_in_use 16 while value is 0; that is expected.","range":"0 to 2147483647 MB","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'min server memory (MB)';\n\n-- EXEC sp_configure 'min server memory (MB)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'min server memory (MB)', 16384;\nRECONFIGURE;","when":"On hosts shared with other services or VMs with memory ballooning, so SQL Server keeps a floor under memory pressure.","risk":"Set min at or above max and the buffer pool holds that much even on an idle instance, which starves other processes on a shared host. Nothing is reserved at startup either: SQL Server only stops releasing memory after it has climbed past the floor, so a high floor protects a busy instance and squeezes the host when the instance goes quiet.","related":["max-server-memory"],"faqs":[{"question":"What is the default value of min server memory (MB) in SQL Server?","answer":"0. 0 (SQL Server 2025). sys.configurations can show value_in_use 16 while value is 0; that is expected."},{"question":"Does changing min server memory (MB) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change min server memory (MB)?","answer":"On hosts shared with other services or VMs with memory ballooning, so SQL Server keeps a floor under memory pressure."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/min-server-memory","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/optimize-for-ad-hoc-workloads","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"optimize for ad hoc workloads (SQL Server)","description":"SQL Server optimize for ad hoc workloads: Cache only a small plan stub the first time an ad hoc batch runs. Default: 0 (off).","body":{"engine":"sql-server","slug":"optimize-for-ad-hoc-workloads","name":"optimize for ad hoc workloads","topic":"memory","summary":"Cache only a small plan stub the first time an ad hoc batch runs.","detail":"The full plan is cached on the second execution. This keeps single-use plans from filling the plan cache on applications that send unparameterized SQL.","default":"0 (off)","default_note":"0 (SQL Server 2025). From SQL Server 2019 a database scoped OPTIMIZE_FOR_AD_HOC_WORKLOADS option does the same for one database.","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'optimize for ad hoc workloads';\n\n-- EXEC sp_configure 'optimize for ad hoc workloads'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'optimize for ad hoc workloads', 1;\nRECONFIGURE;","when":"When sys.dm_exec_cached_plans shows a large share of single-use ad hoc plans. Turning it on is low risk for most workloads.","risk":"The first execution of each batch always compiles without a cached plan, and you lose that first plan when diagnosing.","related":["max-server-memory"],"faqs":[{"question":"What is the default value of optimize for ad hoc workloads in SQL Server?","answer":"0 (off). 0 (SQL Server 2025). From SQL Server 2019 a database scoped OPTIMIZE_FOR_AD_HOC_WORKLOADS option does the same for one database."},{"question":"Does changing optimize for ad hoc workloads require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change optimize for ad hoc workloads?","answer":"When sys.dm_exec_cached_plans shows a large share of single-use ad hoc plans. Turning it on is low risk for most workloads."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/optimize-for-ad-hoc-workloads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/parameter-sniffing","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"PARAMETER_SNIFFING (SQL Server)","description":"SQL Server PARAMETER_SNIFFING: Whether plans are compiled for the parameter values of the first execution. Default: ON.","body":{"engine":"sql-server","slug":"parameter-sniffing","name":"PARAMETER_SNIFFING","topic":"optimizer","summary":"Whether plans are compiled for the parameter values of the first execution.","detail":"OFF compiles for average density, as if every query had OPTIMIZE FOR UNKNOWN. SQL Server 2022's parameter-sensitive plan optimization (compatibility 160+) is a finer-grained alternative.","default":"ON","default_note":"ON (SQL Server 2025).","range":"ON, OFF, PRIMARY (secondary only)","restart_required":false,"apply":"No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.","view":"-- run in the database you want to check\nSELECT name, value, value_for_secondary, is_value_default\nFROM sys.database_scoped_configurations\nWHERE name = 'PARAMETER_SNIFFING';","change":"-- run in the database to change\nALTER DATABASE SCOPED CONFIGURATION SET PARAMETER_SNIFFING = OFF;","when":"Rarely database-wide. Prefer fixing specific queries with OPTION (RECOMPILE), OPTIMIZE FOR or Query Store plan forcing.","risk":"Average-density plans can be worse for every value than a sniffed plan was for most.","related":["query-store","compatibility-level"],"faqs":[{"question":"What is the default value of PARAMETER_SNIFFING in SQL Server?","answer":"ON. ON (SQL Server 2025)."},{"question":"Does changing PARAMETER_SNIFFING require a restart?","answer":"No. No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it."},{"question":"When should I change PARAMETER_SNIFFING?","answer":"Rarely database-wide. Prefer fixing specific queries with OPTION (RECOMPILE), OPTIMIZE FOR or Query Store plan forcing."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/parameter-sniffing","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/query-governor-cost-limit","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"query governor cost limit (SQL Server)","description":"SQL Server query governor cost limit: Refuse to run queries whose estimated cost exceeds this; 0 disables. Default: 0 (off).","body":{"engine":"sql-server","slug":"query-governor-cost-limit","name":"query governor cost limit","topic":"timeouts","summary":"Refuse to run queries whose estimated cost exceeds this; 0 disables.","detail":"The check uses the optimizer's estimated cost before execution, so it is not a time limit and depends on estimate quality. A session can override it with SET QUERY_GOVERNOR_COST_LIMIT.","default":"0 (off)","default_note":"0 (SQL Server 2025).","range":"0 to 2147483647","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'query governor cost limit';\n\n-- EXEC sp_configure 'query governor cost limit'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'query governor cost limit', 3000;\nRECONFIGURE;","when":"Rarely: Resource Governor gives finer control. Possibly on ad hoc reporting servers to reject runaway cross joins.","risk":"Legitimate queries with inflated estimates are rejected outright.","related":["max-degree-of-parallelism"],"faqs":[{"question":"What is the default value of query governor cost limit in SQL Server?","answer":"0 (off). 0 (SQL Server 2025)."},{"question":"Does changing query governor cost limit require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change query governor cost limit?","answer":"Rarely: Resource Governor gives finer control. Possibly on ad hoc reporting servers to reject runaway cross joins."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/query-governor-cost-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/query-optimizer-hotfixes","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"QUERY_OPTIMIZER_HOTFIXES (SQL Server)","description":"SQL Server QUERY_OPTIMIZER_HOTFIXES: Enable optimizer fixes shipped in cumulative updates, which are off by default. Default: OFF.","body":{"engine":"sql-server","slug":"query-optimizer-hotfixes","name":"QUERY_OPTIMIZER_HOTFIXES","topic":"optimizer","summary":"Enable optimizer fixes shipped in cumulative updates, which are off by default.","detail":"Optimizer fixes that change plans ship disabled so a CU cannot silently change plans. This is the database-level equivalent of trace flag 4199.","default":"OFF","default_note":"OFF (SQL Server 2025).","range":"ON, OFF, PRIMARY (secondary only)","restart_required":false,"apply":"No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it.","view":"-- run in the database you want to check\nSELECT name, value, value_for_secondary, is_value_default\nFROM sys.database_scoped_configurations\nWHERE name = 'QUERY_OPTIMIZER_HOTFIXES';","change":"-- run in the database to change\nALTER DATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES = ON;","when":"When a known optimizer bug fixed in a CU affects your queries, or as a deliberate policy tested with Query Store.","risk":"Plans may change on the next CU, and the flag is database-wide, so one bad fix cannot be held back for a single query. Trial the change per statement first with USE HINT('ENABLE_QUERY_OPTIMIZER_HOTFIXES'), or keep the database flag off and fix only the affected queries.","related":["legacy-cardinality-estimation"],"faqs":[{"question":"What is the default value of QUERY_OPTIMIZER_HOTFIXES in SQL Server?","answer":"OFF. OFF (SQL Server 2025)."},{"question":"Does changing QUERY_OPTIMIZER_HOTFIXES require a restart?","answer":"No. No restart. It applies to the current database, to queries compiled after the change; run it in each database that needs it."},{"question":"When should I change QUERY_OPTIMIZER_HOTFIXES?","answer":"When a known optimizer bug fixed in a CU affects your queries, or as a deliberate policy tested with Query Store."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/query-optimizer-hotfixes","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/query-store","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"QUERY_STORE (SQL Server)","description":"SQL Server QUERY_STORE: Query Store: per-database history of query plans and runtime statistics. Default: ON (READ_WRITE).","body":{"engine":"sql-server","slug":"query-store","name":"QUERY_STORE","topic":"logging","summary":"Query Store: per-database history of query plans and runtime statistics.","detail":"Records plans and execution statistics in the database, survives restarts, and lets you force a known-good plan. Turned on by default for new databases from SQL Server 2022, with a 1000MB size limit and AUTO capture.","default":"ON (READ_WRITE)","default_note":"ON for databases created on SQL Server 2022 and later (and in Azure SQL Database); OFF for databases created on older versions. New databases on SQL Server 2025 report READ_WRITE, 1000MB, capture mode AUTO.","range":"OFF, READ_ONLY, READ_WRITE, with MAX_STORAGE_SIZE_MB, QUERY_CAPTURE_MODE and other options","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT actual_state_desc, max_storage_size_mb, current_storage_size_mb, query_capture_mode_desc\nFROM sys.database_query_store_options;  -- current database","change":"ALTER DATABASE CURRENT SET QUERY_STORE = ON\n    (OPERATION_MODE = READ_WRITE, MAX_STORAGE_SIZE_MB = 2048, QUERY_CAPTURE_MODE = AUTO);","when":"Turn it on in user databases created before SQL Server 2022, which keep it off after an upgrade; raise MAX_STORAGE_SIZE_MB if actual_state_desc flips to READ_ONLY because it is full.","risk":"Some write overhead; CAPTURE_MODE = ALL on ad hoc workloads fills it fast.","related":["parameter-sniffing","optimize-for-ad-hoc-workloads"],"faqs":[{"question":"What is the default value of QUERY_STORE in SQL Server?","answer":"ON (READ_WRITE). ON for databases created on SQL Server 2022 and later (and in Azure SQL Database); OFF for databases created on older versions. New databases on SQL Server 2025 report READ_WRITE, 1000MB, capture mode AUTO."},{"question":"Does changing QUERY_STORE require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change QUERY_STORE?","answer":"Turn it on in user databases created before SQL Server 2022, which keep it off after an upgrade; raise MAX_STORAGE_SIZE_MB if actual_state_desc flips to READ_ONLY because it is full."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/query-store","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/query-wait","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"query wait (s) (SQL Server)","description":"SQL Server query wait (s): Seconds a query may sit in the memory grant queue before failing; -1 derives the wait from the estimated cost. Default: -1 (auto).","body":{"engine":"sql-server","slug":"query-wait","name":"query wait (s)","topic":"timeouts","summary":"Seconds a query may sit in the memory grant queue before failing; -1 derives the wait from the estimated cost.","detail":"It bounds the RESOURCE_SEMAPHORE wait of queries that need a sort or hash grant and cannot get one. The default -1 computes the timeout as 25 times the estimated query cost, and at the deadline the query fails with error 8645 and must be rerun. Lock waits follow LOCK_TIMEOUT instead; this option never touches them.","default":"-1 (auto)","default_note":"-1, 25 times the estimated query cost (SQL Server 2025).","range":"-1, or 0 to 2147483647 seconds","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'query wait (s)';\n\n-- EXEC sp_configure 'query wait (s)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'query wait (s)', 300;\nRECONFIGURE;","when":"Once grant queueing is diagnosed, use it as a policy: a low value fails runaway requests fast instead of letting them hold connections and locks, and a high value lets genuine reports wait out a busy window. Fix the memory sizing first, because this only trades waiting against failing.","risk":"Long waits hide a memory shortage rather than fix it: queries pile up in RESOURCE_SEMAPHORE, callers time out on their side while the server-side locks stay held. Set it too low and legitimate reports start dying with error 8645 during peaks.","related":["min-memory-per-query","max-server-memory","query-governor-cost-limit"],"faqs":[{"question":"What is the default value of query wait (s) in SQL Server?","answer":"-1 (auto). -1, 25 times the estimated query cost (SQL Server 2025)."},{"question":"Does changing query wait (s) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change query wait (s)?","answer":"Once grant queueing is diagnosed, use it as a policy: a low value fails runaway requests fast instead of letting them hold connections and locks, and a high value lets genuine reports wait out a busy window. Fix the memory sizing first, because this only trades waiting against failing."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/query-wait","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/read-committed-snapshot","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"READ_COMMITTED_SNAPSHOT (SQL Server)","description":"SQL Server READ_COMMITTED_SNAPSHOT: Make READ COMMITTED use row versions instead of shared locks. Default: OFF.","body":{"engine":"sql-server","slug":"read-committed-snapshot","name":"READ_COMMITTED_SNAPSHOT","topic":"behavior","summary":"Make READ COMMITTED use row versions instead of shared locks.","detail":"With it on, readers see the last committed version of a row and do not block writers or get blocked by them. Versions are kept in tempdb (or in the database with ADR). It is ON by default in Azure SQL Database.","default":"OFF","default_note":"OFF (SQL Server 2025); ON in Azure SQL Database.","range":"ON, OFF","restart_required":false,"apply":"No restart, but the switch needs the database to itself: other connections must be closed or rolled back (WITH ROLLBACK IMMEDIATE).","view":"SELECT name, is_read_committed_snapshot_on\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;","when":"On most OLTP databases suffering reader/writer blocking; it is what PostgreSQL and Oracle do by default.","risk":"Code that relied on blocking reads (read-then-update without UPDLOCK) can race; tempdb usage grows with long transactions.","related":["allow-snapshot-isolation","accelerated-database-recovery","lock-timeout"],"faqs":[{"question":"What is the default value of READ_COMMITTED_SNAPSHOT in SQL Server?","answer":"OFF. OFF (SQL Server 2025); ON in Azure SQL Database."},{"question":"Does changing READ_COMMITTED_SNAPSHOT require a restart?","answer":"No. No restart, but the switch needs the database to itself: other connections must be closed or rolled back (WITH ROLLBACK IMMEDIATE)."},{"question":"When should I change READ_COMMITTED_SNAPSHOT?","answer":"On most OLTP databases suffering reader/writer blocking; it is what PostgreSQL and Oracle do by default."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/read-committed-snapshot","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/recovery","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"RECOVERY (SQL Server)","description":"SQL Server RECOVERY: Recovery model: whether the transaction log is kept for log backups (FULL, BULK_LOGGED) or truncated at checkpoints (SIMPLE).","body":{"engine":"sql-server","slug":"recovery","name":"RECOVERY","topic":"durability","summary":"Recovery model: whether the transaction log is kept for log backups (FULL, BULK_LOGGED) or truncated at checkpoints (SIMPLE).","detail":"In FULL, log space is reused only after a log backup, which allows point-in-time restore. In SIMPLE, the log truncates at checkpoints and only full and differential backups exist.","default":"Inherited from model","default_note":"New databases copy the model database, and model ships in FULL recovery on SQL Server 2025 Developer, so new databases start in FULL.","range":"FULL, BULK_LOGGED, SIMPLE","restart_required":false,"apply":"No restart. Switching from SIMPLE to FULL takes effect for point-in-time purposes only after the next full or differential backup starts the log chain.","view":"SELECT name, recovery_model_desc\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET RECOVERY FULL;\nBACKUP DATABASE SalesDb TO DISK = N'SalesDb.bak';  -- SalesDb: your database name; this starts the log chain","when":"Use FULL with scheduled log backups for any database that needs point-in-time recovery; SIMPLE for dev, staging and data you can reload.","risk":"FULL without log backups is the classic cause of a log file that grows until the disk fills (log_reuse_wait_desc = LOG_BACKUP).","related":["target-recovery-time","accelerated-database-recovery","filegrowth"],"faqs":[{"question":"What is the default value of RECOVERY in SQL Server?","answer":"Inherited from model. New databases copy the model database, and model ships in FULL recovery on SQL Server 2025 Developer, so new databases start in FULL."},{"question":"Does changing RECOVERY require a restart?","answer":"No. No restart. Switching from SIMPLE to FULL takes effect for point-in-time purposes only after the next full or differential backup starts the log chain."},{"question":"When should I change RECOVERY?","answer":"Use FULL with scheduled log backups for any database that needs point-in-time recovery; SIMPLE for dev, staging and data you can reload."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/recovery","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/recovery-interval","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"recovery interval (min) (SQL Server)","description":"SQL Server recovery interval (min): Target recovery time for automatic checkpoints, used only by databases with TARGET_RECOVERY_TIME = 0. Default: 0.","body":{"engine":"sql-server","slug":"recovery-interval","name":"recovery interval (min)","topic":"checkpoints","summary":"Target recovery time for automatic checkpoints, used only by databases with TARGET_RECOVERY_TIME = 0.","detail":"0 means SQL Server picks it, roughly a one-minute recovery target. Databases using indirect checkpoints ignore it.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 to 32767 minutes","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'recovery interval (min)';\n\n-- EXEC sp_configure 'recovery interval (min)'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'recovery interval (min)', 0;\nRECONFIGURE;","when":"Leave it. Set TARGET_RECOVERY_TIME per database instead.","risk":"Large values make automatic checkpoints rare and bursty, and crash recovery long.","related":["target-recovery-time"],"faqs":[{"question":"What is the default value of recovery interval (min) in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing recovery interval (min) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change recovery interval (min)?","answer":"Leave it. Set TARGET_RECOVERY_TIME per database instead."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/recovery-interval","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/remote-admin-connections","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"remote admin connections (SQL Server)","description":"SQL Server remote admin connections: Allow the dedicated administrator connection (DAC) from other machines. Default: 0.","body":{"engine":"sql-server","slug":"remote-admin-connections","name":"remote admin connections","topic":"security","summary":"Allow the dedicated administrator connection (DAC) from other machines.","detail":"The DAC has its own scheduler and memory, so it works when the server is otherwise unresponsive. By default it only accepts local connections.","default":"0","default_note":"0, local DAC only (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'remote admin connections';\n\nEXEC sp_configure 'remote admin connections';","change":"EXEC sp_configure 'remote admin connections', 1;\nRECONFIGURE;","when":"On servers you administer remotely (including most cloud VMs and clustered instances), so ADMIN: connections work when the server is in trouble.","risk":"Low: only sysadmin logins can use the DAC, and only one at a time.","related":["user-connections"],"faqs":[{"question":"What is the default value of remote admin connections in SQL Server?","answer":"0. 0, local DAC only (SQL Server 2025)."},{"question":"Does changing remote admin connections require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change remote admin connections?","answer":"On servers you administer remotely (including most cloud VMs and clustered instances), so ADMIN: connections work when the server is in trouble."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/remote-admin-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/remote-query-timeout","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"remote query timeout (s) (SQL Server)","description":"SQL Server remote query timeout (s): Seconds an outgoing linked-server query may run before it times out; 0 waits forever. Default: 600.","body":{"engine":"sql-server","slug":"remote-query-timeout","name":"remote query timeout (s)","topic":"timeouts","summary":"Seconds an outgoing linked-server query may run before it times out; 0 waits forever.","detail":"Applies to queries this server sends to linked servers, not to client queries against this server.","default":"600","default_note":"600 seconds (SQL Server 2025).","range":"0 to 2147483647 seconds","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1).","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'remote query timeout (s)';\n\nEXEC sp_configure 'remote query timeout (s)';","change":"EXEC sp_configure 'remote query timeout (s)', 1800;\nRECONFIGURE;","when":"Raise it for long-running linked server ETL; lower it to stop hung remote calls from holding locks.","risk":"0 lets a hung remote server hold a session open indefinitely.","related":["lock-timeout"],"faqs":[{"question":"What is the default value of remote query timeout (s) in SQL Server?","answer":"600. 600 seconds (SQL Server 2025)."},{"question":"Does changing remote query timeout (s) require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1)."},{"question":"When should I change remote query timeout (s)?","answer":"Raise it for long-running linked server ETL; lower it to stop hung remote calls from holding locks."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/remote-query-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/target-recovery-time","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"TARGET_RECOVERY_TIME (SQL Server)","description":"SQL Server TARGET_RECOVERY_TIME: Target crash-recovery time for a database, which switches it to indirect checkpoints. Default: 60 SECONDS.","body":{"engine":"sql-server","slug":"target-recovery-time","name":"TARGET_RECOVERY_TIME","topic":"checkpoints","summary":"Target crash-recovery time for a database, which switches it to indirect checkpoints.","detail":"With a value above 0, the database uses indirect checkpoints: a background writer keeps the number of dirty pages low enough to recover within the target, which spreads I/O instead of bursting. 0 falls back to automatic checkpoints driven by the instance's recovery interval.","default":"60 SECONDS","default_note":"60 seconds for databases created on SQL Server 2016 and later, inherited from model. Databases created on older versions and upgraded or attached keep 0.","range":"0 to 2147483647 SECONDS or MINUTES","restart_required":false,"apply":"No restart; takes effect immediately.","view":"SELECT name, target_recovery_time_in_seconds\nFROM sys.databases\nWHERE name = DB_NAME();","change":"ALTER DATABASE CURRENT SET TARGET_RECOVERY_TIME = 60 SECONDS;","when":"Set 60 seconds on databases upgraded from SQL Server 2014 or older that still show 0.","risk":"Very low targets make the background writer flush aggressively, and under sustained heavy writes the engine throttles DML to hold the target, so write latency climbs before you see why. Databases upgraded from SQL Server 2014 or earlier keep 0, which leaves crash recovery minutes long on a big database.","related":["recovery-interval","accelerated-database-recovery"],"faqs":[{"question":"What is the default value of TARGET_RECOVERY_TIME in SQL Server?","answer":"60 SECONDS. 60 seconds for databases created on SQL Server 2016 and later, inherited from model. Databases created on older versions and upgraded or attached keep 0."},{"question":"Does changing TARGET_RECOVERY_TIME require a restart?","answer":"No. No restart; takes effect immediately."},{"question":"When should I change TARGET_RECOVERY_TIME?","answer":"Set 60 seconds on databases upgraded from SQL Server 2014 or older that still show 0."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/target-recovery-time","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/tempdb-data-files","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"tempdb data files (SQL Server)","description":"SQL Server tempdb data files: Number of tempdb data files, which spreads allocation-page contention. Default: Number of cores, up to 8.","body":{"engine":"sql-server","slug":"tempdb-data-files","name":"tempdb data files","topic":"temp","summary":"Number of tempdb data files, which spreads allocation-page contention.","detail":"Not a single option but a file layout. Allocation contention (PAGELATCH waits on 2:1:1, 2:1:2, 2:1:3) is reduced by more equally sized files. Setup creates one per logical core up to 8.","default":"Number of cores, up to 8","default_note":"Setup default since SQL Server 2016; a 7-core Linux container gets 7 files.","range":"1 to 32767 files","restart_required":false,"apply":"No restart to add files; removing or resizing them may require emptying them first. Keep all files the same size and growth.","view":"SELECT name, physical_name, size * 8 / 1024 AS size_mb, growth * 8 / 1024 AS growth_mb\nFROM tempdb.sys.database_files\nWHERE type_desc = 'ROWS';","change":"-- FILENAME is a Linux path; on Windows use the tempdb folder, e.g. D:\\TempDB\\tempdb9.ndf\nALTER DATABASE tempdb ADD FILE\n    (NAME = tempdev9, FILENAME = '/var/opt/mssql/data/tempdb9.ndf', SIZE = 8GB, FILEGROWTH = 512MB);","when":"Add files in groups of 4 when PAGELATCH contention on tempdb allocation pages persists with 8 files.","risk":"Unequal sizes defeat proportional fill and push allocations to the biggest file.","related":["tempdb-metadata-memory-optimized"],"faqs":[{"question":"What is the default value of tempdb data files in SQL Server?","answer":"Number of cores, up to 8. Setup default since SQL Server 2016; a 7-core Linux container gets 7 files."},{"question":"Does changing tempdb data files require a restart?","answer":"No. No restart to add files; removing or resizing them may require emptying them first. Keep all files the same size and growth."},{"question":"When should I change tempdb data files?","answer":"Add files in groups of 4 when PAGELATCH contention on tempdb allocation pages persists with 8 files."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/tempdb-data-files","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/tempdb-metadata-memory-optimized","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"tempdb metadata memory-optimized (SQL Server)","description":"SQL Server tempdb metadata memory-optimized: Keep tempdb system tables in memory-optimized tables to remove metadata contention. Default: 0.","body":{"engine":"sql-server","slug":"tempdb-metadata-memory-optimized","name":"tempdb metadata memory-optimized","topic":"temp","summary":"Keep tempdb system tables in memory-optimized tables to remove metadata contention.","detail":"Available from SQL Server 2019. Targets PAGELATCH contention on tempdb system tables from heavy temporary table creation and drop.","default":"0","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":true,"apply":"Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'tempdb metadata memory-optimized';\n\n-- EXEC sp_configure 'tempdb metadata memory-optimized'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'tempdb metadata memory-optimized', 1;\nRECONFIGURE;\n-- then restart the SQL Server service","when":"Workloads that create and drop many temporary tables per second and show PAGELATCH waits on tempdb system pages not explained by allocation pages.","risk":"Needs a restart, and it has documented limitations: for example, one transaction cannot touch memory-optimized tables in a user database and tempdb system views at the same time. Read the list before enabling it.","related":["tempdb-data-files"],"faqs":[{"question":"What is the default value of tempdb metadata memory-optimized in SQL Server?","answer":"0. 0 (SQL Server 2025)."},{"question":"Does changing tempdb metadata memory-optimized require a restart?","answer":"Yes. Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change tempdb metadata memory-optimized?","answer":"Workloads that create and drop many temporary tables per second and show PAGELATCH waits on tempdb system pages not explained by allocation pages."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/tempdb-metadata-memory-optimized","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/user-connections","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"user connections (SQL Server)","description":"SQL Server user connections: Maximum simultaneous user connections; 0 means the maximum, 32767. Default: 0 (= 32767).","body":{"engine":"sql-server","slug":"user-connections","name":"user connections","topic":"connections","summary":"Maximum simultaneous user connections; 0 means the maximum, 32767.","detail":"SQL Server allocates connection memory as needed, so the default is rarely a constraint.","default":"0 (= 32767)","default_note":"0 (SQL Server 2025).","range":"0 to 32767","restart_required":true,"apply":"Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'user connections';\n\n-- EXEC sp_configure 'user connections'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'user connections', 2000;\nRECONFIGURE;\n-- then restart the SQL Server service","when":"Seldom. Use it only as a deliberate hard cap.","risk":"A low value locks out applications and, if exhausted, administrators too (keep the DAC enabled).","related":["max-worker-threads","remote-admin-connections"],"faqs":[{"question":"What is the default value of user connections in SQL Server?","answer":"0 (= 32767). 0 (SQL Server 2025)."},{"question":"Does changing user connections require a restart?","answer":"Yes. Restart required: value_in_use changes only after the SQL Server service restarts (is_dynamic = 0). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change user connections?","answer":"Seldom. Use it only as a deliberate hard cap."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/user-connections","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sql-server/xp-cmdshell","corpus":"sql-configuration","engine":"sql-server","language":"en","title":"xp_cmdshell (SQL Server)","description":"SQL Server xp_cmdshell: Allow T-SQL to run operating system commands through xp_cmdshell. Default: 0 (disabled).","body":{"engine":"sql-server","slug":"xp-cmdshell","name":"xp_cmdshell","topic":"security","summary":"Allow T-SQL to run operating system commands through xp_cmdshell.","detail":"Commands run as the SQL Server service account (or a proxy for non-sysadmins), with that account's file system and network access. SQL Server on Linux does not support it: sp_configure rejects the change with Msg 15392.","default":"0 (disabled)","default_note":"0 (SQL Server 2025).","range":"0 or 1","restart_required":false,"apply":"No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it.","view":"SELECT name, value, value_in_use, minimum, maximum, is_dynamic, is_advanced\nFROM sys.configurations\nWHERE name = 'xp_cmdshell';\n\n-- EXEC sp_configure 'xp_cmdshell'; also works, but only while show advanced options is 1;\n-- otherwise it fails with Msg 15123 because this is an advanced option.","change":"EXEC sp_configure 'show advanced options', 1;\nRECONFIGURE;\nEXEC sp_configure 'xp_cmdshell', 0;\nRECONFIGURE;","when":"Keep it off. Use SQL Agent jobs, PowerShell or SSIS for OS tasks.","risk":"Anyone with sysadmin, or an injection running as sysadmin, gets a shell on the host.","related":["clr-enabled","contained-database-authentication"],"faqs":[{"question":"What is the default value of xp_cmdshell in SQL Server?","answer":"0 (disabled). 0 (SQL Server 2025)."},{"question":"Does changing xp_cmdshell require a restart?","answer":"No. No restart: it takes effect when RECONFIGURE runs (sys.configurations.is_dynamic = 1). It is an advanced option, so show advanced options must be on to change it."},{"question":"When should I change xp_cmdshell?","answer":"Keep it off. Use SQL Agent jobs, PowerShell or SSIS for OS tasks."}]},"source_url":"https://sqlly.app/sql-configuration/sql-server/xp-cmdshell","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/analysis-limit","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"analysis_limit (SQLite)","description":"SQLite analysis_limit: Approximate rows ANALYZE examines per index; 0 means all rows. Default: 0 (no limit).","body":{"engine":"sqlite","slug":"analysis-limit","name":"analysis_limit","topic":"maintenance","summary":"Approximate rows ANALYZE examines per index; 0 means all rows.","detail":"Lets ANALYZE finish quickly on large databases while still giving the planner usable statistics. Available from SQLite 3.32. From 3.46, PRAGMA optimize applies its own temporary limit, so it no longer needs this setting.","default":"0 (no limit)","default_note":"0 (a stock SQLite 3.5x build).","range":"0 or more rows","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA analysis_limit;\n\nSELECT * FROM pragma_analysis_limit;   -- table-valued form, usable in queries","change":"PRAGMA analysis_limit = 1000;   -- this connection only","when":"Before running ANALYZE directly on a large database, or before PRAGMA optimize on SQLite older than 3.46; the SQLite docs suggest values of 100 to 1000.","risk":"Statistics from a sample can be less accurate on skewed data.","related":["automatic-index"],"faqs":[{"question":"What is the default value of analysis_limit in SQLite?","answer":"0 (no limit). 0 (a stock SQLite 3.5x build)."},{"question":"Does changing analysis_limit require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change analysis_limit?","answer":"Before running ANALYZE directly on a large database, or before PRAGMA optimize on SQLite older than 3.46; the SQLite docs suggest values of 100 to 1000."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/analysis-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/auto-vacuum","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"auto_vacuum (SQLite)","description":"SQLite auto_vacuum: Whether free pages are returned to the OS automatically (FULL), on request (INCREMENTAL) or never (NONE). Default: 0 (NONE).","body":{"engine":"sqlite","slug":"auto-vacuum","name":"auto_vacuum","topic":"maintenance","summary":"Whether free pages are returned to the OS automatically (FULL), on request (INCREMENTAL) or never (NONE).","detail":"With NONE, deleted data leaves free pages inside the file until VACUUM. FULL moves pages at every commit to truncate the file; INCREMENTAL lets PRAGMA incremental_vacuum(N) do it in steps.","default":"0 (NONE)","default_note":"NONE (a stock SQLite 3.5x build).","range":"0 NONE, 1 FULL, 2 INCREMENTAL","restart_required":false,"apply":"No restart. The value is stored in the database file, but on an existing database it only takes effect after VACUUM rebuilds the file.","view":"PRAGMA auto_vacuum;\n\nSELECT * FROM pragma_auto_vacuum;   -- table-valued form, usable in queries","change":"PRAGMA auto_vacuum = INCREMENTAL;\nVACUUM;   -- needed for an existing database","when":"For databases on space-constrained devices that shrink after deletes. Switching between NONE and the others on an existing database requires VACUUM.","risk":"FULL increases write work and fragments the file; neither mode defragments like VACUUM does.","related":["page-size"],"faqs":[{"question":"What is the default value of auto_vacuum in SQLite?","answer":"0 (NONE). NONE (a stock SQLite 3.5x build)."},{"question":"Does changing auto_vacuum require a restart?","answer":"No. No restart. The value is stored in the database file, but on an existing database it only takes effect after VACUUM rebuilds the file."},{"question":"When should I change auto_vacuum?","answer":"For databases on space-constrained devices that shrink after deletes. Switching between NONE and the others on an existing database requires VACUUM."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/auto-vacuum","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/automatic-index","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"automatic_index (SQLite)","description":"SQLite automatic_index: Let the planner build a temporary index for a join when none exists. Default: 1 (on).","body":{"engine":"sqlite","slug":"automatic-index","name":"automatic_index","topic":"optimizer","summary":"Let the planner build a temporary index for a join when none exists.","detail":"The index lives only for one statement. If EXPLAIN QUERY PLAN shows 'AUTOMATIC COVERING INDEX' regularly, that is a hint to create the index permanently.","default":"1 (on)","default_note":"On (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA automatic_index;\n\nSELECT * FROM pragma_automatic_index;   -- table-valued form, usable in queries","change":"PRAGMA automatic_index = OFF;   -- this connection only","when":"Leave it on. Turn it off only to check whether a query depends on it.","risk":"Off, joins without a usable index fall back to nested full scans.","related":["analysis-limit"],"faqs":[{"question":"What is the default value of automatic_index in SQLite?","answer":"1 (on). On (a stock SQLite 3.5x build)."},{"question":"Does changing automatic_index require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change automatic_index?","answer":"Leave it on. Turn it off only to check whether a query depends on it."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/automatic-index","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/busy-timeout","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"busy_timeout (SQLite)","description":"SQLite busy_timeout: Milliseconds to keep retrying when the database is locked by another connection, instead of failing with SQLITE_BUSY. Default: 0.","body":{"engine":"sqlite","slug":"busy-timeout","name":"busy_timeout","topic":"timeouts","summary":"Milliseconds to keep retrying when the database is locked by another connection, instead of failing with SQLITE_BUSY.","detail":"Equivalent to calling sqlite3_busy_timeout(). Without it, a second writer fails immediately with 'database is locked'.","default":"0","default_note":"0 in the C library (a stock SQLite 3.5x build). Wrappers differ: Python's sqlite3 module opens connections with a 5000ms timeout.","range":"0 or more ms","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA busy_timeout;\n\nSELECT * FROM pragma_busy_timeout;   -- table-valued form, usable in queries","change":"PRAGMA busy_timeout = 5000;   -- this connection only","when":"In every application with more than one connection or process writing to the same file.","risk":"Too long makes requests hang behind a long write transaction; it also cannot resolve the deadlock of two readers upgrading to writers (use BEGIN IMMEDIATE for write transactions).","related":["journal-mode","locking-mode"],"faqs":[{"question":"What is the default value of busy_timeout in SQLite?","answer":"0. 0 in the C library (a stock SQLite 3.5x build). Wrappers differ: Python's sqlite3 module opens connections with a 5000ms timeout."},{"question":"Does changing busy_timeout require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change busy_timeout?","answer":"In every application with more than one connection or process writing to the same file."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/busy-timeout","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/cache-size","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"cache_size (SQLite)","description":"SQLite cache_size: Page cache size for this connection: positive numbers are pages, negative numbers are KiB. Default: -2000 (about 2MB).","body":{"engine":"sqlite","slug":"cache-size","name":"cache_size","topic":"memory","summary":"Page cache size for this connection: positive numbers are pages, negative numbers are KiB.","detail":"-2000 means about 2MB regardless of page size. Each connection has its own cache unless shared-cache mode is used.","default":"-2000 (about 2MB)","default_note":"-2000 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2000, which is 2000 pages (8MB with 4KB pages).","range":"Any integer; negative = KiB, positive = pages","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA cache_size;\n\nSELECT * FROM pragma_cache_size;   -- table-valued form, usable in queries","change":"PRAGMA cache_size = -65536;   -- this connection only","when":"Raise it (to tens of MB) for large databases read repeatedly by a long-lived connection.","risk":"Every connection carries its own cache, so memory use scales with the pool: 40 connections told to use 64MB can hold about 2.5GB at peak. The number is a suggestion, and the cache grows in chunks only as pages are actually read, not all at once.","related":["mmap-size","page-size","temp-store"],"faqs":[{"question":"What is the default value of cache_size in SQLite?","answer":"-2000 (about 2MB). -2000 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2000, which is 2000 pages (8MB with 4KB pages)."},{"question":"Does changing cache_size require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change cache_size?","answer":"Raise it (to tens of MB) for large databases read repeatedly by a long-lived connection."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/cache-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/cache-spill","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"cache_spill (SQLite)","description":"SQLite cache_spill: Let the pager write dirty cache pages to the database file in the middle of a transaction. Default: 1 (on).","body":{"engine":"sqlite","slug":"cache-spill","name":"cache_spill","topic":"memory","summary":"Let the pager write dirty cache pages to the database file in the middle of a transaction.","detail":"On by default. Spilling keeps long transactions from holding every dirty page in memory, but a spill takes an EXCLUSIVE lock on the database file that lasts until COMMIT. The boolean form covers every attached database; cache_spill=N raises the threshold for main (or a named schema) alone, and pages then have to pass both that threshold and cache_size before spilling starts.","default":"1 (on)","default_note":"On (a stock SQLite 3.5x build).","range":"ON, OFF, or a page-count threshold","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA cache_spill;\n\nSELECT * FROM pragma_cache_spill;   -- table-valued form, usable in queries","change":"PRAGMA cache_spill = OFF;   -- this connection only","when":"Leave it on unless a very large, long-running transaction should not take the file's EXCLUSIVE lock early, so other writers are not locked out until COMMIT.","risk":"With spilling off, dirty pages pile up in memory, so a transaction writing more pages than the cache holds has nowhere to put them until COMMIT; memory use jumps and the commit itself does more work at once.","related":["cache-size","journal-mode","locking-mode"],"faqs":[{"question":"What is the default value of cache_spill in SQLite?","answer":"1 (on). On (a stock SQLite 3.5x build)."},{"question":"Does changing cache_spill require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change cache_spill?","answer":"Leave it on unless a very large, long-running transaction should not take the file's EXCLUSIVE lock early, so other writers are not locked out until COMMIT."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/cache-spill","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/cell-size-check","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"cell_size_check (SQLite)","description":"SQLite cell_size_check: Run extra sanity checks on b-tree pages as they are read from disk. Default: 0 (off).","body":{"engine":"sqlite","slug":"cell-size-check","name":"cell_size_check","topic":"maintenance","summary":"Run extra sanity checks on b-tree pages as they are read from disk.","detail":"Corruption is detected when the page is first read and is less likely to spread through the file, at a small CPU cost per page. Off by default because the extra checks run on every read.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA cell_size_check;\n\nSELECT * FROM pragma_cell_size_check;   -- table-valued form, usable in queries","change":"PRAGMA cell_size_check = ON;   -- this connection only","when":"On databases where corruption has appeared before or the storage is not fully trusted, such as removable media, and while an integrity_check investigation is under way.","risk":"The checks run on every page read for the connection's whole lifetime, so a read-heavy workload pays the CPU cost continuously; a caught bad page also turns silent reads of damaged rows into visible errors.","related":["journal-mode","synchronous","secure-delete"],"faqs":[{"question":"What is the default value of cell_size_check in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build)."},{"question":"Does changing cell_size_check require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change cell_size_check?","answer":"On databases where corruption has appeared before or the storage is not fully trusted, such as removable media, and while an integrity_check investigation is under way."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/cell-size-check","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/defer-foreign-keys","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"defer_foreign_keys (SQLite)","description":"SQLite defer_foreign_keys: Postpone foreign key checks to COMMIT for the current transaction. Default: 0 (off).","body":{"engine":"sqlite","slug":"defer-foreign-keys","name":"defer_foreign_keys","topic":"behavior","summary":"Postpone foreign key checks to COMMIT for the current transaction.","detail":"Resets to off at the end of every transaction. Useful when rows must be inserted in an order that violates constraints temporarily.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA defer_foreign_keys;\n\nSELECT * FROM pragma_defer_foreign_keys;   -- table-valued form, usable in queries","change":"PRAGMA defer_foreign_keys = ON;   -- this connection only","when":"Inside a transaction that loads or reorders related rows.","risk":"The violation surfaces only at COMMIT, which then fails as a whole and rolls back all the work in that transaction; run PRAGMA foreign_key_check inside the transaction to find the offending rows before paying for the big load.","related":["foreign-keys"],"faqs":[{"question":"What is the default value of defer_foreign_keys in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build)."},{"question":"Does changing defer_foreign_keys require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change defer_foreign_keys?","answer":"Inside a transaction that loads or reorders related rows."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/defer-foreign-keys","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/foreign-keys","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"foreign_keys (SQLite)","description":"SQLite foreign_keys: Enforce FOREIGN KEY constraints. Default: 0 (off).","body":{"engine":"sqlite","slug":"foreign-keys","name":"foreign_keys","topic":"behavior","summary":"Enforce FOREIGN KEY constraints.","detail":"Off by default for backwards compatibility: REFERENCES clauses are parsed and stored but not checked. It cannot be changed inside a transaction; the PRAGMA is silently ignored there.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build) unless the build sets SQLITE_DEFAULT_FOREIGN_KEYS=1.","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA foreign_keys;\n\nSELECT * FROM pragma_foreign_keys;   -- table-valued form, usable in queries","change":"PRAGMA foreign_keys = ON;   -- this connection only","when":"In every application that declares foreign keys. Run PRAGMA foreign_key_check after enabling it on an existing database to find violations.","risk":"Existing orphan rows are not detected until you run foreign_key_check; ON DELETE CASCADE actions start firing.","related":["defer-foreign-keys","recursive-triggers"],"faqs":[{"question":"What is the default value of foreign_keys in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build) unless the build sets SQLITE_DEFAULT_FOREIGN_KEYS=1."},{"question":"Does changing foreign_keys require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change foreign_keys?","answer":"In every application that declares foreign keys. Run PRAGMA foreign_key_check after enabling it on an existing database to find violations."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/foreign-keys","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/ignore-check-constraints","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"ignore_check_constraints (SQLite)","description":"SQLite ignore_check_constraints: Temporarily stop enforcing CHECK constraints on this connection. Default: 0 (off).","body":{"engine":"sqlite","slug":"ignore-check-constraints","name":"ignore_check_constraints","topic":"behavior","summary":"Temporarily stop enforcing CHECK constraints on this connection.","detail":"Off by default, so CHECK constraints are enforced. Turning it on skips the CHECK clause on INSERT and UPDATE, while NOT NULL, UNIQUE and PRIMARY KEY rules still apply. The setting rides on the connection and is not persisted.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build), meaning CHECK constraints are enforced.","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA ignore_check_constraints;\n\nSELECT * FROM pragma_ignore_check_constraints;   -- table-valued form, usable in queries","change":"PRAGMA ignore_check_constraints = ON;   -- this connection only","when":"For staged data loads that must insert rows known to break a CHECK, then clean them up before real traffic reaches the table.","risk":"Rows written while it is on stay invalid after it is off again, and nothing re-checks them automatically; follow every bulk load with a query that reruns the CHECK expressions and fixes or removes what fails.","related":["foreign-keys","defer-foreign-keys"],"faqs":[{"question":"What is the default value of ignore_check_constraints in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build), meaning CHECK constraints are enforced."},{"question":"Does changing ignore_check_constraints require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change ignore_check_constraints?","answer":"For staged data loads that must insert rows known to break a CHECK, then clean them up before real traffic reaches the table."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/ignore-check-constraints","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/journal-mode","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"journal_mode (SQLite)","description":"SQLite journal_mode: How SQLite keeps transactions atomic: a rollback journal or a write-ahead log (WAL). Default: delete.","body":{"engine":"sqlite","slug":"journal-mode","name":"journal_mode","topic":"durability","summary":"How SQLite keeps transactions atomic: a rollback journal or a write-ahead log (WAL).","detail":"DELETE (the default) writes original pages to a -journal file and deletes it at commit. WAL appends changes to a -wal file instead, so readers do not block the writer and the writer does not block readers; there is still only one writer at a time.","default":"delete","default_note":"DELETE for file databases (a stock SQLite 3.5x build); in-memory databases report memory.","range":"DELETE, TRUNCATE, PERSIST, MEMORY, WAL, OFF","restart_required":false,"apply":"No restart. The value is stored in the database file, so every later connection gets it.","view":"PRAGMA journal_mode;\n\nSELECT * FROM pragma_journal_mode;   -- table-valued form, usable in queries","change":"PRAGMA journal_mode = WAL;   -- stored in the database file","when":"Use WAL for almost any application database with concurrent readers, such as a web app or a desktop app with background work. It is the one journal mode that persists in the file.","risk":"WAL needs shared memory, so it does not work on network file systems, and the -wal and -shm files must travel with the database. OFF and MEMORY can corrupt the database if the process crashes mid-transaction.","related":["synchronous","wal-autocheckpoint","busy-timeout"],"faqs":[{"question":"What is the default value of journal_mode in SQLite?","answer":"delete. DELETE for file databases (a stock SQLite 3.5x build); in-memory databases report memory."},{"question":"Does changing journal_mode require a restart?","answer":"No. No restart. The value is stored in the database file, so every later connection gets it."},{"question":"When should I change journal_mode?","answer":"Use WAL for almost any application database with concurrent readers, such as a web app or a desktop app with background work. It is the one journal mode that persists in the file."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/journal-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/journal-size-limit","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"journal_size_limit (SQLite)","description":"SQLite journal_size_limit: Bytes of WAL or journal file kept on disk after a checkpoint or commit; -1 keeps everything. Default: -1 (no limit).","body":{"engine":"sqlite","slug":"journal-size-limit","name":"journal_size_limit","topic":"checkpoints","summary":"Bytes of WAL or journal file kept on disk after a checkpoint or commit; -1 keeps everything.","detail":"Without a limit, the -wal file stays at its largest size after a checkpoint resets it (it is reused, not shrunk).","default":"-1 (no limit)","default_note":"-1 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 32768.","range":"-1, or 0 and up in bytes","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA journal_size_limit;\n\nSELECT * FROM pragma_journal_size_limit;   -- table-valued form, usable in queries","change":"PRAGMA journal_size_limit = 67108864;   -- this connection only","when":"On devices with little disk space or when one large transaction left a huge -wal file.","risk":"A limit set too low makes the -wal file truncate and regrow on every checkpoint, adding I/O churn on busy databases; a value far above what transactions need leaves large files sitting on disk after one rare big commit.","related":["wal-autocheckpoint"],"faqs":[{"question":"What is the default value of journal_size_limit in SQLite?","answer":"-1 (no limit). -1 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 32768."},{"question":"Does changing journal_size_limit require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change journal_size_limit?","answer":"On devices with little disk space or when one large transaction left a huge -wal file."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/journal-size-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/legacy-alter-table","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"legacy_alter_table (SQLite)","description":"SQLite legacy_alter_table: Use the pre 3.25 ALTER TABLE RENAME behavior that leaves most schema references untouched. Default: 0 (off).","body":{"engine":"sqlite","slug":"legacy-alter-table","name":"legacy_alter_table","topic":"behavior","summary":"Use the pre 3.25 ALTER TABLE RENAME behavior that leaves most schema references untouched.","detail":"Off by default, a rename rewrites every reference to the table anywhere in the schema. With it on, only the name in the CREATE TABLE statement and in associated CREATE INDEX and CREATE TRIGGER statements changes; references inside trigger bodies, views, the table's own CHECK constraints and partial-index WHERE clauses keep the old name. New applications should leave it off.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build). For compatibility with older virtual table implementations SQLite toggles it on only inside their xRename call.","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA legacy_alter_table;\n\nSELECT * FROM pragma_legacy_alter_table;   -- table-valued form, usable in queries","change":"PRAGMA legacy_alter_table = ON;   -- this connection only","when":"Running old code that depends on the pre 3.25 rename behavior, for example migration scripts that rename a table and patch references by hand.","risk":"With it on, a rename leaves views, triggers and partial indexes pointing at the old name, so the next use of those objects fails or keeps resolving to another table that owns the old name, and nothing warns about the dangling references.","related":["recursive-triggers","trusted-schema"],"faqs":[{"question":"What is the default value of legacy_alter_table in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build). For compatibility with older virtual table implementations SQLite toggles it on only inside their xRename call."},{"question":"Does changing legacy_alter_table require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change legacy_alter_table?","answer":"Running old code that depends on the pre 3.25 rename behavior, for example migration scripts that rename a table and patch references by hand."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/legacy-alter-table","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/locking-mode","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"locking_mode (SQLite)","description":"SQLite locking_mode: Whether the connection releases file locks after each transaction (NORMAL) or keeps them (EXCLUSIVE). Default: NORMAL.","body":{"engine":"sqlite","slug":"locking-mode","name":"locking_mode","topic":"behavior","summary":"Whether the connection releases file locks after each transaction (NORMAL) or keeps them (EXCLUSIVE).","detail":"EXCLUSIVE saves lock and unlock system calls and, in WAL mode, lets SQLite work without the shared-memory -shm file.","default":"NORMAL","default_note":"NORMAL (a stock SQLite 3.5x build).","range":"NORMAL, EXCLUSIVE","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA locking_mode;\n\nSELECT * FROM pragma_locking_mode;   -- table-valued form, usable in queries","change":"PRAGMA locking_mode = EXCLUSIVE;   -- this connection only","when":"Single-process applications that own the file for their lifetime, or WAL on file systems without shared memory support.","risk":"Other connections and processes cannot access the database until this connection closes.","related":["busy-timeout","journal-mode"],"faqs":[{"question":"What is the default value of locking_mode in SQLite?","answer":"NORMAL. NORMAL (a stock SQLite 3.5x build)."},{"question":"Does changing locking_mode require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change locking_mode?","answer":"Single-process applications that own the file for their lifetime, or WAL on file systems without shared memory support."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/locking-mode","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/max-page-count","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"max_page_count (SQLite)","description":"SQLite max_page_count: Cap on how many pages the database file may hold, so it cannot grow past a size you choose. Default: 4294967294 pages.","body":{"engine":"sqlite","slug":"max-page-count","name":"max_page_count","topic":"io","summary":"Cap on how many pages the database file may hold, so it cannot grow past a size you choose.","detail":"A write that would push the file past the cap fails with SQLITE_FULL instead of consuming more disk. Each attached database gets its own cap, and the pragma will not set one below the file's current page count. With the default 4KB pages the stock cap allows a file of about 17.5TB.","default":"4294967294 pages","default_note":"4294967294 (2^32-2) since SQLite 3.45.0; 1073741823 before that. With 4KB pages the cap is about 17.5TB.","range":"Current page count up to 4294967294","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA max_page_count;\n\nSELECT * FROM pragma_max_page_count;   -- table-valued form, usable in queries","change":"PRAGMA max_page_count = 1073741824;   -- this connection only","when":"On volumes shared with other data, such as embedded devices or app-private folders, where one runaway database must not eat the last free disk space.","risk":"Too low a cap fails inserts and updates with SQLITE_FULL, which reads like a full disk even when the volume has room; applications hitting it unexpectedly need the error surfaced clearly so the limit gets raised instead of disk space chased.","related":["page-size","auto-vacuum"],"faqs":[{"question":"What is the default value of max_page_count in SQLite?","answer":"4294967294 pages. 4294967294 (2^32-2) since SQLite 3.45.0; 1073741823 before that. With 4KB pages the cap is about 17.5TB."},{"question":"Does changing max_page_count require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change max_page_count?","answer":"On volumes shared with other data, such as embedded devices or app-private folders, where one runaway database must not eat the last free disk space."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/max-page-count","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/mmap-size","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"mmap_size (SQLite)","description":"SQLite mmap_size: Bytes of the database file to access through memory-mapped I/O; 0 disables it. Default: 0 (off).","body":{"engine":"sqlite","slug":"mmap-size","name":"mmap_size","topic":"io","summary":"Bytes of the database file to access through memory-mapped I/O; 0 disables it.","detail":"Reads through the mapping skip a copy into the page cache. The value is capped by the compile-time SQLITE_MAX_MMAP_SIZE (the macOS system build reports 1GB).","default":"0 (off)","default_note":"0 (a stock SQLite 3.5x build).","range":"0 up to SQLITE_MAX_MMAP_SIZE","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA mmap_size;","change":"PRAGMA mmap_size = 268435456;   -- this connection only","when":"Read-heavy applications on 64-bit systems where the database is up to a few hundred MB.","risk":"An I/O error on a mapped page crashes the process (SIGBUS) instead of returning an error; some platforms handle mapped writes poorly.","related":["cache-size"],"faqs":[{"question":"What is the default value of mmap_size in SQLite?","answer":"0 (off). 0 (a stock SQLite 3.5x build)."},{"question":"Does changing mmap_size require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change mmap_size?","answer":"Read-heavy applications on 64-bit systems where the database is up to a few hundred MB."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/mmap-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/page-size","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"page_size (SQLite)","description":"SQLite page_size: Size of a database page in bytes. Default: 4096.","body":{"engine":"sqlite","slug":"page-size","name":"page_size","topic":"io","summary":"Size of a database page in bytes.","detail":"Fixed when the database file is first written. Changing it on an existing database needs VACUUM, and it cannot be changed while the database is in WAL mode.","default":"4096","default_note":"4096 since SQLite 3.12.0 (1024 before).","range":"Powers of two from 512 to 65536","restart_required":false,"apply":"No restart. The value is stored in the database file, but on an existing database it only takes effect after VACUUM rebuilds the file.","view":"PRAGMA page_size;\n\nSELECT * FROM pragma_page_size;   -- table-valued form, usable in queries","change":"PRAGMA page_size = 8192;\nVACUUM;   -- needed for an existing database","when":"Rarely. Larger pages can help databases that store large rows or blobs and are scanned sequentially.","risk":"VACUUM rewrites the whole file and needs free disk space up to twice its size.","related":["cache-size","auto-vacuum"],"faqs":[{"question":"What is the default value of page_size in SQLite?","answer":"4096. 4096 since SQLite 3.12.0 (1024 before)."},{"question":"Does changing page_size require a restart?","answer":"No. No restart. The value is stored in the database file, but on an existing database it only takes effect after VACUUM rebuilds the file."},{"question":"When should I change page_size?","answer":"Rarely. Larger pages can help databases that store large rows or blobs and are scanned sequentially."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/page-size","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/query-only","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"query_only (SQLite)","description":"SQLite query_only: Refuse statements that change database files: this connection can read but not write. Default: 0 (off).","body":{"engine":"sqlite","slug":"query-only","name":"query_only","topic":"behavior","summary":"Refuse statements that change database files: this connection can read but not write.","detail":"CREATE, DELETE, DROP, INSERT and UPDATE fail with SQLITE_READONLY while it is on. The database is not truly read-only: checkpoints and COMMIT still run, and sqlite3_db_readonly() does not report the database as read-only.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA query_only;\n\nSELECT * FROM pragma_query_only;   -- table-valued form, usable in queries","change":"PRAGMA query_only = ON;   -- this connection only","when":"In tools and report runners that must never write, and around code paths that should only read, such as a health check or a dashboard.","risk":"It is a tripwire, not a permission system: the connection can still checkpoint and COMMIT, so never present it to a user as proof of read-only access. It also blocks schema migrations until turned back off.","related":["locking-mode","trusted-schema"],"faqs":[{"question":"What is the default value of query_only in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build)."},{"question":"Does changing query_only require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change query_only?","answer":"In tools and report runners that must never write, and around code paths that should only read, such as a health check or a dashboard."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/query-only","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/read-uncommitted","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"read_uncommitted (SQLite)","description":"SQLite read_uncommitted: Allow this connection to read rows other connections have changed but not committed. Default: 0 (off).","body":{"engine":"sqlite","slug":"read-uncommitted","name":"read_uncommitted","topic":"behavior","summary":"Allow this connection to read rows other connections have changed but not committed.","detail":"SQLite's default isolation is SERIALIZABLE. READ UNCOMMITTED only takes effect between connections that share a page and schema cache; cache sharing is off by default and enabled per process with sqlite3_enable_shared_cache(). Without shared cache this pragma changes nothing.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build); the shared-cache mode it depends on is off by default too.","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA read_uncommitted;\n\nSELECT * FROM pragma_read_uncommitted;   -- table-valued form, usable in queries","change":"PRAGMA read_uncommitted = ON;   -- this connection only","when":"In shared-cache applications that deliberately trade isolation for fewer lock conflicts between threads of one process. Outside shared-cache mode, leave it alone.","risk":"With it on, a connection can read rows the writer rolls back moments later, so totals and joins can mix committed and abandoned data. Outside shared-cache mode the pragma silently does nothing, which misleads people who set it expecting looser isolation.","related":["locking-mode","busy-timeout"],"faqs":[{"question":"What is the default value of read_uncommitted in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build); the shared-cache mode it depends on is off by default too."},{"question":"Does changing read_uncommitted require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change read_uncommitted?","answer":"In shared-cache applications that deliberately trade isolation for fewer lock conflicts between threads of one process. Outside shared-cache mode, leave it alone."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/read-uncommitted","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/recursive-triggers","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"recursive_triggers (SQLite)","description":"SQLite recursive_triggers: Allow triggers to fire other triggers recursively, including themselves. Default: 0 (off).","body":{"engine":"sqlite","slug":"recursive-triggers","name":"recursive_triggers","topic":"behavior","summary":"Allow triggers to fire other triggers recursively, including themselves.","detail":"Also makes REPLACE conflict resolution fire DELETE triggers for the rows it removes.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA recursive_triggers;\n\nSELECT * FROM pragma_recursive_triggers;   -- table-valued form, usable in queries","change":"PRAGMA recursive_triggers = ON;   -- this connection only","when":"When a trigger design needs recursion, or when DELETE triggers must run for rows removed by INSERT OR REPLACE.","risk":"Existing triggers can start firing in new places; recursion depth is capped by SQLITE_MAX_TRIGGER_DEPTH (1000).","related":["foreign-keys"],"faqs":[{"question":"What is the default value of recursive_triggers in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build)."},{"question":"Does changing recursive_triggers require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change recursive_triggers?","answer":"When a trigger design needs recursion, or when DELETE triggers must run for rows removed by INSERT OR REPLACE."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/recursive-triggers","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/reverse-unordered-selects","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"reverse_unordered_selects (SQLite)","description":"SQLite reverse_unordered_selects: Make SELECTs without ORDER BY return rows in the opposite of their usual order. Default: 0 (off).","body":{"engine":"sqlite","slug":"reverse-unordered-selects","name":"reverse_unordered_selects","topic":"optimizer","summary":"Make SELECTs without ORDER BY return rows in the opposite of their usual order.","detail":"A debugging switch. If an application breaks with it on, that query was assuming a row order it never asked for. It works for most SELECT statements, but the planner sometimes picks an algorithm it cannot easily reverse, and then the output order stays as before.","default":"0 (off)","default_note":"Off (a stock SQLite 3.5x build).","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA reverse_unordered_selects;\n\nSELECT * FROM pragma_reverse_unordered_selects;   -- table-valued form, usable in queries","change":"PRAGMA reverse_unordered_selects = ON;   -- this connection only","when":"In tests and staging before a release, to flush out queries that lean on natural row order before a schema change or an upgraded build exposes the assumption in production.","risk":"Even with it on, some queries keep their normal order because the planner chose an algorithm that cannot reverse, so a clean run does not prove the application is free of missing ORDER BY clauses; expect reversed results, not an error.","related":["automatic-index","analysis-limit"],"faqs":[{"question":"What is the default value of reverse_unordered_selects in SQLite?","answer":"0 (off). Off (a stock SQLite 3.5x build)."},{"question":"Does changing reverse_unordered_selects require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change reverse_unordered_selects?","answer":"In tests and staging before a release, to flush out queries that lean on natural row order before a schema change or an upgraded build exposes the assumption in production."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/reverse-unordered-selects","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/secure-delete","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"secure_delete (SQLite)","description":"SQLite secure_delete: Overwrite deleted content with zeros. Default: 0 (off).","body":{"engine":"sqlite","slug":"secure-delete","name":"secure_delete","topic":"security","summary":"Overwrite deleted content with zeros.","detail":"With 0, deleted rows can remain readable in free pages and in the journal or WAL. FAST (2) zeros content only when it costs no extra I/O.","default":"0 (off)","default_note":"0 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2 (FAST).","range":"0 off, 1 on, 2 FAST","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA secure_delete;\n\nSELECT * FROM pragma_secure_delete;   -- table-valued form, usable in queries","change":"PRAGMA secure_delete = ON;   -- this connection only","when":"When the file may be copied or handed over and deleted data must not be recoverable from it.","risk":"ON overwrites deleted content, so large deletes write every affected page twice and slow down accordingly; it also does nothing for copies that already left the machine, such as backups, sync targets or an earlier WAL file.","related":["auto-vacuum"],"faqs":[{"question":"What is the default value of secure_delete in SQLite?","answer":"0 (off). 0 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2 (FAST)."},{"question":"Does changing secure_delete require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change secure_delete?","answer":"When the file may be copied or handed over and deleted data must not be recoverable from it."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/secure-delete","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/soft-heap-limit","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"soft_heap_limit (SQLite)","description":"SQLite soft_heap_limit: Advisory ceiling on the heap memory SQLite may use across every connection in the process. Default: 0 (no limit).","body":{"engine":"sqlite","slug":"soft-heap-limit","name":"soft_heap_limit","topic":"memory","summary":"Advisory ceiling on the heap memory SQLite may use across every connection in the process.","detail":"The limit is process wide, not per connection. As usage climbs toward it, SQLite shrinks page caches to stay under. It is advisory: SQLite will cross the limit rather than fail a query with SQLITE_NOMEM. Setting 0 removes the limit; values that are not non-negative integers leave it unchanged.","default":"0 (no limit)","default_note":"0 (a stock SQLite 3.5x build), meaning the limit is disabled.","range":"0 or more bytes","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA soft_heap_limit;\n\nSELECT * FROM pragma_soft_heap_limit;   -- table-valued form, usable in queries","change":"PRAGMA soft_heap_limit = 268435456;   -- this connection only","when":"In one process that hosts many connections on a memory-constrained device, to tell SQLite to give page-cache memory back as usage grows.","risk":"It bends instead of holding: a query that genuinely needs the memory still gets it, so treat this as a hint for cache trimming. One connection's PRAGMA moves the ceiling for every connection in the process.","related":["cache-size","temp-store"],"faqs":[{"question":"What is the default value of soft_heap_limit in SQLite?","answer":"0 (no limit). 0 (a stock SQLite 3.5x build), meaning the limit is disabled."},{"question":"Does changing soft_heap_limit require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change soft_heap_limit?","answer":"In one process that hosts many connections on a memory-constrained device, to tell SQLite to give page-cache memory back as usage grows."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/soft-heap-limit","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/synchronous","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"synchronous (SQLite)","description":"SQLite synchronous: How often SQLite waits for data to reach the disk (fsync). Default: 2 (FULL).","body":{"engine":"sqlite","slug":"synchronous","name":"synchronous","topic":"durability","summary":"How often SQLite waits for data to reach the disk (fsync).","detail":"FULL (2) syncs at every commit. NORMAL (1) syncs less: in WAL mode it never corrupts the database but a power loss can roll back the last transactions; in rollback-journal mode it carries a small corruption risk on power loss. OFF (0) hands writes to the OS without syncing. EXTRA (3) also syncs the journal's directory.","default":"2 (FULL)","default_note":"FULL (a stock SQLite 3.5x build), in WAL mode too unless the build sets SQLITE_DEFAULT_WAL_SYNCHRONOUS.","range":"0 OFF, 1 NORMAL, 2 FULL, 3 EXTRA","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA synchronous;\n\nSELECT * FROM pragma_synchronous;   -- table-valued form, usable in queries","change":"PRAGMA synchronous = NORMAL;   -- this connection only","when":"Use NORMAL together with WAL for most applications: commits get much faster and the database stays consistent.","risk":"OFF can corrupt the database on power loss or OS crash; NORMAL in WAL mode can lose the most recent commits.","related":["journal-mode","wal-autocheckpoint"],"faqs":[{"question":"What is the default value of synchronous in SQLite?","answer":"2 (FULL). FULL (a stock SQLite 3.5x build), in WAL mode too unless the build sets SQLITE_DEFAULT_WAL_SYNCHRONOUS."},{"question":"Does changing synchronous require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change synchronous?","answer":"Use NORMAL together with WAL for most applications: commits get much faster and the database stays consistent."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/synchronous","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/temp-store","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"temp_store (SQLite)","description":"SQLite temp_store: Where temporary tables and indexes go: compile-time default, file or memory. Default: 0 (DEFAULT, which means file).","body":{"engine":"sqlite","slug":"temp-store","name":"temp_store","topic":"temp","summary":"Where temporary tables and indexes go: compile-time default, file or memory.","detail":"0 (DEFAULT) uses the compile-time SQLITE_TEMP_STORE setting, which is 1 (file) in stock builds. Large sorts, GROUP BY and temporary tables use this storage.","default":"0 (DEFAULT, which means file)","default_note":"0 (a stock SQLite 3.5x build, compiled with SQLITE_TEMP_STORE=1).","range":"0 DEFAULT, 1 FILE, 2 MEMORY","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA temp_store;\n\nSELECT * FROM pragma_temp_store;   -- table-valued form, usable in queries","change":"PRAGMA temp_store = MEMORY;   -- this connection only","when":"Set MEMORY for speed when the temporary data fits comfortably in RAM, as on most desktop and server apps.","risk":"Large sorts or temp tables in MEMORY can exhaust RAM on small devices.","related":["cache-size"],"faqs":[{"question":"What is the default value of temp_store in SQLite?","answer":"0 (DEFAULT, which means file). 0 (a stock SQLite 3.5x build, compiled with SQLITE_TEMP_STORE=1)."},{"question":"Does changing temp_store require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change temp_store?","answer":"Set MEMORY for speed when the temporary data fits comfortably in RAM, as on most desktop and server apps."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/temp-store","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/threads","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"threads (SQLite)","description":"SQLite threads: How many auxiliary worker threads one connection may start to help run a query. Default: 0 (no worker threads).","body":{"engine":"sqlite","slug":"threads","name":"threads","topic":"parallelism","summary":"How many auxiliary worker threads one connection may start to help run a query.","detail":"The main user is the sorter behind ORDER BY, GROUP BY and CREATE INDEX. 0 keeps everything on the calling thread. The value sets the per-connection SQLITE_LIMIT_WORKER_THREADS limit; SQLITE_DEFAULT_WORKER_THREADS can set the default at compile time and SQLITE_MAX_WORKER_THREADS caps how high it can go.","default":"0 (no worker threads)","default_note":"0 (a stock SQLite 3.5x build) unless the build sets SQLITE_DEFAULT_WORKER_THREADS.","range":"0 or more threads","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA threads;\n\nSELECT * FROM pragma_threads;   -- table-valued form, usable in queries","change":"PRAGMA threads = 4;   -- this connection only","when":"On multi-core machines that run big sorts or build large indexes and can spare the cores; small values such as 2 to 4 are the usual starting point.","risk":"Worker threads duplicate sort buffers and compete with the application for CPU, so on a busy server they can worsen overall latency while speeding up one sort. The limit is per connection, so every pooled connection gets its own allowance.","related":["cache-size","temp-store"],"faqs":[{"question":"What is the default value of threads in SQLite?","answer":"0 (no worker threads). 0 (a stock SQLite 3.5x build) unless the build sets SQLITE_DEFAULT_WORKER_THREADS."},{"question":"Does changing threads require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change threads?","answer":"On multi-core machines that run big sorts or build large indexes and can spare the cores; small values such as 2 to 4 are the usual starting point."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/threads","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/trusted-schema","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"trusted_schema (SQLite)","description":"SQLite trusted_schema: Whether SQL functions and virtual tables used in the schema (views, triggers, CHECK constraints) are trusted to run. Default: 1 (on).","body":{"engine":"sqlite","slug":"trusted-schema","name":"trusted_schema","topic":"security","summary":"Whether SQL functions and virtual tables used in the schema (views, triggers, CHECK constraints) are trusted to run.","detail":"With it off, functions without the SQLITE_INNOCUOUS flag cannot be used from schema objects, which limits what a tampered database file can make the application execute.","default":"1 (on)","default_note":"On (a stock SQLite 3.5x build) for backwards compatibility; the SQLite documentation recommends turning it off. The sqlite3 command-line shell turns it off for its own connections, so the CLI reports 0 while a library connection reports 1.","range":"0, 1","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA trusted_schema;\n\nSELECT * FROM pragma_trusted_schema;   -- table-valued form, usable in queries","change":"PRAGMA trusted_schema = OFF;   -- this connection only","when":"In any application that opens database files it did not create, such as user documents or downloads.","risk":"Schemas that call application-defined functions not marked innocuous stop working.","related":["secure-delete"],"faqs":[{"question":"What is the default value of trusted_schema in SQLite?","answer":"1 (on). On (a stock SQLite 3.5x build) for backwards compatibility; the SQLite documentation recommends turning it off. The sqlite3 command-line shell turns it off for its own connections, so the CLI reports 0 while a library connection reports 1."},{"question":"Does changing trusted_schema require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change trusted_schema?","answer":"In any application that opens database files it did not create, such as user documents or downloads."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/trusted-schema","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
{"id":"sql-configuration/sqlite/wal-autocheckpoint","corpus":"sql-configuration","engine":"sqlite","language":"en","title":"wal_autocheckpoint (SQLite)","description":"SQLite wal_autocheckpoint: WAL size, in pages, at which a commit triggers an automatic checkpoint; 0 or less disables it. Default: 1000 pages.","body":{"engine":"sqlite","slug":"wal-autocheckpoint","name":"wal_autocheckpoint","topic":"checkpoints","summary":"WAL size, in pages, at which a commit triggers an automatic checkpoint; 0 or less disables it.","detail":"A checkpoint copies WAL content back into the database file. It can only finish up to the oldest active reader, so a long-running read lets the WAL grow without bound.","default":"1000 pages","default_note":"1000 pages, about 4MB with 4KB pages (a stock SQLite 3.5x build).","range":"Any integer; 0 or negative disables","restart_required":false,"apply":"No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.","view":"PRAGMA wal_autocheckpoint;","change":"PRAGMA wal_autocheckpoint = 10000;   -- this connection only","when":"Raise it for bursty write loads; disable it only if your application runs PRAGMA wal_checkpoint(TRUNCATE) itself.","risk":"With checkpoints disabled or blocked by readers, the -wal file keeps growing and reads get slower.","related":["journal-mode","journal-size-limit","synchronous"],"faqs":[{"question":"What is the default value of wal_autocheckpoint in SQLite?","answer":"1000 pages. 1000 pages, about 4MB with 4KB pages (a stock SQLite 3.5x build)."},{"question":"Does changing wal_autocheckpoint require a restart?","answer":"No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens."},{"question":"When should I change wal_autocheckpoint?","answer":"Raise it for bursty write loads; disable it only if your application runs PRAGMA wal_checkpoint(TRUNCATE) itself."}]},"source_url":"https://sqlly.app/sql-configuration/sqlite/wal-autocheckpoint","license":"CC-BY-4.0","code_license":"MIT","last_modified":"2026-11-30"}
