Re: how to get top plan of GatherMerge in OSS10 - Mailing list pgsql-general

From David Rowley
Subject Re: how to get top plan of GatherMerge in OSS10
Date
Msg-id CAApHDvqK4=piMm4Gc9OGGxqq1MM9DVTPyEXPy4=OsJfDbD1rnQ@mail.gmail.com
Whole thread Raw
In response to how to get top plan of GatherMerge in OSS10  ("Yang, Rong" <yangr.fnst@cn.fujitsu.com>)
List pgsql-general
On Fri, 4 Sep 2020 at 20:21, Yang, Rong <yangr.fnst@cn.fujitsu.com> wrote:
> in OSS 10, how  to make the top plan of the plan tree to GatherMerge with ‘except all’ in sql?

(I guess you're talking about PostgreSQL 10. I'm not sure what OSS 10 is.)

The ability for Gather Merge to work with Init Plan values was only
added in [1], which was new to PostgreSQL 11. So you're not going to
make that work in PostgreSQL 10.

You could try crafting the query in such a way that an Init plan is
not used. e.g a CROSS JOIN, but not sure if that'll improve your
performance any. So you could try reducing the parallel_tuple_cost a
bit, which might give you a Gather, so at least the Seq Scan will be
done in parallel. The sort will still be serial though.

A btree index on table1 (c) looks like it might be worth considering.

David

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e89a71fb44



pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Aw: Implement a new data type
Next
From: Klaudie Willis
Date:
Subject: Bitmap scan seem like such a strange choice when "limit 1"