Re: missing indexes in indexlist with partitioned tables

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Arne Roland <A(dot)Roland(at)index(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>
Subject: Re: missing indexes in indexlist with partitioned tables
Date: 2022-09-20 07:53:15
Message-ID: CAApHDvqsbgXdHzZUcFfAByMLKDSx-ZOOOCkwf86MVwdDV337Uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for having a look at the patch.

On Tue, 20 Sept 2022 at 18:41, Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> Agreed, though the patch's changes to tests does not seem to have to
> do with join removal? I don't really understand what the test changes
> are all about. I wonder why the patch doesn't instead add the test
> case that Arne showed in the file he attached with [1].
> [1] https://www.postgresql.org/message-id/2641568c18de40e8b1528fc9d4d80127%40index.de

I adjusted a test in partition_join.sql to add an additional column to
the fract_t table. Before the change that table only had a single
column and due to the query's join condition being USING(id), none of
the columns from the left joined table were being used. That resulted
in the updated code performing a left join removal as it was passing
the checks for no columns being used in the left joined table in
analyzejoins.c. The test in partition_join.sql claims to be testing
"partitionwise join with fractional paths", so I thought we'd better
not have a query that the planner removes the join when we're meant to
be testing joins.

It probably wouldn't hurt to have a new test to ensure left join
removals work with a partitioned table. That should go in join.sql
along with the other join removal tests. I didn't study Arne's patch
to see what test he added. I was only interested in writing enough
code so I could check there was no good reason not to add the
partitioned index into RelOptInfo.indexlist. Arne sent me an off-list
message to say he's planning on working on the patch that uses the
existing field instead of the new one he originally added. Let's hold
off for that patch.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2022-09-20 08:00:34 Re: missing indexes in indexlist with partitioned tables
Previous Message Zhang Mingli 2022-09-20 07:37:47 Re: Add 64-bit XIDs into PostgreSQL 15