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 1hTFCI-0005dU-HT for pgsql-advocacy@arkaria.postgresql.org; Wed, 22 May 2019 00:33:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hTFCF-0004Sp-P1 for pgsql-advocacy@arkaria.postgresql.org; Wed, 22 May 2019 00:33:31 +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 1hTFCF-0004Sh-ED for pgsql-advocacy@lists.postgresql.org; Wed, 22 May 2019 00:33:31 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hTFCA-0006Kq-DQ for pgsql-advocacy@lists.postgresql.org; Wed, 22 May 2019 00:33:29 +0000 Received: by mail-io1-xd42.google.com with SMTP id z4so470195iol.0 for ; Tue, 21 May 2019 17:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LbLeJaJaAZRN+Nw+5p6RnWdQ8gUfs8gqs5gx8LyKi9w=; b=EN/DSunOdb1Iey8YjlVo+s3rlgkNB1kW28rn83t2U4GWqXvQriWIfS+HCaEb7lVVuf ScqSJaej0lx97T0XBMkQQgsHo2l5HCUKd+2UzlkCyTbz2Ikey34rjMWCgTL+HiSMRHvi FAoK5yLVbpUEiHXKTUdBvIADd+sycQOpGTCvmj7jr/SAlQa2pRiqd/luVitT3+hNGVX7 fL+G+cUUv2fEiT0uAuXjlJtoGBSf6fu2pL7zfazNSSo5wubIU0OToBx2Ypg08gVBZkue uiq7lJgiIZVw7z5QuT7uVA5OCjE0mV81m3QIez9UCe+ktpEfpbCWF8BXO2Q9wA7I/j7G KyDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LbLeJaJaAZRN+Nw+5p6RnWdQ8gUfs8gqs5gx8LyKi9w=; b=CqV3iD/Sp6PyTn5m9NVQPWDbbhULyY6kgm1EaQq/IZRJ6RlIE4o42GEpF1zX49qVPS oy8MKTSwn+1M4nTj/5Xmer9zUp+LZ6L7wOR0ApFL+yA84HeeGGdywCqBTPzCa/dmvDhU 5Dctd2hFX8Rb+gFnZr6nY802wL3xSl2/s26ajJuy+gfAwKxqArxthwej65dm3B8Aaqrv Q0pVWrLTeAqVm/TRzZI44/PZFTHvoa4ZS4jfK+xrHlG2tLE18dHnEarVqyq5fBIYg0X0 Aad8somj4mb3I3bKimhotXzIQ9qpupf7z5m0MUfEh4kX1lBQpTvTXvsoiGJ9deHWqGfX 3xMw== X-Gm-Message-State: APjAAAUuj5Bdsio/dXE2gStE7/Yt8HiIJ+EqdCeVumgjrPApvAiQmeuq qYZLp9/SV00rv8ZirYw/CxVqEOnp3L13f5UPJ1VvmQ== X-Google-Smtp-Source: APXvYqzmPHrthRZalk6cMPtrlt7B5lpoubMCv4d6my142o5qJalyGamuA2HhH3F2xit70AXjfkDWtiwVD3CdyyQvEWs= X-Received: by 2002:a5e:840c:: with SMTP id h12mr6252614ioj.81.1558485205447; Tue, 21 May 2019 17:33:25 -0700 (PDT) MIME-Version: 1.0 References: <20190516182628.kbkiajfnlooocgyg@momjian.us> <0cf10a27-c6a0-de4a-cd20-ab7493ea7422@lab.ntt.co.jp> <20190517153653.pmolnulev6imwsn3@momjian.us> <20190518023017.nkucoc5xgoebtvfw@momjian.us> <20190518132031.zjyxgvys7unan53f@momjian.us> <20190521145509.s6bme6pgww3glmku@momjian.us> In-Reply-To: <20190521145509.s6bme6pgww3glmku@momjian.us> From: David Rowley Date: Wed, 22 May 2019 12:33:10 +1200 Message-ID: Subject: Re: PostgreSQL 12: Feature Highlights To: Bruce Momjian Cc: Amit Langote , "Jonathan S. Katz" , pgsql-advocacy@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 22 May 2019 at 02:55, Bruce Momjian wrote: > > On Sun, May 19, 2019 at 02:26:48AM +1200, David Rowley wrote: > > On Sun, 19 May 2019 at 01:20, Bruce Momjian wrote: > > > The first one needs to reference visible effects, so I would add: > > > > > > Consider additional optimizations for queries referencing > > > partitioned tables that only affect a single partition > > > > > > Does that work? > > > > Thanks, typing that up. I think it lacks a bit detail about what's > > actually changed. The change is fairly evident and people can see > > when it takes effect when they look at EXPLAIN and see that the > > Append/MergeAppend node is missing. Also, an Append/MergeAppend may > > exist for inheritance tables and an Append can exist for a simple > > UNION ALL. Both of those cases can have subplans removed to leave only > > a single subplan, to which the additional parallel paths will be > > considered. > > This brings up a few points. First, it seems the change affects > partitioned tables and UNION ALL, which means it probably needs to be > listed in two sections. Second, is it only parallelism paths that are > added? I am not sure if people care about a node being removed, > especially when the might not even know we do that step, but they do > care if there are new optimization possibilities. Like Amit, I think the optimizer section is fine. Another thing that is affected is that you may no longer get a Materialize node in the plan. Previously you might have gotten something like Merge Join -> Materialize -> Append -> Seq Scan, now you might just get Merge Join -> Seq Scan. This is because Append / MergeAppend don't support mark and restore. Removing them would allow the materialize node to be skipped in cases where the single subpath of the Append does support mark and restore. > > I think something like: > > > > * Make the optimizer only include an Append/MergeAppend node when > > there is more than one subplan to append. > > > > This reduces execution overheads and allows additional plan shapes > > that were previously not possible. > > > > or a little more brief: > > > > * Allow the optimizer to consider more plan types by eliminating > > single subplan Append and MergeAppends. > > > > I understand that you might be trying to avoid details of plan node > > types, but really anyone who's got inheritance or partitioned tables > > and has looked at an EXPLAIN should have an idea. > > I would like to have something that people who don't study EXPLAIN will > still be excited about. hmm. I guess it's a pretty hard balance between writing something where there's so little detail that nobody really knows what it means vs adding some detail that some people might not understand. > > Also, I think Tom should be the main author of this as he rewrote my > > version of the patch to such an extent that there was next to nothing > > of it left. I just tagged a few extra things on before he committed > > it. > > Uh, Tom listed you as author, but I don't have to follow that if you > feel it is inaccurate. I'd say he was being very generous. I'm happy to come 2nd on this one. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services