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 1qZYrP-005sZ8-H9 for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Aug 2023 15:36:31 +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 1qZYrO-003zd6-Ai for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Aug 2023 15:36:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZYrO-003zcs-0V for pgsql-hackers@lists.postgresql.org; Fri, 25 Aug 2023 15:36:29 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qZYrK-00100L-IP for pgsql-hackers@postgresql.org; Fri, 25 Aug 2023 15:36:29 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6bda8559fddso786064a34.1 for ; Fri, 25 Aug 2023 08:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692977785; x=1693582585; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FDV0lOoaWX7REPRYrcEaRGVkrmHmevB89uLs6HTNZdA=; b=KYABClIUX7T8xoSfgI35MnwvBNJvZXxnq1ADNovqg/oPHh5/ANjyY8oUWyQ4PNJXOW QhKVEA5yakFNofj4pOS9xL+SvNKmYPH5Na/BjPGK2hSipRiu1pMldb3Y+F8RwtWPlIR1 vClvJ4E3AEG3qxSO3x/ytQovfo3j4hYdL4O4jc6u9maCat9cPIo+lPz3WZTwaOnaWTz1 Cq6Ys6upqLdRqrhbQ3L0y2P+B1t1VF5kJLvNhca8Idxm18yKaVCoyyIxr3MLiTeKv/XX FeXTASdQ7kGHbMZFDaY/CARQWmu9hv+DgqaWyuCjnMcfhN3iSR8+0d85+wh+DwKcyP5u VTVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692977785; x=1693582585; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FDV0lOoaWX7REPRYrcEaRGVkrmHmevB89uLs6HTNZdA=; b=Kf8J9JuX/+ordG24UqPojlUYRKeFNYOPqpzU/lE7CsL1Tdcvr/egk5r4gr0hoMIOwd WgQvPcXbTT7Prtr7tSNvWsQ7GQRTCwPMGSpmWMAplZo2b2eYuC4b495gmgjJu0LTXacO 0lBOq1sRNGEsE4jSuIqFh1VjwUH06VnJuVjdUl7OVCh/eBNnNCxCMz3gxgm11PeeSY8c ahF9Vby5PYJtvnTFex/mDwnAFD4UsnXXXZxXD0CelY1xEz2F2ILanRi/kA/yxgCOKsFH NIdeVVnT9CsnN0XouvdPfl2J7l+sJlV097+UuiK3DjbLGfnrhVvzXCMPvyaa93cRe061 flrw== X-Gm-Message-State: AOJu0Yxq0CBBANFZn+S+jhZMZkEL3/VJDNRGsbjsJTVOd8q90O9jqSM0 SJGAJQJi+h1HPgRzJNzfj6E= X-Google-Smtp-Source: AGHT+IHOU4omQsSgXbYtSy5ZrU9d+hX7LKqw39OZhnYJqgtHoIM759iwyNLm5DtFEyei0530ZLamAQ== X-Received: by 2002:a05:6830:1b65:b0:6b9:cba0:93a9 with SMTP id d5-20020a0568301b6500b006b9cba093a9mr5445965ote.31.1692977784815; Fri, 25 Aug 2023 08:36:24 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:5bd:6ec:2f16:2832]) by smtp.gmail.com with ESMTPSA id s9-20020a05683004c900b006b8bf76174fsm944064otd.21.2023.08.25.08.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 08:36:24 -0700 (PDT) Date: Fri, 25 Aug 2023 08:36:21 -0700 From: Nathan Bossart To: "Imseih (AWS), Sami" Cc: Ian Lawrence Barwick , pgsql-hackers , "robertmhaas@gmail.com" Subject: Re: pg_stat_get_backend_subxact() and backend IDs? Message-ID: <20230825153621.GB1593219@nathanxps13> References: <20230824023206.GA1128857@nathanxps13.lan> <20230824025140.GB1128857@nathanxps13.lan> <20230824161913.GA1394441@nathanxps13.lan> <520F48E5-CFE9-45AC-AF81-FC4C63C3A5D2@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <520F48E5-CFE9-45AC-AF81-FC4C63C3A5D2@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Aug 25, 2023 at 03:01:40PM +0000, Imseih (AWS), Sami wrote: > 1/ cast the return of bsearch. This was done previously and is the common > convention in the code. Will do. > 2/ This will probably be a good time to update the docs for pg_stat_get_backend_subxact [1] > to call out that "subxact_count" will "only increase if a transaction is performing writes". Also to link > the reader to the subtransactions doc [2]. I'd rather keep this patch focused on fixing the bug, given we are so close to the v16 release. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com