Re: Invisible Indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Invisible Indexes
Date: 2018-06-18 22:15:32
Message-ID: 30749.1529360132@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2018-06-18 18:05:11 -0400, Tom Lane wrote:
>> Well, what I was thinking about was that this functionality already
>> exists (I think) in one or more "index advisor" plugins.

> They're doing the opposite, right? I.e. they return "hypothetical
> indexes", which then can be used by the planner. None of the ones I've
> seen currently mask out an existing index.

I had the idea that some of them could also hide existing indexes.
It's been awhile, so maybe my memory is faulty, but the hook we
provide is capable of that:

/*
* Allow a plugin to editorialize on the info we obtained from the
* catalogs. Actions might include altering the assumed relation size,
* removing an index, or adding a hypothetical index to the indexlist.
*/
if (get_relation_info_hook)
(*get_relation_info_hook) (root, relationObjectId, inhparent, rel);

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-06-18 22:16:38 Re: Invisible Indexes
Previous Message Julien Rouhaud 2018-06-18 22:12:29 Re: Invisible Indexes