Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning
Date: 2023-08-08 10:38:30
Message-ID: CAMbWs4_bMFXUE=RQ17b32a2MCyaPCZk-++c7X_uXwPhBXb=fMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 27, 2023 at 10:06 PM Ashutosh Bapat <
ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:

> 0002 - WIP patch to avoid repeated translations of RestrictInfo.
> The WIP patch avoids repeated translations by tracking the child for
> which a RestrictInfo is translated and reusing the same translation
> every time it is requested. In order to track the translations,
> RestrictInfo gets two new members.
> 1. parent_rinfo - In a child's RestrictInfo this points to the
> RestrictInfo applicable to the topmost parent in partition hierarchy.
> This is NULL in the topmost parent's RestrictInfo
> 2. child_rinfos - In a parent's RestrictInfo, this is a list that
> contains all the translated child RestrictInfos. In child
> RestrictInfos this is NULL.

I haven't looked into the details but with 0002 patch I came across a
crash while planning the query below.

regression=# set enable_partitionwise_join to on;
SET
regression=# EXPLAIN (COSTS OFF)
SELECT * FROM prt1 t1, prt2 t2
WHERE t1.a = t2.b AND t1.a < 450 AND t2.b > 250 AND t1.b = 0;
server closed the connection unexpectedly

Thanks
Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2023-08-08 10:43:06 Suppress generating WAL records during the upgrade
Previous Message Christoph Heiss 2023-08-08 10:21:08 Re: [PATCH] psql: Add tab-complete for optional view parameters