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 1tWHm1-00FWze-Nc for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 16:22:14 +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 1tWHm0-000YpK-Mc for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2025 16:22:12 +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 1tWHm0-000YpB-DI for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2025 16:22:12 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tWHly-000u20-0H for pgsql-hackers@postgresql.org; Fri, 10 Jan 2025 16:22:11 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-305d843d925so16704641fa.2 for ; Fri, 10 Jan 2025 08:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736526128; x=1737130928; 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=XF1gFS1bOOKhf5FPwoneJm5F7i/305APd74dhO48GVc=; b=l7ctvXEuwPSTWX9cJ5Xq/M77cwI17YdcUkSxUtHjH7rm4S6SS2IhLB9qf8nsLwloe/ DGaMfgcdtVA06eTQjOQJO1oEX74fqmrZsshsEeIRSshYLOFd+3aQYyBXvPXY7lDIEYev UhFYwZnOyIaKHfKaayWCK7hLaBYF3NysZkmziKDgnlYWppS2rRVBkkY9W+CV/DMOnQk/ wqnE62NQF19JR2ydq7VCSoPIf2H1ymapbhT/dBuYIIcS4mwzQVrA1MY0z785/f90+hUC UN30rfHpsYUkQRFhDTMV+fqxNTjKz8E3Qw78zVdy9dRvHSw9oChpBTBE0LVPer0/f0BU qhtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736526128; x=1737130928; 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=XF1gFS1bOOKhf5FPwoneJm5F7i/305APd74dhO48GVc=; b=krbISQdBY5DHzN/+3oUQ7EXGT08G3SWMSy8tPQh23NaJJSmFl8bcdm+Z2YY9W+Z7Gr L+xXGGFDe9xYVcyid+2+E5UJyejyl2pZ50FqwycdQuDNRmI4lgZtgYVMLAh5PgJQGDS/ pJgLZWc8V7rqa3CG1TGmn0sEScWxHoFsLRn6lJaHnw/we7sbQuzcY8vC2MsTzoR7SZSu HbD9CQXgg9EM9aMGAtxhgbn2E01v39kQbXQ/LihVVLJhRMhZIOdgi/xcIn+U43epgSqn lWI0cK/qRSILnKqIit89bHzWZl4ugrS/JWKi79IB+WI3MyBFSoZDtWrPKPF17IFVbAEH vb8g== X-Forwarded-Encrypted: i=1; AJvYcCVS305HtqKO3K7ve+coNMc2smjrwna84t3RElGwb0/gVQITPzRgIzOaixgFe3EwJNocj9PS94WCSVAMz8vO@postgresql.org X-Gm-Message-State: AOJu0YwWpUjNJFAui7waZrPpyHeeZjXVMjjTUvPpqFtl3dJocpz9fKS0 T74D9wFR7UhhBUBxtBQsywGOq4rmieDVnfN9030EKa6wZkBTHbL57NDboCkoNjGnVTIxPFDqX+N ZkV9d55i54+27xpdLXuJU/aj39yJwsq7AEWU= X-Gm-Gg: ASbGncuBxl3C1r5XvbHoePaRubJmxN+dnI6BiEvllJwg5R2jsCV5B0ETHUR5yxoqEQs Xy8qdBsNvL1g7j6tulDC4Y/a9RpXgHTs30qUG X-Google-Smtp-Source: AGHT+IFe2daYtEVUF493aV7mCIbDdA5ofjjYjIl9VG5zRKIHhkXClG/+0Pe5BTH4YdpdvJwKXVpzsvAyUHGWax5b5X8= X-Received: by 2002:a2e:bc1e:0:b0:302:4a61:8b85 with SMTP id 38308e7fff4ca-305f45f260fmr39443161fa.37.1736526128062; Fri, 10 Jan 2025 08:22:08 -0800 (PST) MIME-Version: 1.0 References: <594fd111-8016-4f44-bc8c-e1a0d66f26f6@postgrespro.ru> In-Reply-To: From: Sami Imseih Date: Fri, 10 Jan 2025 10:21:56 -0600 X-Gm-Features: AbW1kvaSfdv1yc0YYfKMJpNMwMuGNoqlK6B6tO9tYmyOlTlDNCB6pZUSoo-qa_c Message-ID: Subject: Re: POC: track vacuum/analyze cumulative time per relation To: Alena Rybakina Cc: wenhui qiu , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > > this information gives a complete picture of vacuum efficiency, because > > analyzing only total_time statistics does not give a complete picture of > > what vacuum did: was it cleaning almost huge index, cleaning tables or > > just sleeping. > > The purpose of total_time is to be able to calculate the average > time of a vacuum per relation from pg_stat_all_tables (by > total_time/vacuum_count) This is useful on its own to be able to > trend slow downs of vacuum ( or improvements after vacuum tuning ) > for specific relations. > > The work going into [1] is more detailed and will be useful > for deep dive investigations.In short, I think both proposals > have merit. Missed this point in my last reply. This patch also tracks (auto)analyze per relation cumulative timing which can be useful along with (auto)analyze_count to derive the average. Regards, Sami