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 1tQMXt-0021y8-M9 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Dec 2024 08:15:10 +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 1tQMXr-00C6Rj-KF for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Dec 2024 08:15: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 1tQMXr-00C6Pm-AD for pgsql-hackers@lists.postgresql.org; Wed, 25 Dec 2024 08:15:07 +0000 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tQMXp-001W9Q-56 for pgsql-hackers@postgresql.org; Wed, 25 Dec 2024 08:15:06 +0000 Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-e3c9ec344efso4845029276.2 for ; Wed, 25 Dec 2024 00:15:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735114504; x=1735719304; 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=wtKK/ujKsidglB9zRuGb4i4uApQA6c05NWXX5kZMyvw=; b=Lcidkcg1wKMrKp6EM2RBPV+lYPvppRJdxf0FL9aW4/Y7YDCG4g2/IJqyo5/fOdM8v8 fmu51uSHcqTpZtmmrFCzSNYo07vBdmyUkS59A5jjWIhrW8JxgI6DkHng/kZQ7zIkQ/Xp QlF4MTIxlCKBfqPGAVADuXceCPLCNU0sztvOZQZ4qOguD99n3pmCkaholWRw9mG7gERW x3o1FAkSun9dSvkB9JF4vAd64CpitmIKHr/lsrFG/rg3q5eUIDruRiBA5aHjzAwt5mcd CbFdIpMWoDhOZ62Ia7nXMd4fVLF3rOTiBMVw57GZLscEqZhBpm7uon3MbRFwFvwEIvig 8lzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735114504; x=1735719304; 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=wtKK/ujKsidglB9zRuGb4i4uApQA6c05NWXX5kZMyvw=; b=Kmd6fctPrSMOlU0n5fzUk1GBN1x6tglOGOJKsHsAqP+sMqzLst2+HpRLmuSHnnn/YO iMispPPaFkZ7DBGrNp9e3Jh82N8Ntx9ieWzvB3iyhP5i2yDeYeGGr+WEhJ3Wz9QvIqg+ AJPsTvhQ/xOllJ12bhOWgR9t75U45zn5v1qSECi+Lp/80eZJGgzd4uxYhyyPZwKmRfNS fJ/MfXfNdALiNN4zJlsvvXjqyM53e/PNqPwnBy70BkTk6JwygfbFF8Xp0GH74ladKsl1 f0bTZ8kDRr8Jb9l1HNwdy46EakuX4tyOe7yBbMiTZeIC/oWED2vg/BUnp6OZnsWVtLbN IdNQ== X-Gm-Message-State: AOJu0YxWzB1lHgM5ds9++x5fEPi3pBSy/PNFEyHVHYGPBLGms6ZfG0/d e6j5kjj9GfsCgz+EZbgkv9izoPK17K6l6tkbOfjNXpa5me8X0gdlE/A3pY43qK5iHFvTX3mitQr hsPmoDlGuvqKA/0u87SK0UH7ioms= X-Gm-Gg: ASbGnctyZ+mrba8I7zHoFge5WSfrMTHt+Xa7gdT9zD26X8SnEJvHxxJpXq6KXzAXAMO JpOd7Bxj6hv0jd8RUsiXB+kCEUaRaH+rQtxSsaTVnxVbjwmFjnlgqdSCt4FtC7oXEJDRlL8c= X-Google-Smtp-Source: AGHT+IGXCI5coXn8p936xLnby03P2NzMUlhbtVoIXlvFnGaVNYliuiRXy7EUh4Z5rVBb68hxD6Ec6KnEihSNMMdTk6Y= X-Received: by 2002:a05:6902:2206:b0:e2e:4315:5503 with SMTP id 3f1490d57ef6-e538c41b120mr12226481276.51.1735114504258; Wed, 25 Dec 2024 00:15:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Guo Date: Wed, 25 Dec 2024 17:14:53 +0900 Message-ID: Subject: Re: ERROR: corrupt MVNDistinct entry To: Andrei Lepikhov Cc: PostgreSQL-development 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 Wed, Dec 25, 2024 at 11:34=E2=80=AFAM Andrei Lepikhov wrote: > I have a couple of notes. > 1. The nulling_relids provides us sensible information about possible > nulls inside the input. We are not using it to estimate the number of > such nulls for now. Does Your idea consist of obtaining 'clear' > statistics and reusing nulling_relids knowledge somewhere later? Are you referring to the nullfrac estimates? A RelOptInfo's nulling_relids records all above outer joins that can null this rel. However, I cannot see how it helps with nullfrac. > 2. It is ok for Vars. But what about expressions? We use equal() in > distinct, MCV and dependencies modules. Do we need to remove nulls > before using extended statistics as a general rule? AFAIU, the expressions in extended statistics are not decorated with any nullingrels bits, are they? Thanks Richard