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 1l2w9V-0008DG-J3 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 13:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2w9U-0008Dt-GA for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2021 13:07:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2w9U-0008CY-5L for pgsql-hackers@lists.postgresql.org; Fri, 22 Jan 2021 13:07:00 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2w9R-0002pT-8y for pgsql-hackers@postgresql.org; Fri, 22 Jan 2021 13:06:58 +0000 Received: by mail-ed1-x52f.google.com with SMTP id d22so6512192edy.1 for ; Fri, 22 Jan 2021 05:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Wovgfqvhqb2vgpkE7TdlYY8fXSvrBEL/Ualqqoy2IBs=; b=jLH6sdk4BbOuoZwpQYsuV1O71xP0s+oioY3kGRL8GqyNQrARuNDJvufBJxciDctSGq 4hFHjaIbCOXbOjpYaUQyHc7pkWfB+QVhIjV7gdujXQ7XhSbXByVi1fpa11OCepHYwZ4l 98VAO1ZqQSjEaEE30Sd/5Tig3We/RHLSPszFoiYhivNRgwrHrTvLc9gAk4vYy6C4XZlt J1pveYYDVnsrvMecI4VwYBhFFnvsaftbQNEEYodhbP7h42KlV5kzhgA0Nc3SWCnr0G4d w3eHvRUda+IB9WdM5Wk05HjrCDbw2qW3Nujp1iRlXcc0L2ZoHRnu6jt43jHs7bqIiUJl ll0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Wovgfqvhqb2vgpkE7TdlYY8fXSvrBEL/Ualqqoy2IBs=; b=QSvGEuUDstuXEDQWE3DjxEpziAvNetHM8TrHEIA+AxnkoO68PHu0TYRt8LfHOst4+C yRxVdlKxq7XkwAeMU1f04D07vdRExjO+733vTDHfyIDadzs+zIh7ubc/dyQfVeWN12Ft nLxCU7uDFfo0bv1bzlfCIv0KzuEv3cmuMsYsujfmEeH79nIFkxh61buJw9y7dGw5Lh+t m6/piHy9DIRf3x9w49sNudiO23r2/7RF4drmMisVYsOxJr2phx+E0Ij85bKo5RYB0KNx 375N+/M9Ie9izPPJpy+dxw08hGukdWVF2FgukD7Ca/sQst46G7+udEJ6Pwjbm5V375Cm aeDQ== X-Gm-Message-State: AOAM531ldN6QZqI/yoNSbxdvU5eDeP6ZhMtcgvvki4NtrjYgfV8FaeUb jwX2QMyVLBEp11/B3O2esd1QoboShPQTvu8Ql1290s7b/IzmCgyF7sUEIMPn39iwGfvsU9EEqgs 5MdZ2WnKuMxs3+gIfv16cDVByEf7pYPb6kOEH8yWfvX5FIGgdPhv1pmgSH0iZ03cvb3n688k9cv rWPvzraIMYH15lczQooLZcd3aKRU1nw6BNAWKgx+li1u791BCWf1FhYZQQpq2HtsjMKr6tWE67C H4x0bqiXHmjuztgYI4zxl0IW6b9TJhD0tdjhA== X-Google-Smtp-Source: ABdhPJyDgQ09YlE1f6viJb/hqO3bUNjGpoknO/LDhG1lMo1Oe8ITSnpFzeaxedd8FEHhqR/HGrTgFg== X-Received: by 2002:a50:9310:: with SMTP id m16mr3188586eda.94.1611320814531; Fri, 22 Jan 2021 05:06:54 -0800 (PST) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id k21sm5310516edq.60.2021.01.22.05.06.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 05:06:53 -0800 (PST) Subject: Re: PoC/WIP: Extended statistics on expressions To: Dean Rasheed , Justin Pryzby Cc: PostgreSQL Hackers References: <20210116232208.GB8560@telsasoft.com> <2f2a3b3b-93e4-723f-144e-bc21f10d6b61@enterprisedb.com> <20210118045331.GF8560@telsasoft.com> <3f20da4d-89dc-0912-98d2-b6f0ef06c87f@enterprisedb.com> <20210122022958.GC27167@telsasoft.com> <20210122040101.GF27167@telsasoft.com> <20210122044606.GG27167@telsasoft.com> From: Tomas Vondra Message-ID: <901b9cf3-78f3-9cc4-94a6-8ab4dfa5f34b@enterprisedb.com> Date: Fri, 22 Jan 2021 14:06:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/22/21 10:00 AM, Dean Rasheed wrote: > On Fri, 22 Jan 2021 at 04:46, Justin Pryzby wrote: >> >> I think you'll maybe have to do something better - this seems a bit too weird: >> >> | postgres=# CREATE STATISTICS s2 ON (i+1) ,i FROM t; >> | postgres=# \d t >> | ... >> | "public"."s2" (ndistinct, dependencies, mcv) ON i FROM t >> > > I guess that's not surprising, given that old psql knows nothing about > expressions in stats. > > In general, I think connecting old versions of psql to newer servers > is not supported. You're lucky if \d works at all. So it shouldn't be > this patch's responsibility to make that output nicer. > Yeah. It's not clear to me what exactly could we do with this, without "backpatching" the old psql or making the ruleutils.c consider version of the psql. Neither of these seems possible/acceptable. I'm sure this is not the only place showing "incomplete" information in old psql on new server. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company