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 1nPgRh-0006sG-OI for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Mar 2022 08:04:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nPgRf-0002Je-Os for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Mar 2022 08:04:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPgRf-0002JJ-EI for pgsql-hackers@lists.postgresql.org; Thu, 03 Mar 2022 08:04:19 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nPgRd-00031u-Kk for pgsql-hackers@lists.postgresql.org; Thu, 03 Mar 2022 08:04:19 +0000 Received: by mail-pl1-x632.google.com with SMTP id z11so3825278pla.7 for ; Thu, 03 Mar 2022 00:04:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=oRjG5QX950wearIP2qtOtzlgvc2iOE8/GwesVVnhVds=; b=jksccRJLzmOfGI9cxARlmWxaG4myx16vMx9WV/T8ZL+JUpDNQzh+17MNFvlaeo8t+W eDRilsDCf8GAQg5ylqMIPI9ju8T4VnzkVg/4LAHK6H2gwZLidB7IDIfizvxI6wEI/Nkq lmklF/MK1nm1p9V2jar0lw6f5/vEdc5fV/Gor2AcHp4z74yxsi3VBAsoF0SQPbWhrh4N cVT4MUbHQ528JKeAH2rz4Y7fDo7g/I0pPoG5ouMlTqDCEez+OavuSGfRWrreDjN2BGU8 1qmHvj0CUb612F6704tXtd8eBEMr766JYR1zQdb3R7SngopI8H14/fivOYgiQE8Nb5fz 3wgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=oRjG5QX950wearIP2qtOtzlgvc2iOE8/GwesVVnhVds=; b=hphLtN5Eg1zNdXY/pnolSYLg3oGnTwnxoqrg0xZKY2CNHmBfu/3VM9JIRJpnpf3/Z1 LTsfCajACIEbFFYF3M7U/PjAtL7lobUngcy8zSMN7O6aXJwImLvz7mT4EH6OO2KN1LOV DE/xFpMaoIHUTrQW9cz1wmUh8O9DvjmVsUYrygVCauNazYJoddWfxxSCf5GnCHM/FYlr ecJvOAchd+u6oj01aRmTUdLXXhMbHgOPzQw+OCdb/K5O8Skpm4+450DuP0iqoPNgTvrt f5eQlblVnD0b6dJ0g9sTxxeFwnRy/XiND3XXnMXQWWcLbfrVGlgzXjNCv709WgA33Ysv R3vw== X-Gm-Message-State: AOAM531vztIN8/BjY6DStI1dI3M1EPYIYCN4CntP7/6Ddx9Kmq+kNNhC PtA8y3GAsN2+BX9rOUha5iI= X-Google-Smtp-Source: ABdhPJzCPM4y44p6Olm5OT3kq+T7+uvFdzwqWhhkCYe5EHfNK9twpUOAiKKljjeMM/zyOsHrHWmjfA== X-Received: by 2002:a17:90a:8b82:b0:1b8:9624:2bab with SMTP id z2-20020a17090a8b8200b001b896242babmr4019675pjn.177.1646294655663; Thu, 03 Mar 2022 00:04:15 -0800 (PST) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id a20-20020a056a000c9400b004f396b965a9sm1539676pfv.49.2022.03.03.00.04.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Mar 2022 00:04:14 -0800 (PST) Date: Thu, 03 Mar 2022 17:04:12 +0900 (JST) Message-Id: <20220303.170412.1542007127371857370.horikyota.ntt@gmail.com> To: andres@anarazel.de Cc: ibrar.ahmad@gmail.com, masao.fujii@oss.nttdata.com, gkokolatos@protonmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: shared-memory based stats collector From: Kyotaro Horiguchi In-Reply-To: <20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de> References: <20210726.175201.1255224992745035759.horikyota.ntt@gmail.com> <20210727012754.dmd5feciccnkd6g2@alap3.anarazel.de> <20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Wed, 2 Mar 2022 18:16:00 -0800, Andres Freund wrote in > Hi, > > On 2021-07-26 18:27:54 -0700, Andres Freund wrote: > > I had intended to post a rebase by now. But while I did mostly finish > > that (see [1]) I unfortunately encountered a new issue around > > partitioned tables, see [2]. Currently I'm hoping for a few thoughts on > > that thread about the best way to address the issues. > > Now that https://postgr.es/m/20220125063131.4cmvsxbz2tdg6g65%40alap3.anarazel.de > is resolved, here's a rebased version. With a good bit of further cleanup. > > One "big" thing that I'd like to figure out is a naming policy for the > different types prefixed with PgStat. We have different groups of types: > > - "pending statistics", that are accumulated but not yet submitted to the > shared stats system, like PgStat_TableStatus, PgStat_BackendFunctionEntry > etc > - accumulated statistics like PgStat_StatDBEntry, PgStat_SLRUStats. About half are > prefixed with PgStat_Stat, the other just with PgStat_ > - random other types like PgStat_Single_Reset_Type, ... > > To me it's very confusing to have these all in an essentially undistinguishing > namespace, particularly the top two items. Profoundly agreed. It was always a pain in the neck. > I think we should at least do s/PgStat_Stat/PgStat_/. Perhaps we should use a > distinct PgStatPending_* for the pending item? I can't quite come up with a > good name for the "accumulated" ones. How about naming "pending stats" as just "Stats" and the "acculumated stats" as "counts" or "counters"? "Counter" doesn't reflect the characteristics so exactly but I think the discriminability of the two is more significant. Specifically; - PgStat_TableStatus + PgStat_TableStats - PgStat_BackendFunctionEntry + PgStat_FunctionStats - PgStat_GlobalStats + PgStat_GlobalCounts - PgStat_ArchiverStats + PgStat_ArchiverCounts - PgStat_BgWriterStats + PgStat_BgWriterCounts Moving to shared stats collector turns them into attributed by "Local" and "Shared". (I don't consider the details at this stage.) PgStatLocal_TableStats PgStatLocal_FunctionStats PgStatLocal_GlobalCounts PgStatLocal_ArchiverCounts PgStatLocal_BgWriterCounts PgStatShared_TableStats PgStatShared_FunctionStats PgStatShared_GlobalCounts PgStatShared_ArchiverCounts PgStatShared_BgWriterCounts PgStatLocal_GlobalCounts somewhat looks odd, but doesn't matter much, maybe. > I'd like that get resolved first because I think that'd allow commiting the > prepatory split and reordering patches. regards. -- Kyotaro Horiguchi NTT Open Source Software Center