Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFF85-0004nE-Uf for pgsql-general@arkaria.postgresql.org; Tue, 10 Jan 2023 13:57:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFF84-0006ZR-El for pgsql-general@arkaria.postgresql.org; Tue, 10 Jan 2023 13:57:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFF83-0006ZI-WF for pgsql-general@lists.postgresql.org; Tue, 10 Jan 2023 13:57:28 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pFF81-0000ES-L7 for pgsql-general@lists.postgresql.org; Tue, 10 Jan 2023 13:57:26 +0000 Received: by mail-oi1-x22a.google.com with SMTP id v134so2420278oie.3 for ; Tue, 10 Jan 2023 05:57:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Lom8xJ4MXLA5TEDHaHOsi5OXQZwIb/8o8ba0+kQSqUI=; b=FYPI0W/CNxnYCdyg2IDc/0pghnFvG92Qwse/k4incP3FHP7gg26MQm7Ht5DjPyvgrq UgARM6AXia9B5K/7qBM9dvSzymVil6FkGbNv8RUlxo+tYIXscZUvq3iv0YPxEQ131T1z XmQK0UIZxCUGNRf9f4JZd5ND8dlBVcPozBpJl+cd7wGQnBJoY+czSTNuCMeDFAGhYxYX Aroj2uu95DO5TbKTHsfrS8med2MxrN1k6GV7GEZvgtikjnNGyxgjsYs0Tbe+BVIDEHrB xbxufHTs0MiXpJ3fjSVZvCPrO8Bxfv01LIVs6AQwmBGvu8nTAoPV5Bni0ZOBVLt2yjeH RMNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Lom8xJ4MXLA5TEDHaHOsi5OXQZwIb/8o8ba0+kQSqUI=; b=CCZ4la1utRL3j/ofbHsDQHb6JwYQ0rAOjsR61rpHpWDTBmZ2tjbFs0YhxzxlbPoAT+ T/NHlzHO25GOzAfqYLsmmv33KLC4rm7mCa0g4zQqNiUKxPL5KFlTZB4XaDy4b4f1zLjs rOouhUxQZJu4pVF5KpjPu8cVZR86XiwUln9orPMdEWpEmvg0XP3pmr1t5QSJJq58SWyh y5jQBoRll3WUszdk4oH8noTOwvIXlIeIyxfbLfIbHptl09nzLYhWSZu/UVyDqMP+BsGA KpLbeLjnmPtamIQavdiRzOGmxr2SDn0zr1fMsFnBBoo4JIZKYmrc7va1SNw1H08Am3qc TtxA== X-Gm-Message-State: AFqh2kqKicXK0/iXuMKp/oI5PiQlK5SnzTe3JsMfboRQj43stVpJWOFP IObostvY5klRgvrKJ3nUB4fp3o9FInE= X-Google-Smtp-Source: AMrXdXuP0FjAqQvcXeO3nnAy81K4RSFU8uZozK7o0O643uX2QU7suSUkNflqqdyFMUY37ty39nOWyA== X-Received: by 2002:a05:6808:16:b0:35e:9270:7b0e with SMTP id u22-20020a056808001600b0035e92707b0emr31572559oic.29.1673359044243; Tue, 10 Jan 2023 05:57:24 -0800 (PST) Received: from [192.168.1.66] (108-250-206-84.lightspeed.nworla.sbcglobal.net. [108.250.206.84]) by smtp.googlemail.com with ESMTPSA id bg31-20020a056808179f00b00363b5a6bc9esm5365357oib.12.2023.01.10.05.57.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 05:57:23 -0800 (PST) Content-Type: multipart/alternative; boundary="------------brGJVIqnaSQXvwlXsJZuT2zj" Message-ID: Date: Tue, 10 Jan 2023 07:57:22 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: Use case for enabling log_duration other than benchmarking Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------brGJVIqnaSQXvwlXsJZuT2zj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/10/23 07:14, Alicja Kucharczyk wrote: > Do you know any use case for enabling log_duration? Like 3rd party tools > for instance. > I find this parameter pretty much useless (in opposite to > log_min_duration_statement) as it does not show the query text, so besides > having just the timing logged it is of no use in troubleshooting and often > causes huge overhead. Am I missing something? https://www.postgresql.org/docs/current/runtime-config-logging.html Note The difference between enabling|log_duration|and settinglog_min_duration_statement to zero is that exceeding|log_min_duration_statement|forces the text of the query to be logged, but this option doesn't. Thus, if|log_duration|is|on|and|log_min_duration_statement|has a positive value, all durations are logged but the query text is included only for statements exceeding the threshold. *This behavior can be useful for gathering statistics in high-load installations.* -- Born in Arizona, moved to Babylonia. --------------brGJVIqnaSQXvwlXsJZuT2zj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/10/23 07:14, Alicja Kucharczyk wrote:
Do you know any use case for enabling log_duration? Like 3rd party tools for instance.
I find this parameter pretty much useless (in opposite to log_min_duration_statement) as it does not show the query text, so besides having just the timing logged it is of no use in troubleshooting and often causes huge overhead. Am I missing something?

https://www.postgresql.org/docs/current/runtime-config-logging.html

Note

The difference between enabling log_duration and setting log_min_duration_statement to zero is that exceeding log_min_duration_statement forces the text of the query to be logged, but this option doesn't. Thus, if log_duration is on and log_min_duration_statement has a positive value, all durations are logged but the query text is included only for statements exceeding the threshold. This behavior can be useful for gathering statistics in high-load installations.



--
Born in Arizona, moved to Babylonia.
--------------brGJVIqnaSQXvwlXsJZuT2zj--