Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4QAH-003jTa-UJ for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 19:07:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s4QAF-004mEw-3F for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 19:07:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4QAE-004mEn-Oh for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 19:07:47 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s4QAD-001utb-64 for pgsql-hackers@postgresql.org; Tue, 07 May 2024 19:07:46 +0000 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6f02b57be28so22670a34.1 for ; Tue, 07 May 2024 12:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon.tech; s=google; t=1715108864; x=1715713664; darn=postgresql.org; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tJIf+8hWBZtabMPsrA1s6mwEFpY+rv9SH/keNLxG24o=; b=BzdhQCYPk8wOtRf58zltXK7osTTuHYPWOS78OA8vdbdbx8rZVEnnw1L9JQ1v9lHKPN yAi+WVMMmhQ1OZzANNT/kityycqJaiAQW2Oxq6fUlVuU+/J1IVdiFYSsY8eRmJg8YlqM vrFJvxLJzY1Paz18XTVqbemQnZ5RyHIlt9rXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715108864; x=1715713664; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tJIf+8hWBZtabMPsrA1s6mwEFpY+rv9SH/keNLxG24o=; b=WJvCL3U6J4/jsjIeu1GJzHljh48FpcYsZzC71RpZ5iHDqbJAoFlharxWYgCcl4TbZz ILF4B0Q5iZkc8h5ZL5Yv51H81QNdUZ2w6cn6oYIQyx3hZgSz0VXqEUoBWfvOelBScWoT AkvmnfffZZQOlo48rimBhP5Dgxeipkx3H3UJJyhzxkYydIrMIRwSIxY3pfDFMzwTi3En 0KAMkaIq8m6UDNoWYI5KpaT1yS1skpETHhZEBCiRAyWFhxXK2RmwaqDIucGExkoldDc3 Gx7lgVGPDja061WMM6iKEWUs/OIxvXS2Mnxl52a4Zw5CsJEHTgqGOvMl7NreVzEkGLsD j0nw== X-Gm-Message-State: AOJu0YwviVXfm3rF6MmdSwm2Q13Y10ZDzNG9Ilq3cH1xdAtSrvvmBgIb v1t2IWdv1+PpqJPnkCAZJarkceLLt7aAOISL1kegdnPYvnkMyjOcuLSY/aOWO+CoedgQqxOZK7F J4jY= X-Google-Smtp-Source: AGHT+IFDZ6Yyi4s+d7IczT3dhPcUnj/qaaAftdDOrnczB3pciTJtlv7bsy6jwsHakioQBwRGVcIlyQ== X-Received: by 2002:a05:6871:29a:b0:23e:b5a4:d3f8 with SMTP id 586e51a60fabf-24091a0e769mr333990fac.2.1715108864201; Tue, 07 May 2024 12:07:44 -0700 (PDT) Received: from localhost ([2607:fb90:e690:15c7:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id nw7-20020a056870bb0700b0023c4a0f98e9sm2679083oab.6.2024.05.07.12.07.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 May 2024 12:07:43 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Tue, 07 May 2024 14:07:42 -0500 Message-Id: Cc: "pgsql-hackers" Subject: Re: Use pgstat_kind_infos to read fixed shared stats structs To: "Andres Freund" From: "Tristan Partin" X-Mailer: aerc 0.17.0-122-g7b4c8f67eb5f References: <20240507182905.xfzlajkhvpi7frab@awork3.anarazel.de> In-Reply-To: <20240507182905.xfzlajkhvpi7frab@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue May 7, 2024 at 1:29 PM CDT, Andres Freund wrote: > Hi, > > On 2024-05-06 14:07:53 -0500, Tristan Partin wrote: > > Instead of needing to be explicit, we can just iterate the > > pgstat_kind_infos array to find the memory locations to read into. > > > This was originally thought of by Andres in > > 5891c7a8ed8f2d3d577e7eea34dacff12d7b6bbd. > >=20 > > Not a fix, per se, but it does remove a comment. Perhaps the discussion= will > > just lead to someone deleting the comment, and keeping the code as is. > > Either way, a win :). > > I think it's a good idea. I'd really like to allow extensions to register= new > types of stats eventually. Stuff like pg_stat_statements having its own, > fairly ... mediocre, stats storage shouldn't be necessary. Could be useful for Neon in the future too. > Do we need to increase the stats version, I didn't check if the order we > currently store things in and the numerical order of the stats IDs are th= e > same. I checked the orders, and they looked the same. 1. Archiver 2. BgWriter 3. Checkpointer 4. IO 5. SLRU 6. WAL --=20 Tristan Partin Neon (https://neon.tech)