Re: Merge David and Goliath tables efficiently

From: nicolas paris <nicolas(dot)paris(at)riseup(dot)net>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Merge David and Goliath tables efficiently
Date: 2023-06-19 12:20:26
Message-ID: dc4115489cd1bbddab1fea3cf0eeb8bdd06657e7.camel@riseup.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2023-06-19 13:13:39 Re: Merge David and Goliath tables efficiently
Previous Message nicolas paris 2023-06-19 12:09:37 Re: Merge David and Goliath tables efficiently