Skip to content

Ensure 'log_planner_stats' is disabled


Enabling the log_planner_stats setting causes planner performance statistics to be written to the server log. This is a crude profiling instrument, similar to the Unix getrusage() operating system facility. This module reports per-module statistics. The planner performance statistics logging is disabled (off) by default and should only be enabled if directed to do so by your organization's logging policy.


The logging of these additional statistics when not mandated by your organization's logging policy greatly reduces the signal-to-noise ratio of the PostgreSQL logs.

Applies To

  • Databases


This rule is applied when the following tags are present:

Tag With Value
secureclouddb/provider aws
secureclouddb/service rds
secureclouddb/engine postgres

Default Rule

const { checkServerSetting, checkRdsVersion, OK_SKIP_VERSION } = module

 * @param {Object} databaseSettings - database settings object
 * @returns {boolean} true if the log_planner_stats option is off

function validate(databaseSettings) {
    const supportedVersions = ['9.5']
    const supported = checkRdsVersion(databaseSettings, supportedVersions)
    if(!supported) {
        return OK_SKIP_VERSION
    const settingName = 'log_planner_stats'
    const expectedValue = 'off'
    const success = checkServerSetting(databaseSettings, settingName, expectedValue)
    return {

// invoke