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 1sieEd-007TP8-3D for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Aug 2024 18:14:35 +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 1sieEb-00D7GO-8j for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Aug 2024 18:14:33 +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 1sieEa-00D7GG-V9 for pgsql-hackers@lists.postgresql.org; Mon, 26 Aug 2024 18:14:33 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sieEZ-001YeF-06 for pgsql-hackers@postgresql.org; Mon, 26 Aug 2024 18:14:32 +0000 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-39d34be8b64so14740255ab.1 for ; Mon, 26 Aug 2024 11:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724696070; x=1725300870; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=unzcQ6sLpGOedYH26g9wCIZFjBEnXRhHQY1KHop23Ps=; b=b/H6m1vDt9s3dMsAAJX3QM8uHRk1eMIKlmtNYCVMQ0RaywvwNjc5zJPcLNojWOg7wn mkqFZM1rUbk25r/MSY82sptJYPyiV3g+21w7IgYCH2frm5smpAlvvdGumVxYHPwdPpRO /h5p60C9rfgaRTE0SxEKdNYcgWBVX/PeGf/0DvsIbq2U6WJpyQRlcbZnmmCvNN84MzOX zPZW+Z5aNjEvcDjwQQjIDpfogwptA9XpV6vO4NiN62KOHeqlhc6fZyXE4tk53KeWqOSd 5pifkQyCa01AiX6wT47kt4zKE+D2gFOCGqpmSKQRx2Cbm4elYweHQXNbyoKh7qp4xbER teIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724696070; x=1725300870; h=in-reply-to:content-transfer-encoding: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=unzcQ6sLpGOedYH26g9wCIZFjBEnXRhHQY1KHop23Ps=; b=QFfiy8sGROOuyPUruoT1cWEgObMpOTo8JTQGuE2uT2VfBMIlGzlthYcq3S0mh07JZw NFwrhTVhPOa/KPKEG4UdZ7nFBq3jIncjuMebpVwY4iL7fhujX8UxF/ZPbYbSyUD19G8B aFgLIn9ejB/+yOqz3hv1iO+c9Lh8Rk8IG8C8YKXIj7B2sKfP3ngr/8owZ+4XNCE/u3WX JFf8+1LqIurCsjxIhcacYOoLIk1pgpqVPCjCATY6wCn5ldpukLVLgtmF0h7QUyY9PVqL F2A85hf/dMzYuYUrQif8q5dlHLtnCUPlnQN0JJz7DN8CHFXMsun/sKs/yXYcvAcEHXeP EGvA== X-Forwarded-Encrypted: i=1; AJvYcCXSHgt+v+ikzzYD98ovj9+r9EQH0apRhvtsRCeskEvpWHn6jgYBJot2a1DYASqdmF24KWV4pDZfspYx2d0r@postgresql.org X-Gm-Message-State: AOJu0Yxe3IHLnDrUi1ynOC1mkVA8yfgBkhj0BQuIYzMT8rI9hqiPxzjj 9ByJR3FToU+DeEd3rWqiPekIZORKVnZNNPR9nZx+8vfhlNQAO+nU X-Google-Smtp-Source: AGHT+IGkk1Ba0B2FNJiNuTCncMRi1FfaSvalICH38Y5nv2IT89kSlKcya93MIWvI6KZP9eYfN2vFDg== X-Received: by 2002:a05:6e02:1948:b0:39d:2387:c57a with SMTP id e9e14a558f8ab-39e3c984688mr129431565ab.8.1724696070170; Mon, 26 Aug 2024 11:14:30 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39d73eedd30sm34279715ab.74.2024.08.26.11.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 11:14:29 -0700 (PDT) Date: Mon, 26 Aug 2024 13:14:28 -0500 From: Nathan Bossart To: Robert Haas Cc: Ayush Vatsa , PostgreSQL Hackers , michael@paquier.xyz Subject: Re: Pgstattuple on Sequences: Seeking Community Feedback on Potential Patch Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 26, 2024 at 01:35:52PM -0400, Robert Haas wrote: > On Mon, Aug 26, 2024 at 1:26 PM Nathan Bossart wrote: >> While it is apparently pretty uncommon to use pgstattuple on sequences, >> this is arguably a bug that should be fixed and back-patched. > > I don't understand what would make it a bug. > >> IMHO it would be good to establish some level of consistency here. > > Sure, consistency is good, all other things being equal, but just > saying "well this used to work one way and now it works another way" > isn't enough to say that there is a bug, or that something should be > changed. The reason I think it's arguably a bug is because it used to work fine and then started ERROR-ing after commit 4b82664. I'm fine with saying that we don't think it's useful and intentionally deprecating it, but AFAICT no such determination has been made. I see no discussion about this on the thread for commit 4b82664, and the only caller of pgstat_heap() intentionally calls into the affected function for sequences (and has since pgstattuple was introduced 18 years ago): if (RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind) || rel->rd_rel->relkind == RELKIND_SEQUENCE) { return pgstat_heap(rel, fcinfo); } -- nathan