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 1hue95-0006SG-5n for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 14:39:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hue93-0008BT-Vx for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 14:39:29 +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 1hue93-0008BH-No for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 14:39:29 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hue90-0006he-GX for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 14:39:29 +0000 Received: by mail-qk1-x742.google.com with SMTP id 201so60200248qkm.9 for ; Mon, 05 Aug 2019 07:39:26 -0700 (PDT) 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=smRm/0H2VYYIXe2n8Qzsf532Q0FARjZ0KsJwh0UaeKk=; b=LFAEZRNFfCceBcHvBkTG3Mbvd48TQpimsiNVM9sIhOhg92PqKFy0tB91/iN8e8Rr7/ MoXwMKIGzoIbz8AFazxan233eT+R5gKlfUxaubJ7pEpk9ahFo/7XBr5dRLGKFAr2vIwj ZeY3fXRcFSnIc0jOpORIr74FqiipefwptaUBWfd918uEn6XDXTXpExoy+8Aj0Jb8JB/N s26gh7XtcYXTrI6lGv3b6nFQ9pNsyLSBB7d1TUdkKYi7bzzUQUS4x1X8BUnHrsL3giZO 7tnkqx18Kp3aqT+kIr9UjTB3DrtkVO9gvGJx0pJst/j7vpOEGOMz98ofGphgYPKru8k8 DT8g== 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=smRm/0H2VYYIXe2n8Qzsf532Q0FARjZ0KsJwh0UaeKk=; b=PI/Bpc+m7zWYDeZ2Z+NkCXsWz43m2YGsTtAYRXJ/6yZIYYK+n6hh92Wla99+EVhVD4 ZG8lS5fhDM+G3LM7p6FNfzscS4x0XknzbTRopl6tIHkwmFfdP+FIXzyD/1KwAV054/y8 TnM1tDv9JZlxHcPqRx+NJ03VdgRrRAZ/8hAfsT8lvMvDHmYzgGSSWD0eDwFx4t1GZTpu NRSe3h1I8dwa2UbmG5RpespR/bLnTtHUb12Jhv/PBx20+6e6w8PK/v2suiC8k8ejDm4Z 04JlyitfJvRsTESJtvrIBeK+oQYrquBKhf5gt67K7WzLA0fwO1yLf8G9pfMIZoSd/hTU 7KXA== X-Gm-Message-State: APjAAAXga9gWyuwLf5T/ETKmfr+bDv+FN6WnkZ7wRk8OxCFsWpEmFDXS TjzNVYgLUrIHowSohGbSEMUYFA== X-Google-Smtp-Source: APXvYqwtJ7Xg1WRlNEhOh/sXAVBoyC9z69kqk+N2Z1joDyuDnOLOmOdbG1T0m3vCTYI4c+jPb2A1xw== X-Received: by 2002:a05:620a:1006:: with SMTP id z6mr68602506qkj.312.1565015963481; Mon, 05 Aug 2019 07:39:23 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.81.5]) by smtp.gmail.com with ESMTPSA id p23sm36881592qke.44.2019.08.05.07.39.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 07:39:22 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id A4E5B123A8B; Mon, 5 Aug 2019 10:39:20 -0400 (-04) Date: Mon, 5 Aug 2019 10:39:20 -0400 From: Alvaro Herrera To: yuzuko Cc: shawn wang , Shawn Wang , PostgreSQL Hackers Subject: Re: Problem with default partition pruning Message-ID: <20190805143920.GA6232@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Aug-05, yuzuko wrote: > So I proposed moving the if() block to the current place. > The latest patch can solve both queries but I found the latter > problem can be solved by setting constraint_exclusion = on. So we have three locations for that test; one is where it currently is, which handles a small subset of the cases. The other is where Amit first proposed putting it, which handles some additional cases; and the third one is where your latest patch puts it, which seems to handle all cases. Isn't that what Amit is saying? If that's correct (and that's what I want to imply with the comment changes I proposed), then we should just accept that version of the patch. I don't think that we care about what happens with constraint_exclusion is on. That's not the recommended value for that setting anyway. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services