pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: nicolas paris <nicolas.paris@riseup.net>
To: pgsql-performance@lists.postgresql.org
Subject: Re: Merge David and Goliath tables efficiently
Date: Mon, 19 Jun 2023 14:20:26 +0200
Message-ID: <dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net> (raw)
In-Reply-To: <27cdb9c5-6dc7-87ff-303e-b0d0d20edbc4@enterprisedb.com>
References: <20230619074646.2zlxxaqjieiafgqi@alvherre.pgsql>
	<27cdb9c5-6dc7-87ff-303e-b0d0d20edbc4@enterprisedb.com>

> IMHO the thing that breaks it is the ORDER BY in the merge, which
> likely
> acts as an optimization fence and prevents all sorts of smart things
> including the partitionwise join. I'd bet that if Nicolas replaces
> 
>   MERGE INTO "goliath" ca
>   USING (SELECT * FROM "david" ORDER BY "list_id") AS t
>   .

Sorry if it was not clear, however there is no order by in the 2.1
strategy. Then this cannot be the reason of not triggering the optim.

For information I do enable partition join feature with jdbc call just
before the merge:
set enable_partitionwise_join=true





view thread (15+ messages)  latest in thread

Message-ID: <dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net>
Permalink:  ../dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net/
Also on:    postgresql.org/message-id/dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: nicolas.paris@riseup.net, pgsql-performance@lists.postgresql.org
  Subject: Re: Merge David and Goliath tables efficiently
  In-Reply-To: <dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox