Re: Fix for Index Advisor related hooks

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix for Index Advisor related hooks
Date: 2011-02-15 13:56:06
Message-ID: AANLkTi=QXqM6a8TQYztP4mdRthq6x7kD67_yYFMpqnTS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas <
heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:

> On 11.02.2011 22:44, Gurjeet Singh wrote:
>
>> Looks like the function get_actual_variable_range() was written with the
>> knowledge that virtual/hypothetical indexes may exist, but the assumption
>> seems wrong.
>>
>> One one hand get_actual_variable_range() expects that virtual indexes do
>> not
>> have an OID assigned, on the other hand explain_get_index_name_hook() is
>> handed just an index's OID to get its name back; IMHO these are based on
>> two
>> conflicting assumptions about whether a virtual index will have an OID
>> assigned.
>>
>> Attached patch fix_get_actual_variable_range.patch tries to fix this by
>> introducing a new hook that can help Postgres decide if an index is
>> fictitious or not.
>>
>
> The new hook takes an index oid as argument, so I gather that you resolved
> the contradiction by deciding that fictitious indexes have OIDs. How do you
> assign those OIDs? Do fictitious indexes have entries in pg_index?<http://www.enterprisedb.com>

No, a fictitious index does not touch pg_index. The Index Advisor uses
GetNewOid(pg_class) to generate a new OID for the fictitious index.

An OID is the only way we can identify one fictitious index from the list of
all the others fictitious ones when explain_get_index_name_hook() is called.
I don't see any other way the Postgres server can ask the for the details of
a fictitious index.

Regards,
--
gurjeet.singh
@ EnterpriseDB - The Enterprise Postgres Company
http://www.EnterpriseDB.com

singh(dot)gurjeet(at){ gmail | yahoo }.com
Twitter/Skype: singh_gurjeet

Mail sent from my BlackLaptop device

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-02-15 14:25:39 Re: pg_upgrade seems a tad broken
Previous Message Stephen Frost 2011-02-15 13:51:31 Re: Add support for logging the current role