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 1lrey3-0004T7-NV for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 11:04:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrey1-0000UT-2q for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 11:04:49 +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 1lrey0-0000UK-0v for pgsql-hackers@lists.postgresql.org; Fri, 11 Jun 2021 11:04:48 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lrext-0000Jr-0o for pgsql-hackers@postgresql.org; Fri, 11 Jun 2021 11:04:46 +0000 Received: by mail-wr1-x42e.google.com with SMTP id l2so5621873wrw.6 for ; Fri, 11 Jun 2021 04:04:40 -0700 (PDT) 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=29jXMQVC9mYszhHyPRQHSG5njzxZyqYjGNEsYrQGkF0=; b=xxnrCe72QZf8zJozh25V3njXRZQB7cLudMWl6g3QjYKjfByIPn4ZasQR7PUGtYaAdJ Jqc/cH4khY1cZ36syI+HNyKAqUOeaF90T19I5H2UuFlCDIcCx/6+TJLzdqq4iYck1LaR PynRfD9Wsailan+yb0ODbV8lNJXjs+yMA7rkMMcUswYfm1OdV9NGNBk2CX/YVYYXzx2t qgnsc6scq0b9VyoxSfTbBZ0nvcXweUrC6kyitF6iVIbIgKlK4o5eUNLTcu72hNcY20lz Jo5gBsJjWSWu2alwdRFtlIH1tSN7ARrllExQ4SVhCBViQ8P8n7lwkksDi9C4qEqRm2iW ROWg== 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=29jXMQVC9mYszhHyPRQHSG5njzxZyqYjGNEsYrQGkF0=; b=D0HDQLCDGs42WyrNn7ZKTsoKgjrXumZTTyW+1c6LjZzLN85ZPCGEwwJSfOykH+Y+LS EVVxJNXp9uCVRu1yR0zXEW45YBF5Bbd+2FPyVgmQEOboJNsyQ0AXglsXVnnqdKoCprYc 0pnGsg4e3e5R6WB5uQurZdILey6ePxpuUAtVPGrvenRBmLIfsR7Csh+tss+EBhFW9Iwu RmZ4tfRUHhW0aIYFVfJtxOS8B2P80hMEEkFhxtRZSD8B6jTPnpcNsaZVB7vjirr41J0+ zERNsDXqfmrPDJVdMWBsOVYnYh50S51/p1yVPtTNNi+LINK8487nK+h9QRUC+I5V0Scf XV8A== X-Gm-Message-State: AOAM531k/jKD6LgXE2RFrf2rPPcEWgWoEdBonJrUiqDOmazABEttte8q 2roYBsNsKm3lVch0mwHpvCLTnp4v8Uy04OdjmBuurkDI0IgBhZeLJbxhqDU/t4T8MPN5vwCUnMQ nVpI/vMlr1AwHGfm9+z66dSQqmganqONrbAbEDb8ACWQBWtXvDhLV3HHlPO5PfEKdaG4RA1oTwr WCBcuHJWAH5q7ARoTyBc9qVNCOEHTgj4G1OU9bAwNLE+R9hurNoxlbklvN6R5Ku7InjnpWJ0P91 Jp+OQ3W4tI9vkZc5M6l2b+4b1X1s/S8qNvX5CFI X-Google-Smtp-Source: ABdhPJyByMyRglqxUApJudz8SpgKFqimB2xVoUvEk6OgjFIQB0XUeqdQdF3y28fWfFlclcOu83gd9A== X-Received: by 2002:adf:fb8c:: with SMTP id a12mr3472433wrr.406.1623409478998; Fri, 11 Jun 2021 04:04:38 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-254-183.net.upcbroadband.cz. [86.49.254.183]) by smtp.gmail.com with ESMTPSA id i2sm5524639wmo.40.2021.06.11.04.04.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Jun 2021 04:04:38 -0700 (PDT) Subject: Re: PoC/WIP: Extended statistics on expressions To: Noah Misch Cc: Dean Rasheed , Justin Pryzby , PostgreSQL Hackers 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> <20210611045546.GA573364@rfd.leadboat.com> From: Tomas Vondra Message-ID: Date: Fri, 11 Jun 2021 13:04:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210611045546.GA573364@rfd.leadboat.com> 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: Archived-At: Precedence: bulk On 6/11/21 6:55 AM, Noah Misch wrote: > 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. > OK, makes sense. Thanks! -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company