Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO4F-0001gD-8r for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 14:20:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1grO4C-0007aE-V9 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Feb 2019 14:20:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO0J-00080B-Mc for pgsql-hackers@lists.postgresql.org; Wed, 06 Feb 2019 14:16:43 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grO0H-0000pM-4g for pgsql-hackers@lists.postgresql.org; Wed, 06 Feb 2019 14:16:43 +0000 Received: by mail-qt1-x843.google.com with SMTP id b15so7925897qto.8 for ; Wed, 06 Feb 2019 06:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=bHMXHCop/tH04QBn4nsAGhgKVeIqwWteAYoHU0qpeTk=; b=jRm5zj2m0JlTTaWNJct3RUjM+vYwpK3ZokTq8d0c1JbBghnBFTwaMN98Z3O4woPZM5 kFWiDIdT6cdfJVJtnyqJjHweZTH6c5SKaK8UZOZrC1Ev6esh7gXTdkXIb10gHH0+wo22 HHfRWQNcpO1ucuRJezhzvvTBbX6cFfSP6cQ8557lA4z8g5wYWbfj9u6FvCS8hf8bca0O WGgldX5CvlAH37Hd7zjla5Dz/nKKTBzZFe41OMXZENTSU/jFfCPiAQ5dvHAqlUIeKXQw SG6XnHqH25F/98z86f6DbV8oirnrHzCvftBUOQ+DaXiPjXu0WxFvRCay7GOKV5sqfSwA 7ORQ== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=bHMXHCop/tH04QBn4nsAGhgKVeIqwWteAYoHU0qpeTk=; b=aEtqDEEE31FArpLrIsv0C6Z2WuakkxNuTxRlkGaRNbprUC5GDhbRXp2Qng6Op+N4CC Pptc7pKaF/l3RrPfnFe/tjuG2LuL+iV4mrqWU/meco4PZdr1NTj2pA1SCNxuITpA6/hs DYCQX7gRr/ksHxVHq6OM8bPGJWsD1F1tR9FZeE3r+QwXy2qAcFygpI4psR/gg6Yt0x0F MPvjZKKGBgZ0Nlpl6by+N8iw7R3P0/SDUZMuZ/hxM7z015I2kZnxKbyLvFJzciV0xgf/ Cbq2bUB8QTvHuWk1JR6Jh1+i+p4MKxjAaKATBrLiD3bATD7PYBEozk6yQrx8gRdc91G4 hDRw== X-Gm-Message-State: AHQUAuaHWC7Imi6IVv5ocmjPcpGhv7Ryb/koALvQntzvE8115iZ9ZI2i 3Ywwpt/G61JdtRBOVKeZ8B0WEw== X-Google-Smtp-Source: AHgI3IbdmJoLfrmHHJiajw8q1/kM3oVd1JSo6A15z4+XrDW7/+sxosDAF1Wze808me+PL61HiYGLRg== X-Received: by 2002:aed:31a3:: with SMTP id 32mr7946805qth.234.1549462599900; Wed, 06 Feb 2019 06:16:39 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([191.125.99.212]) by smtp.gmail.com with ESMTPSA id g3sm1946004qkm.44.2019.02.06.06.16.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 06:16:39 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 75110124201; Tue, 5 Feb 2019 22:35:12 -0300 (-03) Date: Tue, 5 Feb 2019 22:35:12 -0300 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: Refactoring IndexPath representation of index conditions Message-ID: <20190206013512.GA3101@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20226.1549140521@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Feb-02, Tom Lane wrote: > In any case I think it makes things simpler and clearer, which is > worth a good deal. Looking at the patch, I agree -- this is clearer than what was there before. > Another idea that I looked into is to not create RestrictInfos for > derived indexqual clauses, with the hope that that would further > reduce the added overhead for the commuted-clause case. However > that crashed and burned when I found out that the extended-stats > machinery punts when given a bare clause rather than a RestrictInfo. > It could possibly be fixed to not do that, but it looks like the > consequences would be extra lookups that'd probably cost more than > we saved by omitting the RestrictInfo. Also, having RestrictInfos > means that we can cache selectivity estimates across multiple > calls. I'm not entirely sure how much that matters in this > context, but it's probably not negligible. Is it reasonable to give ext-stats the option to receive either a "plain" clause or a RestrictInfo, and if the former have it construct the RestrictInfo and return it? It seems a pity to waste effort to cater for ext-stats, only to be used in the rare case where any ext-stats actually exist ... most of the time, it'd be wasted effort. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services