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 1sfylB-00DvMt-NB for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Aug 2024 09:33:09 +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 1sfyl8-000LlS-Mi for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Aug 2024 09:33:07 +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 1sfyl8-000LlI-Cr for pgsql-hackers@lists.postgresql.org; Mon, 19 Aug 2024 09:33:07 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sfyl1-000Pw0-Tc for pgsql-hackers@postgresql.org; Mon, 19 Aug 2024 09:33:06 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-49290ce47c4so2314501137.0 for ; Mon, 19 Aug 2024 02:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724059979; x=1724664779; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6833NOfQYgi7U8q608YkuDwwEBD2dSEEd65SNWDzrT4=; b=Lhc+S1IJdFU94E/obftypfp6PKFMP4hxTTt9Vla5T1tauWjJd+b80AtU8dEeItEdVS qNRFCNI3X0dlAW1EN63Aan5XehhRihBCvd7OgMO/ckvtobExJcAhYbRXzslQMcU28T02 tfBZfr6YDyddWy9hbUP2j5fMo6vKhRXOP9iglIanco+1pBIuq6qm/kQSKDeuvPNfY98o uCLYFHuQTMkUhGxFVia1M+mx8hoIoIH/RRXr4NBQno630cAwjJ5fVgvYiyQ2ziTXBZR0 DMwB07/JJo2AbXfNactth6BYGPbbuRFDCjdZn2D200Oa03mNKaYQxrC65T0jRkhKHNvR Q1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724059979; x=1724664779; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6833NOfQYgi7U8q608YkuDwwEBD2dSEEd65SNWDzrT4=; b=Y18MKdoBS1ALsz3RQ2pBFIsW5g+8BIPaDOMs9KNB6FuA3uizYkb565CJMq1tEmpO+U wjUQ3CZzgCWWEe/40AvZB8RnGoJ7rxcAwPobs2F0V56H5ED6VwWjucpXEeIGkEdwJiOt qaz1KrjBr4KihL56BMYC9W8zy8WIqbc6FYw1J+TwtTjZZQGcZ2VjU/t2lsFHaKe/U6mv +s6o+0Qsk+V4j+CoHyp2CtHCpsJ++umg/1sHuMwRliRhblmwDqloI/8Bi1gIjPTzHnZt 1WdYQ9k7wVDJfIm3rGwKMztMFKh7pEbEvqWtR6ZQSwmjOjIUQ4YUQnoz+6WVxgVtFMX1 sjfQ== X-Forwarded-Encrypted: i=1; AJvYcCUQ+cvX7zt+wkX++L/q1ZSk8PZ2ZeiRohIrdrA3icnG9GsGIjut/+xkOtET8KBmF27pf7SCcDay9HGQ6mp/@postgresql.org X-Gm-Message-State: AOJu0YwXrNrDXpoyePZFBE9H/YeKScx9QtfmGWo1RZZDXyY/Lay+0LS/ NaEGn+Okw0ACZkzo4iOOqyCAQoXDOJ0Lluv71SPfqHLlP8cLRvSZSfGbnG01zeY2EMnVqaapCJ5 cII5YH+buwoT3bRsUkWs3ut/ksrE= X-Google-Smtp-Source: AGHT+IG5/8SBfN+bIsDK2+O+2TXoOB2EizrZuQQ6r14soAZ58bKRfzDFUUl5vEs2TmOUcdtmOFlrmtWkloC2NnAMhHQ= X-Received: by 2002:a05:6102:cc7:b0:48f:3411:4021 with SMTP id ada2fe7eead31-4977b87506dmr5284417137.10.1724059979088; Mon, 19 Aug 2024 02:32:59 -0700 (PDT) MIME-Version: 1.0 References: <53c47c2d-72a5-44f2-900c-9973b2af1808@tantorlabs.com> <4a902cea-54fb-41b5-b208-b84731a5f577@postgrespro.ru> In-Reply-To: From: jian he Date: Mon, 19 Aug 2024 17:32:48 +0800 Message-ID: Subject: Re: Vacuum statistics To: Alena Rybakina Cc: Ilia Evdokimov , Andrei Zubkov , Alena Rybakina , pgsql-hackers , a.lepikhov@postgrespro.ru Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk in pg_stats_vacuum if (type == PGSTAT_EXTVAC_INDEX || type == PGSTAT_EXTVAC_HEAP) { Oid relid = PG_GETARG_OID(1); /* Load table statistics for specified database. */ if (OidIsValid(relid)) { tabentry = fetch_dbstat_tabentry(dbid, relid); if (tabentry == NULL || tabentry->vacuum_ext.type != type) /* Table don't exists or isn't an heap relation. */ PG_RETURN_NULL(); tuplestore_put_for_relation(relid, rsinfo, tabentry); } else { } So for functions pg_stat_vacuum_indexes and pg_stat_vacuum_tables, it seems you didn't check "relid" 's relkind, you may need to use get_rel_relkind.