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 1w5n8g-003dLg-0z for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 16:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5n8e-003ZNC-2W for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 16:00:53 +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.96) (envelope-from ) id 1w5n8e-003ZN3-1b for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 16:00:52 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5n8d-00000001A8K-0tE1 for pgsql-hackers@postgresql.org; Thu, 26 Mar 2026 16:00:52 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-7d75ed779bfso932538a34.2 for ; Thu, 26 Mar 2026 09:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774540851; cv=none; d=google.com; s=arc-20240605; b=hJtG2W0TjAhYInOeqY+1O8rl6uzQnMC1fofJs7eEcveCLyw0cuKPjZ2oABs2xHTY4E AURLzDAZQZVqOkGnDHJGMpM8+hTWGNAaUeT54XplrQujFP1tP0budFIe/OqHhk2olmRC aIsAt0tzPm2o3ri4Un934/l2BAXpPkrjyuZc9lVJuiG4IaVhXuGbEpwjTqub0kDh4dFf DeIlCPXdaEX9JqgaPLKqtt8eileQafaN2SJQlqMIPlVVxRlKXiSr82+CATvL2SUjETu9 +8sig+gRHxt+0w3GXw81K85iQd3mMZ9YbxFJ6IGtqmUtjYpp5fZJ4g8TDLDQGaPaliFI knCg== 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=6/1sRAWJgl3QdhJgwqqhe8oHSeV5l2vjmBLmMXOw/lw=; fh=jhHdIczSXaPTNlMhCn0iaTzkElzKUQ2dUtlcz0u5SJE=; b=kR7724L8ig4Ah3I5by7kY89Dch/lj/gVoFnTIGjc16KsLz3Mz/MxkaOjSJKEPgTuxa csXr+cdmM1sEUAT+odSAX3nNubU7VUlsQIbb0+qWSPPn4/Hip1lkCXWCSnhWyszJIdCV FXSp/Fw8jL/VEdovxoQzQvLIrezepqpJFQ/G1D9v46YL06HggMzlLKEBrir7gyHi5iBS Ouk8sPiidNuX/lbYqqAFAe3AtmdFo1ji93s/6UJeYcCXlnF5MeE4lTzm1kKtmP4WTjfx aqmlD4Z/WkNb2MS+pyXrt5XZKHaWHbVfqwyQuPqR9wGIIcsRmpoiQrREU+5+MyRHZEbV aSLA==; darn=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=20251104; t=1774540850; x=1775145650; 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=6/1sRAWJgl3QdhJgwqqhe8oHSeV5l2vjmBLmMXOw/lw=; b=Vw+qXt/dHnbQHegqlVlwlYTNj0ePEGUDZRlKASLPPYF2N3orG93fvJIoip3s8ycHCo qu95dqQw7tjPRnK1MwnvPd5C0RXrLcQkxuMqPgm1IeFVnUFJEaMZiUdbQWFmvtTJxUak AVeJt2sZqGWuh7qtGxZU5CAWgkfqqxPn1urJ11JOJoUiKFH6KS8UaJl5CkL97rwIbtmI bKuFzbFOJfuUj/gvtvMP1ayhdaY/NtN33qapcZPFZ/peojk3+oVNLvwmY+3jV0a8hLL4 OW/FSkmc9pAe0ZAE8JQcvRTUbiyXkk6gUxqiMW4kaRLhTU0vYpcxMHW+ifkCStxfgvSp jExQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774540850; x=1775145650; 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=6/1sRAWJgl3QdhJgwqqhe8oHSeV5l2vjmBLmMXOw/lw=; b=rsj+arCk4IHCbk033EZp8RbEWMql3KSEUomSN/LN+eLc8paYWsPjbTJdjXPnzJMfYF FUrp4HZ0hUcavs+xpYKujvet5wjD+CzLlvF2KbGJzK3VYdkPnZXOxyWYc5rRSpJUwGyr DCYNQH1rIVY6jmHibuVu5aymvrxiiPh9B9Ta2SY3Jwpdf9W1cwUaRJUZWUCHpgzh4DqN zLZw1CzV9uCUwbnNPd0FfsU3FLoXml9V6V52Eauev7V5MBRcYmZaS+fC5x8c7kd1hoiz wLg88KC1NGTNaAjszK8OhEN0EQTkHq4deUN8CT7KJyPw80zJiOoIWfDrV54zmWIMzgQ+ 2zuA== X-Forwarded-Encrypted: i=1; AJvYcCX206YfbHRxFt1dkgdfHxg4vSD4SoqQhxdVCiLsuKVpKJRyWnnAn4NkPL5LDaV77SisedlDXN5TdcAuL9nJ@postgresql.org X-Gm-Message-State: AOJu0YywZ8Uqoauql6QSER+pAkmEjP84pLeZrtMduIPU2dNA6C8RCZqG ePZ0xb9gQOm2Qs1ZuH1fysyBsiSnIOZwdti3ipkjJppKxXlml1F1/PKhzx38SeWp7n5z1yE4cDr FRXKZ/aKkybwSRU1gzaHPh1zcZkAnbXMjxawr X-Gm-Gg: ATEYQzwaysyJUhjrEchL/V03SCqO6S0Wv1+t1x+SQHRRm58sJGRsd4bxn1GsCeKufj3 ecZBUMcxM0tc5VVKt2IVHOTe38roPoM/Eg69kIhCGnL/rfvey/LT51HeRy05mXNo9z5EZi7Dw5j snPcHK+oqmk2K+fLFddkNWCkxW9qf5w0gwJTdEBcTU4YUijDa5NxlfbC8GwbvQVhWiiySq878Hw /Q+uvtnZZXPeMco9n9xUS6gwAeVdWvXzdFQWf/MjjFFqHcwLdXQePLXDBaZKXY3GQc4nP1Emnuh /AonXPPK79KUcvOMCuWufvAc/J0mQ2b4Jz2POxAVsA== X-Received: by 2002:a05:6820:5108:b0:67e:985:fcf8 with SMTP id 006d021491bc7-67e098600afmr1789863eaf.32.1774540850516; Thu, 26 Mar 2026 09:00:50 -0700 (PDT) MIME-Version: 1.0 References: <20250422181006.dd6f9d1d81299f5b2ad55e1a@sraoss.co.jp> <20250624170533.3caeec7d6034cd5ddf4f00d2@sraoss.co.jp> <20250801002830.143b25971fb9594b89d96aee@sraoss.co.jp> <20250808122125.e9eaff938f8c83556f337e50@sraoss.co.jp> <20250820141028.dc06e0d1d787ce1151f69ed6@sraoss.co.jp> <20250902163341.c174d0e83eedfc54d68b8e9c@sraoss.co.jp> <20251231194455.5975fda68ed8e941e4afb805@sraoss.co.jp> <20260324195727.43416b69c71b5f63eed3b4bc@sraoss.co.jp> <20260325130127.7bc85919861f494ce7c332a5@sraoss.co.jp> <20260327000931.d2303c198c7c9445e90aeab7@sraoss.co.jp> In-Reply-To: <20260327000931.d2303c198c7c9445e90aeab7@sraoss.co.jp> From: Dean Rasheed Date: Thu, 26 Mar 2026 16:00:38 +0000 X-Gm-Features: AQROBzB_rc2C8MiK6Kp70i86rdcHJUxYtynqzx3qkPUJPuq4yB1w7SiZqvv9aFw Message-ID: Subject: Re: Allow to collect statistics on virtual generated columns To: Yugo Nagata Cc: Andres Freund , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 26 Mar 2026 at 15:09, Yugo Nagata wrote: > > I've attached an updated patch including the documentation and tests. I think this is a much better approach. One thing that stands out in CreateStatistics() is that the check for a less-than operator can be skipped if there is just a single virtual generated column, for the same reason as for statistics on a single expression. I.e., it should be possible to build statistics on a single virtual generated column of any data type. Regards, Dean