Re: relhassubclass and partitioned indexes - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: relhassubclass and partitioned indexes
Date
Msg-id 20181019061759.GE2099@paquier.xyz
Whole thread Raw
In response to Re: relhassubclass and partitioned indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: relhassubclass and partitioned indexes  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Fri, Oct 19, 2018 at 01:45:03AM -0400, Tom Lane wrote:
> Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
>> Should relhassubclass be set/reset for partitioned indexes?
>
> Seems like a reasonable idea to me, at least the "set" end of it.
> We don't ever clear relhassubclass for tables, so maybe that's
> not necessary for indexes either.

No objections to the proposal.  Allowing find_inheritance_children to
find index trees for partitioned indexes could be actually useful for
extensions like pg_partman.

>> Michael suggested on the linked thread to get rid of relhassubclass
>> altogether, like we did for relhaspkey recently, but I'm not sure whether
>> it would be a good idea right yet.
>
> We got rid of relhaspkey mostly because it was of no use to the backend.
> That's far from true for relhassubclass.

Partitioned tables are expected to have partitions, so the optimizations
related to relhassubclass don't seem much worth worrying.  However
relations not having inherited tables may take a performance hit.  If
this flag removal would be done, we'd need to be careful about the
performance impact and the cost of extra lookups at pg_inherit.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: relhassubclass and partitioned indexes
Next
From: Michael Paquier
Date:
Subject: Re: partition tree inspection functions