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 1k5Sql-0006xb-PT for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Aug 2020 11:53:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k5Sqh-0007XX-L1 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Aug 2020 11:53:47 +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 1k5Sqh-0007XQ-92 for pgsql-hackers@lists.postgresql.org; Tue, 11 Aug 2020 11:53:47 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k5Sqf-00058C-1p for pgsql-hackers@lists.postgresql.org; Tue, 11 Aug 2020 11:53:46 +0000 Received: by mail-ed1-x534.google.com with SMTP id q4so8819514edv.13 for ; Tue, 11 Aug 2020 04:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=iUXBBidbSPL1R15faTzksZXJy9SV7PqDPEZM8kJmsnc=; b=G9t2S9Qjym+op5azhvsduYPsR7pUZ4H4vFo+LgsQPH9J1qnYiW9a2z2DhcJnXC+YA7 n61tmD7mOulAVO7RTrd+YKAjUOTYi9Bca29niWnJP9uVV5FjO8U6Y+QkQ0y9DthPaux/ MF6qJJ90BwM8ckbLw+/dTmxZY3/JfEK/+x8cMwybOMZwAoqD+3y89qNCzE2FjfYhMwv5 zJ70nXcsBeG7EMpvo9YJfqx0sGWPwwdAZbxUOeBKNwTlOvl6p+Bi72+YoFOcKf2Hit+P ElalsselHr8PfXv054ppqohITu7Q0sCNpTY7zWwUwdpZPzwnjQX+hiXWjCI7VBnaRk0k yJZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=iUXBBidbSPL1R15faTzksZXJy9SV7PqDPEZM8kJmsnc=; b=GNcGFUwm3pRTa5T3tkeeehvoydZZibo0xORh/LmqP/r6pDm6LMHZ17mgVHpLyR0uns KKQXJvnHLbYKTEcxdDdyrs2zbd/TirtGVgYTWKxRHd1CpzAqNBX19oe0ch3ofNVl2pUE OyDFZLwutItIeX2IDbnPhofJsBtb6BYximoSwfLqo65QzcUsYpanT89P2AiaEaRpxT1f wfFbDC2XgAwdeqJlphBRgJeo4wxIyUSjF8ewwXLOicT06s/dLkZgoYymotfs1omfLZSB TVLiwjFD6Ix2nsvcZPoqka9XySSfLJEdoY5NQqfTPpu1OQ60KSuZE+XCI6YPqWaybaqu DUbQ== X-Gm-Message-State: AOAM530wmMV/Azm0dM9n2pfHw0yZpfpcaIt+jLmdIKIPawOp6rdyOVPC ovweS5zfQcbg42OGmlYKoah2jA== X-Google-Smtp-Source: ABdhPJwAwsdbpE6NH952E/M1aHYRs4zziFXP3JVI4g96bKO5pPw35BFO88xE7JvMPbnZDZckHps0hw== X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr25867749edu.11.1597146824162; Tue, 11 Aug 2020 04:53:44 -0700 (PDT) Received: from localhost.localdomain (217-149-170-169.nat.highway.telekom.at. [217.149.170.169]) by smtp.gmail.com with ESMTPSA id ba17sm14247736edb.28.2020.08.11.04.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 04:53:43 -0700 (PDT) Message-ID: <68050bc3d927050061d0b106905d69b3bb39fed2.camel@cybertec.at> Subject: Re: Add session statistics to pg_stat_database From: Laurenz Albe To: Ahsan Hadi Cc: PostgreSQL Hackers Date: Tue, 11 Aug 2020 13:53:42 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4 (3.36.4-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-07-23 at 18:16 +0500, Ahsan Hadi wrote: > On Wed, Jul 8, 2020 at 4:17 PM Laurenz Albe wrote: > > Here is a patch that adds the following to pg_stat_database: > > - number of connections > > Is it expected behaviour to not count idle connections? The connection is included after it is aborted but not while it was idle. Thanks for looking. Currently, the patch counts connections when they close. I could change the behavior that they are counted immediately. Yours, Laurenz Albe