pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: Arne Roland <A.Roland@index.de>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Subject: Re: missing indexes in indexlist with partitioned tables
Date: Sat, 17 Sep 2022 15:00:01 -0400
Message-ID: <32925.1663441201@sss.pgh.pa.us> (raw)
In-Reply-To: <20220917183701.dxooicewyk6yy5vd@alvherre.pgsql>
References: <20220917183701.dxooicewyk6yy5vd@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Sep-16, David Rowley wrote:
>> I kinda disagree with Alvaro's fix in 05fb5d661. I think indexlist is
>> the place to store these details.  That commit added the following
>> comment:
>> 
>> /*
>> * Ignore partitioned indexes, since they are not usable for
>> * queries.
>> */
>> 
>> But neither are hypothetical indexes either, yet they're added to
>> RelOptInfo.indexlist.
>> 
>> I think the patch should be changed so that the existing list is used
>> and we find another fix for the problems Alvaro fixed in 05fb5d661.
>> Unfortunately, there was no discussion marked on that commit message,
>> so it's not quite clear what the problem was. I'm unsure if there was
>> anything other than CLUSTER that was broken.

> After a bit of trawling through the archives, I found it here:
> https://www.postgresql.org/message-id/20180124162006.pmapfiznhgngwtjf%40alvherre.pgsql
> I think there was insufficient discussion and you're probably right that
> it wasn't the best fix.  I don't object to finding another fix.

FWIW, I don't see any big problem with what you did.  We'd need to
do something more like what David suggests if the planner ever has
a reason to consider partitioned indexes.  But as long as it does
not, why expend the time to build data structures representing them?
And we'd have to add code in quite a few places to ignore them,
once they're in indexlist.

			regards, tom lane





view thread (31+ messages)  latest in thread

Message-ID: <32925.1663441201@sss.pgh.pa.us>
Permalink:  ../32925.1663441201@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/32925.1663441201@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, dgrowleyml@gmail.com, A.Roland@index.de, amitlangote09@gmail.com, zyu@yugabyte.com, rjuju123@gmail.com
  Subject: Re: missing indexes in indexlist with partitioned tables
  In-Reply-To: <32925.1663441201@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox