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 1lrZD4-0001Os-Kx for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 04:55:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrZD1-0001L9-W3 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 04:55:55 +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 1lrZD1-0001L1-Fd for pgsql-hackers@lists.postgresql.org; Fri, 11 Jun 2021 04:55:55 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lrZCx-0005oq-JD for pgsql-hackers@postgresql.org; Fri, 11 Jun 2021 04:55:54 +0000 Received: by mail-pf1-x429.google.com with SMTP id u126so3451073pfu.13 for ; Thu, 10 Jun 2021 21:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xcTN/1XbqhJC1rg70zgZ1PAl7Coo+PjIJRrSFiko1LQ=; b=XQDB2y8t3pJAPL/0El4ZH7CS4xVNa5hFY6fsenG58eSm+ZXR53rnOr39EeMykxIUaY /QlgXZzJ4ASY9PpT7bnEkCcDhg1Za3N4LIGMwRTJJY+zKlKqU2JgLyMf4TNPTYt5NdJF mIXT6fkdHMqa7mfGxL6/h8OfpNPymydaB7XSc= 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=xcTN/1XbqhJC1rg70zgZ1PAl7Coo+PjIJRrSFiko1LQ=; b=qIkYnw1oDL/D1cBuiJoznXq01hFjQyCdupgfmc/c979iE8vxqqx7GkSeXKZpIn6IxN A91YI2VxDFQdzWYS/g/EnwX0kUYbW1AF+8f2gZ3U/rJkZ6LN5vciXVQMawKtszbIAvLQ 7giEHp5mlw3gtDxOdBZm6fFcXD1Pjkn6ifV4Rs8H+urOejTNVB+Y1otTmZ+3PnKus9Tr wEXl2t3z5ymNVx2MIDtzBxxpNnp9R5Db1OOhQt/CoUyw7ro4CBtePP47UugEKzEyuCeh 8EhDv5Qp4GKempJ7IjkvEOZKxL74qNA40l5I6HLJe2glw2xUIPkIxpP2CSMG4DY1TdCj SvHA== X-Gm-Message-State: AOAM531OO0srxbL+4qipZjRvqJACPvC1dGt134r/liIv2B5A5+HHU/97 X62R11iqHPuq9oDXMjw3w3KWEw== X-Google-Smtp-Source: ABdhPJwiWJVd7ZynMclVeHY+YIeonFGjOUOxgWRhR60PT87xZf3QWgUrN3Jo4SXJH5/KFbtV7qs35w== X-Received: by 2002:aa7:8a58:0:b029:2ee:2da3:746d with SMTP id n24-20020aa78a580000b02902ee2da3746dmr6535972pfa.75.1623387350153; Thu, 10 Jun 2021 21:55:50 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id o16sm3718828pjw.10.2021.06.10.21.55.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jun 2021 21:55:49 -0700 (PDT) Date: Thu, 10 Jun 2021 21:55:46 -0700 From: Noah Misch To: Tomas Vondra Cc: Dean Rasheed , Justin Pryzby , PostgreSQL Hackers Subject: Re: PoC/WIP: Extended statistics on expressions Message-ID: <20210611045546.GA573364@rfd.leadboat.com> References: <1ed534fb-b42b-f008-35ee-4eb930b0088f@enterprisedb.com> <2cb8a7cd-664f-8681-6ce9-790a50e3c78f@enterprisedb.com> <096d26e1-f053-a039-047d-a050dbb80ac6@enterprisedb.com> <078de413-8e4e-343e-fac1-eb61fd389925@enterprisedb.com> <20210606053740.GB297923@rfd.leadboat.com> <4c98203c-8364-bb76-b502-d7b323ba55ba@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c98203c-8364-bb76-b502-d7b323ba55ba@enterprisedb.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jun 06, 2021 at 09:13:17PM +0200, Tomas Vondra wrote: > > On 6/6/21 7:37 AM, Noah Misch wrote: > > On Sat, Mar 27, 2021 at 01:17:14AM +0100, Tomas Vondra wrote: > >> OK, pushed after a bit more polishing and testing. > > > > This added a "transformed" field to CreateStatsStmt, but it didn't mention > > that field in src/backend/nodes. Should those functions handle the field? > > > > Yup, that's a mistake - it should do whatever CREATE INDEX is doing. Not > sure if it can result in error/failure or just inefficiency (due to > transforming the expressions repeatedly), but it should do whatever > CREATE INDEX is doing. > > Thanks for noticing! Fixed by d57ecebd12. Great. For future reference, this didn't need a catversion bump. readfuncs.c changes need a catversion bump, since the catalogs might contain input for each read function. Other src/backend/nodes functions don't face that. Also, src/backend/nodes generally process fields in the order that they appear in the struct. The order you used in d57ecebd12 is nicer, being more like IndexStmt, so I'm pushing an order change to the struct.