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 1pZsOU-0005Dd-0a for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 11:55:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZsOS-00015n-FO for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2023 11:55:40 +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 1pZsOS-00015d-3q for pgsql-hackers@lists.postgresql.org; Wed, 08 Mar 2023 11:55:40 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pZsOP-0008MG-HC for pgsql-hackers@postgresql.org; Wed, 08 Mar 2023 11:55:39 +0000 Received: by mail-wm1-x332.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so1090428wmb.5 for ; Wed, 08 Mar 2023 03:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678276536; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cZmZzrPzEtNGTxS6PKEyr4fpit3bVJs6TauxzS8vNKM=; b=hFWR3XvJVzOz5thGrwwZtZwFZkCfQTKpBM/6gihwReoB3TySxyDzCpA1+NbHetD8Wi TPbsY2AwKZZpX5qOQFi0Zo8ZtmwgnF0bbH9JsY0cIZRdywk6zJmXnnlvvK/qvT3TkqAn rnqHPu/0d4oUd361D4+3jcOq8kzQq+xbQVioFM8IOBKpYZfcU6gF3bU3Bh8hegocFEo4 18pFUk8rIx0FYXZv609CAfyicW+bEE+NrVtY4Pwa8RJ4wVv9Ucym2fDjtuoH9WZL6yr0 TR8WZD7l2itkKzCSBsi5rueKvOwK/dQX3uckidZcbHoTdtZSSKgo5cbxxgb331Ce+NPS /fCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678276536; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cZmZzrPzEtNGTxS6PKEyr4fpit3bVJs6TauxzS8vNKM=; b=g1Rdr9Z42OsXYrhzczI+R/9MFElxMVzpLP309ZGLLZqpoH9ZKHjxMZMWKjIOT6rdqt rCbZZr1fpMrVtzeb+4a9xf7B0EpD6wzRsjDXSrPZqTD5qITIr5ZPbsGeVTF/jBiNarYC JblVTebgB6b4+9y/uH5vsV8axJLo7Hi+cVIxSNukYHhO/botvT9jCYoO+Qs0XQ257kEa zuEPTg1ngVOvD6QLQ90tSJYBWOPajUXRWd667BaHBp/1dIKPVEEyyXsMX52Rn+EPrXqb 5PxlbX/eX9P0rcuCVyXeyUNZQK7t9un2vcuCs9lqMO8xyO4xAT97eYAKbI++8AggchLF RfPw== X-Gm-Message-State: AO0yUKWSrOAjXZVQ4gFh19MEGpJ852MSDcOO0tW8QmCLKfk+ICZFemYe JKoD+pAO1Nhw7F0M76/1d5w= X-Google-Smtp-Source: AK7set/SpLSYOwZie5iq5wfA4ImeJDA3gGhuuUK4FLbBHdLkXCNMyD3Ha/YGba1b7p4yy/R+JPFHJg== X-Received: by 2002:a05:600c:5107:b0:3eb:2de9:8af3 with SMTP id o7-20020a05600c510700b003eb2de98af3mr15346404wms.23.1678276535940; Wed, 08 Mar 2023 03:55:35 -0800 (PST) Received: from [192.168.21.27] ([54.239.6.186]) by smtp.gmail.com with ESMTPSA id l3-20020a5d4103000000b002c55521903bsm14974448wrp.51.2023.03.08.03.55.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 03:55:35 -0800 (PST) Message-ID: <7b450eef-8717-ce4a-a9c8-ccab24ecd89a@gmail.com> Date: Wed, 8 Mar 2023 12:55:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Track IO times in pg_stat_io To: Andres Freund , Melanie Plageman Cc: Pg Hackers , Maciek Sakrejda , Justin Pryzby , smilingsamay@gmail.com, Kyotaro Horiguchi , Lukas Fittl , Magnus Hagander , Alvaro Herrera References: <20230307184751.jdokdy2xmx3xpaua@awork3.anarazel.de> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: <20230307184751.jdokdy2xmx3xpaua@awork3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 3/7/23 7:47 PM, Andres Freund wrote: > On 2023-03-07 13:43:28 -0500, Melanie Plageman wrote: >>> Now I've a second thought: what do you think about resetting the related number >>> of operations and *_time fields when enabling/disabling track_io_timing? (And mention it in the doc). >>> >>> That way it'd prevent bad interpretation (at least as far the time per operation metrics are concerned). >>> >>> Thinking that way as we'd loose some (most?) benefits of the new *_time columns >>> if one can't "trust" their related operations and/or one is not sampling pg_stat_io frequently enough (to discard the samples >>> where the track_io_timing changes occur). >>> >>> But well, resetting the operations could also lead to bad interpretation about the operations... >>> >>> Not sure about which approach I like the most yet, what do you think? >> >> Oh, this is an interesting idea. I think you are right about the >> synchronization issues making the statistics untrustworthy and, thus, >> unuseable. > > No, I don't think we can do that. It can be enabled on a per-session basis. Oh right. So it's even less clear to me to get how one would make use of those new *_time fields, given that: - pg_stat_io is "global" across all sessions. So, even if one session is doing some "testing" and needs to turn track_io_timing on, then it is even not sure it's only reflecting its own testing (as other sessions may have turned it on too). - There is the risk mentioned above of bad interpretations for the "time per operation" metrics. - Even if there is frequent enough sampling of it pg_stat_io, one does not know which samples contain track_io_timing changes (at the cluster or session level). > I think we simply shouldn't do anything here. This is a pre-existing issue. Oh, never thought about it. You mean like for pg_stat_database.blks_read and pg_stat_database.blk_read_time for example? > I also think that loosing stats when turning track_io_timing on/off would not be > helpful. > Yeah not 100% sure too as that would lead to other possible bad interpretations. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com