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 1oLMKR-0007qL-SK for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Aug 2022 10:19:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oLMKP-00033H-Mj for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Aug 2022 10:19:13 +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 1oLMKO-000338-Nz for pgsql-hackers@lists.postgresql.org; Tue, 09 Aug 2022 10:19:13 +0000 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLMKL-0000Me-PC for pgsql-hackers@lists.postgresql.org; Tue, 09 Aug 2022 10:19:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1660040350; x=1691576350; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=RsWKBBZRZutlp1Ad3ZyXfHLI8I2xsd6tENbJYQaNQjY=; b=dcPBS2J0O25AcChA8w9dD7s9i8BVsCvpi6kA57Ze89GcwNOJIfAAt8x0 uGzQak9AfEg17upzQqYfja9xxJtV1uv21Y4Em/4yIX8pycw0B39uZ/wWp 16y1imwsjnVIweDLUQNHHvB181cDrimQYLNYUHAuHuuXl04615KSTdrNV I=; X-IronPort-AV: E=Sophos;i="5.93,224,1654560000"; d="scan'208";a="230860943" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-5feb294a.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2022 10:18:58 +0000 Received: from EX13D03EUC003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-5feb294a.us-west-2.amazon.com (Postfix) with ESMTPS id 28D139757D; Tue, 9 Aug 2022 10:18:56 +0000 (UTC) Received: from [192.168.29.205] (10.43.160.75) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Tue, 9 Aug 2022 10:18:51 +0000 Message-ID: Date: Tue, 9 Aug 2022 12:18:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.1 Subject: Re: shared-memory based stats collector - v70 To: Greg Stark , Andres Freund CC: Tom Lane , Melanie Plageman , Kyotaro Horiguchi , Justin Pryzby , Thomas Munro , "David G. Johnston" , PostgreSQL Hackers References: <20220317073652.kz3uuh6le6vbfod4@alap3.anarazel.de> <20220325.142256.1649716600998659084.horikyota.ntt@gmail.com> <20220325.172418.1055357550509939415.horikyota.ntt@gmail.com> <20220402082102.ojdd2e6cobsmljvh@alap3.anarazel.de> <20220404041516.cctrvpadhuriawlq@alap3.anarazel.de> <20220405030506.lfdhbu5zf4tzdpux@alap3.anarazel.de> <20220406030008.2qxipjxo776dwnqs@alap3.anarazel.de> <1736122.1658333315@sss.pgh.pa.us> <83D73EC0-E3ED-4C98-A528-5E122278D553@anarazel.de> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.160.75] X-ClientProxiedBy: EX13D32UWB001.ant.amazon.com (10.43.161.248) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 7/21/22 5:07 PM, Greg Stark wrote: > On Wed, 20 Jul 2022 at 15:09, Andres Freund wrote: >> What are your trying to do? > Ideally I would want to dump out the stats without connecting to each > database. I can see the use case too (specially for monitoring tools) of being able to collect the stats without connecting to each database. > It seems like just having an interface to iterate over the shared hash > table and return entries one by one without filtering by database > would be fairly straightforward and I would be able to do most of what > I want just with that. What do you think about adding a function in core PG to provide such functionality? (means being able to retrieve all the stats (+ eventually add some filtering) without the need to connect to each database). If there is some interest, I'd be happy to work on it and propose a patch. Regards, -- Bertrand Drouvot Amazon Web Services: https://aws.amazon.com