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 1gUoXQ-0001T4-Kl for pgsql-performance@arkaria.postgresql.org; Thu, 06 Dec 2018 07:57:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUoXP-0006Mj-BC for pgsql-performance@arkaria.postgresql.org; Thu, 06 Dec 2018 07:57:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUoXP-0006Ma-0k for pgsql-performance@lists.postgresql.org; Thu, 06 Dec 2018 07:57:35 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUoXJ-0003y0-QB for pgsql-performance@lists.postgresql.org; Thu, 06 Dec 2018 07:57:33 +0000 Received: by mail-qt1-x841.google.com with SMTP id t13so25361517qtn.3 for ; Wed, 05 Dec 2018 23:57:29 -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=gQ72Ng1m5XQ7Yz3BM6ixA9KjuDn4UoAL3vAFeAcX+5w=; b=w/OTNcteJjAVL4hOYmFnF7oQsccRvoZ9SXd137EaDMzdBMxHm7WBoAaVLJhtGfBz4U 9omKJD7YyVfBf+UC1majjxnRndYZn9PTU3GTGGpGvNtpbO+pkUGELiNrZAnzkKNafnWx +8Qp0LPW75dipCktjLyRVPMp/p2UDgmA8PjMxTWjOMWcRXEhZd/rooMyuzKyLFcwJI+b T9QewzI68oO2OhBbJOsZ76D5RxlGu9y7aHfEUTlOPrs1dLeu3jFhLPO5xFnBUVyqHUNy UhmsCjFnbsa7tYR+BcJNfk8XsWp/xXrgsbotnbzo9WboPEug+oZAQ3rFMVIGekKLpaiI uZRQ== 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=gQ72Ng1m5XQ7Yz3BM6ixA9KjuDn4UoAL3vAFeAcX+5w=; b=qexcBiq/7K9yRyfvO/E6KBtKEN771yg988uZDMCgZZNw6+NWM03ZDTTpSQHgdEYAhR x18en4k/eVpqC5Qae3vhMGtqlJKT/kbWcJKWJeUknNBgUAvXbCGnJKU8zb7E8JzJceqD 8KvjWuK8MhBSs1RugoOjC/quu/KPw8KM4Tt8xmw1lg1jynkZFzHS5ZQr9ZPjWQCoaJAg Y+o5ykk1BE7TBQrHuVaGQFZgsTPmAAOTbL3t3pM5lXuYy5QyD84a/VurHrnIOKbm5KcU AX19J9frGJAnCiSLDbNRIMfSApggaNZhfmGzARvK8VgxgXRjsrzEhtWOA5mny2fZyVPp FXgg== X-Gm-Message-State: AA+aEWaJEqzH43jXshtMVGErjDzYSWeTIM4ZdmuM4ZKHgs26PL7SckHM jCICzeAkwmlxIOVuyMOrwGRZMA== X-Google-Smtp-Source: AFSGD/USwq8tWfiEiLxcMoX7Wi7UUMrFaVYkzh0AXjcF1XSyGmvmW1R4rKmvBNaAY7nMVFitwHao2A== X-Received: by 2002:ac8:12cc:: with SMTP id b12mr26020531qtj.90.1544083049123; Wed, 05 Dec 2018 23:57:29 -0800 (PST) Received: from alvin.alvh.no-ip.org ([201.186.80.75]) by smtp.gmail.com with ESMTPSA id o48sm14758920qtb.87.2018.12.05.23.57.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 23:57:28 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 7740E5C5; Thu, 6 Dec 2018 04:57:26 -0300 (-03) Date: Thu, 6 Dec 2018 04:57:26 -0300 From: Alvaro Herrera To: Amit Langote Cc: Justin Pryzby , Sanyo Moura , jeff.janes@gmail.com, David Rowley , Robert Haas , Ashutosh Bapat , pgsql-performance@lists.postgresql.org, Pg Hackers Subject: Re: Query with high planning time at version 11.1 compared versions 10.5 and 11.0 Message-ID: <20181206075726.pig32e6thltb56hr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8db4eca8-6e76-70ff-f934-e0228a1cc298@lab.ntt.co.jp> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Dec-06, Amit Langote wrote: > The partitionwise join related > changes in PG 11 moved the add_child_rel_equivalences call in > set_append_rel_size such that child EC members would be added even before > checking if the child rel is dummy, but for a reason named in the comment > above the call: > > ... Even if this child is > * deemed dummy, it may fall on nullable side in a child-join, which > * in turn may participate in a MergeAppend, where we will need the > * EquivalenceClass data structures. > > However, I think we can skip adding the dummy child EC members here and > instead make it a responsibility of partitionwise join code in joinrels.c > to add the needed EC members. Attached a patch to show what I mean, which > passes the tests and gives this planning time: Robert, Ashutosh, any comments on this? I'm unfamiliar with the partitionwise join code. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services