Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOzdb-0002Ho-Gb for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Mar 2021 09:17:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lOzda-000502-98 for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Mar 2021 09:17:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOzdZ-0004zu-UU for pgsql-hackers@lists.postgresql.org; Wed, 24 Mar 2021 09:17:14 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lOzdX-00079J-De for pgsql-hackers@postgresql.org; Wed, 24 Mar 2021 09:17:13 +0000 Received: by mail-il1-x133.google.com with SMTP id v3so20738632ilj.12 for ; Wed, 24 Mar 2021 02:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Kg8KIMa2mPkjyW28Nws1HpuRMExbZd7KhIbCZmGGkfA=; b=mSYv3fYk+K4pe4QWZ9tXc6yd1nuH3LiJQ+Q5KP//+2gjqR67E+ehP4K2qiQTDygiOz ocufaYagpRcV9NT8i40jhVAZjgd3H6HmJj54mJDO9OZiUZoEeCJXpf0wmGAXftlV94yz +eZSCqZ+Dh0Lb76keG6sdZTPBNZp3JJBwSyfmTGqJl+vbVGTnYvj497I4vW6Az3vs/ra wD5YE72Nh0vOGw3Ur5cr1IIj+0WePKoIEQf9wVb0vyZL8hXEADJJSjkZfrAadbxRSuSq XrdXhef1vFf2fe6qVRqsYBlDcgqbNc4fg/D54QSljU5unYUuIXlZv3+291AOwB9KD8fB 79bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Kg8KIMa2mPkjyW28Nws1HpuRMExbZd7KhIbCZmGGkfA=; b=cHVv0p6ql+J6rgjG2p2Y+XfuSq7i+IJsHJAJiI6R9bD+yNps16AANfUwmVdb8VCqCj 8cCLUHGLUSRAKyecM8dmBXFd4nH48l6BieDJhWtDNqkVB9hAPTmNYErbIMy1uEBf5FO6 J5/QQtfUEjLTiOnWInEZyYxl3sT48aVPbHex4WYIn9Ggg8ob9dyL4aCbwQexLxWTHEeJ vxyQJKDEreSx8pIIco2dOKDwXQh2xYDv7cO+dtAFq1bphBdVQdE2POSn3EIUbINuvvlO lcz1KHS38odusBTflCtMN+FYJhAaj5uyrcKFFai78kJDY12bO7/6liUG2ucmkRaG5kQQ hG9Q== X-Gm-Message-State: AOAM531htxucvBsxxfjn2joRnVqRlfy11ibTjjmoQkhu21qUKI5mmBWI 0Aaec1j32nJ18EJ2wNTz0b0oRA== X-Google-Smtp-Source: ABdhPJyiW5ddtk4aKZX+61XbZW/7tu/+4E6DX7Vju5bgQe7MRV/IQZlo8kDNvCnGs/iXPfCbL5Eh8A== X-Received: by 2002:a05:6e02:1ba4:: with SMTP id n4mr1897745ili.243.1616577429961; Wed, 24 Mar 2021 02:17:09 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 23sm859713iog.45.2021.03.24.02.17.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Mar 2021 02:17:09 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 65FC9801A43; Wed, 24 Mar 2021 04:17:08 -0500 (CDT) Date: Wed, 24 Mar 2021 04:17:08 -0500 From: Justin Pryzby To: Tomas Vondra Cc: Dean Rasheed , pgsql-hackers@postgresql.org Subject: Re: PoC/WIP: Extended statistics on expressions Message-ID: <20210324091708.GC28335@telsasoft.com> References: <9f6654b1-ca31-f979-0fe8-137683818273@enterprisedb.com> <20210324081402.GB28335@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 24, 2021 at 09:54:22AM +0100, Tomas Vondra wrote: > Hi Justin, > > Unfortunately the query is incomplete, so I can't quite determine what > went wrong. Can you extract the full query causing the crash, either > from the server log or from a core file? Oh, shoot, I didn't realize it was truncated, and I already destroyed the core and moved on to something else... But this fails well enough, and may be much shorter than the original :) select distinct pg_catalog.variance( cast(pg_catalog.pg_stat_get_bgwriter_timed_checkpoints() as int8)) over (partition by subq_0.c2 order by subq_0.c0) as c0, subq_0.c2 as c1, subq_0.c0 as c2, subq_0.c2 as c3, subq_0.c1 as c4, subq_0.c1 as c5, subq_0.c0 as c6 from (select ref_1.foreign_server_catalog as c0, ref_1.authorization_identifier as c1, sample_2.tgname as c2, ref_1.foreign_server_catalog as c3 from pg_catalog.pg_stat_database_conflicts as ref_0 left join information_schema._pg_user_mappings as ref_1 on (ref_0.datname < ref_0.datname) inner join pg_catalog.pg_amproc as sample_0 tablesample system (5) on (cast(null as uuid) < cast(null as uuid)) left join pg_catalog.pg_aggregate as sample_1 tablesample system (2.9) on (sample_0.amprocnum = sample_1.aggnumdirectargs ) inner join pg_catalog.pg_trigger as sample_2 tablesample system (1) on true )subq_0; TRAP: FailedAssertion("bms_num_members(varnos) == 1", File: "selfuncs.c", Line: 3332, PID: 16422) Also ... with this patch CREATE STATISTIC is no longer rejecting multiple tables, and instead does this: postgres=# CREATE STATISTICS xt ON a FROM t JOIN t ON true; ERROR: schema "i" does not exist -- Justin