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 1sgzTk-00BMxJ-69 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Aug 2024 04:31:20 +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 1sgzSi-00GuJj-Ed for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Aug 2024 04:30:17 +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 1sgzSi-00GuJa-2m for pgsql-hackers@lists.postgresql.org; Thu, 22 Aug 2024 04:30:16 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sgzSd-000tIm-PU for pgsql-hackers@postgresql.org; Thu, 22 Aug 2024 04:30:15 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2f15dd0b489so3843251fa.3 for ; Wed, 21 Aug 2024 21:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724301011; x=1724905811; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DdN4n0WbkzktWUWEhCViw7k0hRoP7mL5BSo0gp1NNsQ=; b=Lqe6EpbMP1EnybxXgDCpdjCE4q11CIgC4QA+FQVW4a98KRZPw2HRmZ0CQ5jBTKGDD1 iMpoQQ/aFdRftYUh3x7D05T9Fg/VtbrTs1Ccl/9BZLJLsVtpRkoSJSYRHw+xCrdJTPwe udMKsFuYJp8bvI3vfGo11zZieQCYCOHySwVqA+nFBZts1j/DGarQLNV3U3ivQRYmnb6D VJjmk/AfwbxehG1DsKJAVN7SchzywhLaAHEQ7GfDYXVUF8rn8fr+TyfHfYwQOBPpt+Yo k9W0zfqT7PaG3S81K8UaxN7Mvw9tFsOSZvzUp3c9okRy05vKiaeLxNA4HybLxyu9Il53 x8Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724301011; x=1724905811; h=content-transfer-encoding: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=DdN4n0WbkzktWUWEhCViw7k0hRoP7mL5BSo0gp1NNsQ=; b=YL7rX1J95DfNimbe+1J3Rxl+85Jf8ONQX0Ix9xQ8A6FMPCEy55uQMCZBnx6zzSLwH7 /OxXcZDuv1Az7OzeprRRWvJS1joWlclWyPmqdxTGygzHKWN/3ALMqg3j+zPkpFnaKxb4 ZgoJQwYUkRJRZCyoSjo/sf7mMBRnBtphxK0yBLay9zJD7YJdquKTNCghNHdRft6EOdNq pQ2xC2R7H9srKiiUWq14Tcsreom6Gs1UTe5OJKdjYv/TUMS4YeAtP8GmikQz5tKxQKpy 6N8J1sPnN0dAP7rj7fNxeP7L1h6PBAnCtpyfBJWmyl1y2HZhwZFiLq0h9fZC9UGdZbFa lAow== X-Forwarded-Encrypted: i=1; AJvYcCWJKa533p65dE+aaf5F517RgKp6m4VIuuqyOGY6WkSF+UKm4zxIgPojk6Hr1jFP9eXPMLMsWtcJB2YwsH+Y@postgresql.org X-Gm-Message-State: AOJu0YxVPDagJnBC9vbB2mAx9WEzXFw4UPnT+F1T3a8IO2c3z1UE91Gb g8yjDxJ+V6GCjpF9oy4LrLTu00Qez3sW+1rvYvRORL995ow7U4uF+iCC6gYiRdMIoxTqM5j9rJx tIyHX8vOrUQm6+DOhBOaPI2PI19bhH77SSmkjwi4w X-Google-Smtp-Source: AGHT+IHNCzFhTZWutm6LuzC1V90y9do6sUh+yfIf+lvgcoTvhLhn7PsVc8k/KCI4+6ITq5A0jy03Akgl12fypeOVGu0= X-Received: by 2002:a05:651c:153:b0:2ef:2b06:e554 with SMTP id 38308e7fff4ca-2f3f8878f0bmr28027381fa.15.1724301010170; Wed, 21 Aug 2024 21:30:10 -0700 (PDT) MIME-Version: 1.0 References: <53c47c2d-72a5-44f2-900c-9973b2af1808@tantorlabs.com> <4a902cea-54fb-41b5-b208-b84731a5f577@postgrespro.ru> <78394e29-a900-4af4-b5ce-d6eb2d263fad@postgrespro.ru> In-Reply-To: From: Kirill Reshke Date: Thu, 22 Aug 2024 09:29:58 +0500 Message-ID: Subject: Re: Vacuum statistics To: jian he Cc: Alena Rybakina , Ilia Evdokimov , Andrei Zubkov , Alena Rybakina , pgsql-hackers , a.lepikhov@postgrespro.ru Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 22 Aug 2024 at 07:48, jian he wrote: > > On Wed, Aug 21, 2024 at 6:37=E2=80=AFAM Alena Rybakina > wrote: > > > > We check it there: "tabentry->vacuum_ext.type !=3D type". Or were you t= alking about something else? > > > > On 19.08.2024 12:32, jian he wrote: > > > > in pg_stats_vacuum > > if (type =3D=3D PGSTAT_EXTVAC_INDEX || type =3D=3D PGSTAT_EXTVAC_HE= AP) > > { > > Oid relid =3D PG_GETARG_OID(1); > > > > /* Load table statistics for specified database. */ > > if (OidIsValid(relid)) > > { > > tabentry =3D fetch_dbstat_tabentry(dbid, relid); > > if (tabentry =3D=3D NULL || tabentry->vacuum_ext.type !=3D = 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. > > > > -- > > hi. > I mentioned some points at [1], > Please check the attached patchset to address these issues. > > there are four occurrences of "CurrentDatabaseId", i am still confused > with usage of CurrentDatabaseId. > > also please don't top-post, otherwise the archive, like [2] is not > easier to read for future readers. > generally you quote first, then reply. > > [1] https://postgr.es/m/CACJufxHb_YGCp=3DpVH6DZcpk9yML+SueffPeaRbX2LzXZVa= hd_w@mail.gmail.com > [2] https://postgr.es/m/78394e29-a900-4af4-b5ce-d6eb2d263fad@postgrespro.= ru Hi, your points are valid. Regarding 0003, I also wanted to object database naming in a regression test during my review but for some reason didn't.Now, as soon as we already need to change it, I suggest we also change regression_statistic_vacuum_db1 to something less generic. Maybe regression_statistic_vacuum_db_unaffected. --=20 Best regards, Kirill Reshke