Re: Invisible Indexes - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Invisible Indexes
Date
Msg-id 5dbe1d66-b6d8-2150-15c8-09fb25e64616@2ndQuadrant.com
Whole thread Raw
In response to Re: Invisible Indexes  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Responses Re: Invisible Indexes
List pgsql-hackers

On 06/18/2018 05:46 PM, Jaime Casanova wrote:
> On 18 June 2018 at 16:36, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote:
>> This is a MySQL feature, where an index is not considered by the planner.
>> Implementing it should be fairly straightforward, adding a new boolean to
>> pg_index, and options to CREATE INDEX and ALTER INDEX. I guess VISIBLE would
>> become a new unreserved keyword.
>>
>> The most obvious use case is to see what the planner does when the index is
>> not visible, for example which other index(es) it might use. There are
>> probably other cases where we might want an index to enforce a constraint
>> but not to be used in query planning.
>>
>> So, do we want this feature? If we do I'll go ahead and prepare a patch.
>>
> should pg_index.indisvalid works for this? in that case you only need
> the syntax for it...
>


I thought about that. But I think these are more or less orthogonal.  I 
doubt it will involve lots of extra code, though.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Transform for pl/perl
Next
From: Andrew Dunstan
Date:
Subject: Re: Invisible Indexes