Re: missing indexes in indexlist with partitioned tables

From: Arne Roland <A(dot)Roland(at)index(dot)de>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: missing indexes in indexlist with partitioned tables
Date: 2022-01-24 12:29:58
Message-ID: 937a0d27a72b4326a841f8a33a136ef5@index.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

> From: Zhihong Yu <zyu(at)yugabyte(dot)com>
> Subject: Re: missing indexes in indexlist with partitioned tables
>
> Hi,
>
> - if (indexRelation->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
> + if (inhparent && (!index->indisunique || indexRelation->rd_rel->relkind != RELKIND_PARTITIONED_INDEX))
>
> The check on RELKIND_PARTITIONED_INDEX seems to negate what the comment above says:
>
> + * Don't add partitioned indexes to the indexlist
>
> Cheers

The comment at my end goes on:

/*
* Don't add partitioned indexes to the indexlist, since they are
* not usable by the executor. If they are unique add them to the
* partindexlist instead, to use for further pruning. If they
* aren't that either, simply skip them.
*/

Regarding the structure: I think, that we probably should remove the first two sentences here. They reoccur 50 lines below anyways, which seems a dubious practice. The logic that enforces the first two sentences is mainly down below, so that place is probably on one to keep.

Regarding the semantics: This is sort of what the statement checks for (skip for inhparent, if not unique or not partitioned index), i.e. it checks for the case, where the index shouldn't be added to either list.

Side note: I personally think the name inhparent is mildly confusing, since it's not really about inheritance. I don't have a significantly better idea though.

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Sent: Wednesday, January 19, 2022 23:26
> Ah, apologies, I didn't realize that that test was so new.

No offense taken. Unless one was involved in the creation of the corresponding patch, it's unreasonable to know that. I like the second part of your message very much:

> See src/tools/ci/README (for multi-platform testing of patches on
> several platforms) and http://commitfest.cputube.org/

Thanks, I didn't know of cputube. Neat! That's pretty much what I was looking for!
Is there a way to get an email notification if some machine fails (turns bright red)? For the threads I'm explicitly subscribed to, that would seem helpful to me.

Regards
Arne

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2022-01-24 12:38:54 Re: Add 64-bit XIDs into PostgreSQL 15
Previous Message Amit Kapila 2022-01-24 12:05:50 Re: [BUG]Update Toast data failure in logical replication