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.96) (envelope-from ) id 1viRiP-006TSb-2O for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:29:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viRiO-00574H-2i for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Jan 2026 06:29: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.96) (envelope-from ) id 1viRiO-005747-1j for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:29:16 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1viRiM-001fNg-3A for pgsql-hackers@lists.postgresql.org; Wed, 21 Jan 2026 06:29:16 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b876c0d5318so817300066b.0 for ; Tue, 20 Jan 2026 22:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768976954; cv=none; d=google.com; s=arc-20240605; b=amy/HLlFYLKqM6mYKRi5/rUi7oNzo7VEg9l4G9eGr+rpJuWWaq1OER6OZo2vGkq3Nn 3RxUA/4rcYGu98ciuKE+j0tmuY20AJNjayjrvFjTLVdKsLy8fpl9sHxA5eLSXevz9VdN qwKj7hf1A4NPars95uOsyfgxJlT7KZTnk6CzCXMf3o/fixbIUELfPi9QhYqSfoyJUCem bm6Wd0Ez28pjxs43HnwEAU9KljjqF4ljXariI4kBl4l7GGYStHuQy83//5Kp/upTrd/P pfeHimgsTN9pIoHp+cJe4Um5N5BQ9cRX1yYi3ajN8sB71uP85seYG5VB0AwVw3xyJuL+ /2GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=S3i5XfVEHl/yl1cOAG1waMHhutKKGMhZuZu5IUtLPhs=; fh=s0J7cJJrqjIWotcqikUQzFEHmFmp3fJCSco89h8uTFc=; b=BiVzSuatohnsY3irYUiL5njqlBT3m5UsXbTrSKUSJWlkCfKy4DRnzgEKYQN8IIxJYf KdTjNMNPB/G24Joovvjr+4Bn4RulUTcSQeW4G+3dar+mZ2vx2UthtynVOwiinTsUQhu/ ywU50WuL7BDOQRpD7Oz2LE30VmlnIBorrHlxC1IvyKA7bpo/RR+gyegNwu2bpfkAqLMB vTAz/yzESI4n957p+ajpxhoeE6Z42mx/VdRcvRyu5YULtdMfNe8jEtxcYyPkPBWWdO9m E5Fi4vOaumP6nYy1yj1ALdFxLgmh/24MyHRBVx9F8tkgNDjkODKIM3javfmeSEl7mWLO ghtA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768976954; x=1769581754; darn=lists.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=S3i5XfVEHl/yl1cOAG1waMHhutKKGMhZuZu5IUtLPhs=; b=XkHhAxv9LvRGeysJ68s3Gfg//6QGJrp/O90idDUHfDyAOGxDbbp5gBWNcG6tsl0D/n q0pIC+EPdoKs+Hnjcofv7BkzPELYQxj/jYI/XNOFdCHhy3Raq33j3twmbgsvnqX9T5DI 90BUx3ntgNhzHA2lfUxOIYfpsDOsXq4XChxy6f9w3UXkqw9PAdSv6EfeOFledkZE9zJV dt0ylU8Kq/lzOH+6+zZmzivLOsT87K8AnFr1fGi3pdhgdA38UEnAdoC2W6yXJ4ReqEBk RcL1lNRIcRLs2DabNr1ox7/njAgaNS+hCgv3EcdE0xNDcvoCI8RD74sMiFTF8SM9jMn6 SxJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768976954; x=1769581754; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S3i5XfVEHl/yl1cOAG1waMHhutKKGMhZuZu5IUtLPhs=; b=jsB/C95TVd5s/HVxS1nYOCNHu3XpGrfmjnrlE7l0tDilCglz7gB8oFhLorbRbRZ8M3 Dr4WmZYKazTNm85U7YTzRgPK2B1Rkv9b7w/ZfJUPt9wt1bW5ruXX+02GFwN0o/otgEkE raalc6H4r1QyIv8Z9TLQmOytqB7LH1JE22oMJTXvw8+V/sRNX0BPcI5DbbXUUQP8vkvb PWA3UAckDkjV8bBl7lmhpikJPUHVAz5E6rZMqlGynENJs7pnyrlRnhoNIjyKhWdh1fQi PF8geHMGLTXosVl9qtKH+PkVtQCWlvX7KG28WoLu34noTTcPYWoilprKv3AT6lOnOVfN PH8g== X-Gm-Message-State: AOJu0YxTpDVjqIuRPfmwRuyUWfquYI/pJvtWAN2WGYEto+/WwuUjpvzg oSzuIvUutZmY4ZkLdvXDV5OIf3jktCyULGFDuRJENYXZSOk4cVcUfFkFmEMHdQL/5DBdCYxbe55 HKAxmg/IJDMAwIXn1hvs5rdLCMnvxXzc= X-Gm-Gg: AZuq6aKLTflGLmjwVXuhzQKHQdvzZDesyvU0CzxlsiQUDTPgXV2u7esrK3YSbDeNpLm WBpc8xj/Ad58dC+vrK2pdJqoVXzPtdHFq7Gl7dFPgPwlXsZgrhkMy4XD7KBe//JbqCQtLzOAZKi bndFuPkd6IuIRwFdwfIffB0H5R81RR5e2Tfpbm4H5gPZ2QK29F3RD409JU75IOXGuJdQxz4oO/V VeqMQ8FfPgANlW+33BfwI0wS8aCv0qxq+8FHC4JVmnzxNsYdUGg2Aa24jRTxUBD0Vozo+Q= X-Received: by 2002:a17:906:fe4c:b0:b87:67e4:cac5 with SMTP id a640c23a62f3a-b8800234f44mr376583166b.10.1768976954019; Tue, 20 Jan 2026 22:29:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: VASUKI M Date: Wed, 21 Jan 2026 11:59:24 +0530 X-Gm-Features: AZwV_QgoCD9bN5N-AVUwFieB-cW_PNJ7nru4nVPg7nTfgodrwXBH1DZNocsYQTQ Message-ID: Subject: Re: Optional skipping of unchanged relations during ANALYZE? To: Robert Treat Cc: PostgreSQL Hackers , ilya.evdokimov@tantorlabs.com, Christoph Berg , Robert Haas Content-Type: multipart/alternative; boundary="000000000000f5d3930648e00a8a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f5d3930648e00a8a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, Thanks a lot for the thoughtful feedback. The points about statistics targets and random sampling make sense. In particular, I agree that even without data changes, re-running ANALYZE can still be beneficial (for example after increasing default_statistics_target or per-column targets, or simply to obtain a different sample). Given that, my intention is to keep this strictly as an opt-in behavior, so that existing semantics are unchanged unless the user explicitly requests it. In the current prototype, tables that have never been analyzed before are not skipped, and SMART only considers relations that already have statistics. Regarding statistics targets, since PostgreSQL does not currently track which target was used to collect existing statistics, SMART ANALYZE would not attempt to account for target changes. I plan to document this limitation clearly so users understand the trade-off when opting into this mode [for now later will look into it]. I=E2=80=99ll take this feedback into account while cleaning up the patch an= d documentation, and will follow up with a v1 proposal once ready. Thanks again for the guidance. Regards, Vasuki M C-DAC,Chennai --000000000000f5d3930648e00a8a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

Thanks a lot for the thoug= htful feedback.

The points about statistics targets and random sampl= ing make sense. In
particular, I agree that even without data changes, r= e-running ANALYZE
can still be beneficial (for example after increasing<= br>default_statistics_target or per-column targets, or simply to obtain adifferent sample).

Given that, my intention is to keep this strict= ly as an opt-in
behavior, so that existing semantics are unchanged unles= s the user
explicitly requests it. In the current prototype, tables that= have
never been analyzed before are not skipped, and SMART only conside= rs
relations that already have statistics.

Regarding statistics t= argets, since PostgreSQL does not currently track
which target was used = to collect existing statistics, SMART ANALYZE
would not attempt to accou= nt for target changes. I plan to document
this limitation clearly so use= rs understand the trade-off when opting
into this mode [for now later wi= ll look into it].

I=E2=80=99ll take this feedback into account while= cleaning up the patch and
documentation, and will follow up with a v1 p= roposal once ready.

Thanks again for the guidance.

Regards,Vasuki M
C-DAC,Chennai
--000000000000f5d3930648e00a8a--