Fix for Index Advisor related hooks - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Fix for Index Advisor related hooks
Date
Msg-id AANLkTikHUBrx5o==7O1Tk7i+Jnhrox3yh+j0igcbYU--@mail.gmail.com
Whole thread Raw
Responses Re: Fix for Index Advisor related hooks
Re: Fix for Index Advisor related hooks
List pgsql-hackers
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.

Also attached is the patch expose_IndexSupportInitialize.patch, that makes the static function IndexSupportInitialize() global so that the Index Advisor doesn't have to reinvent the wheel to prepare an index structure with opfamilies and opclasses.

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

singh.gurjeet@{ gmail | yahoo }.com
Twitter/Skype: singh_gurjeet

Mail sent from my BlackLaptop device
Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Range Types: empty ranges
Next
From: "Kevin Grittner"
Date:
Subject: Re: Sorting. When?