Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-23 Thread Gurjeet Singh
On Fri, Feb 18, 2011 at 1:36 PM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 18.02.2011 17:02, Gurjeet Singh wrote: Another use case of the Index Advisor is to be switched on for a few hours while the application runs, and gather the recommendations for the whole run.

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-18 Thread Gurjeet Singh
On Fri, Feb 18, 2011 at 2:27 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 17.02.2011 14:30, Gurjeet Singh wrote: On Wed, Feb 16, 2011 at 6:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Fetch the values you need and stuff 'em in the struct. Don't expect relcache to do

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-18 Thread Heikki Linnakangas
On 18.02.2011 17:02, Gurjeet Singh wrote: On Fri, Feb 18, 2011 at 2:27 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 17.02.2011 14:30, Gurjeet Singh wrote: On Wed, Feb 16, 2011 at 6:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Fetch the values you need and stuff 'em in

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-18 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 18.02.2011 17:02, Gurjeet Singh wrote: On Wed, Feb 16, 2011 at 6:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Fetch the values you need and stuff 'em in the struct. Don't expect relcache to do it for you. I also wish to make

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-17 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 6:37 PM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: The only reason you'd need that code is if you were trying to construct a fake Relation structure, which

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-17 Thread Heikki Linnakangas
On 17.02.2011 14:30, Gurjeet Singh wrote: On Wed, Feb 16, 2011 at 6:37 PM, Tom Lanet...@sss.pgh.pa.us wrote: Gurjeet Singhsingh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:25 AM, Tom Lanet...@sss.pgh.pa.us wrote: The only reason you'd need that code is if you were trying to

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 11:59 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: Also attached is the patch expose_IndexSupportInitialize.patch, that makes the static function IndexSupportInitialize() global so that the Index Advisor doesn't have to

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 12:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 11.02.2011 22:44, Gurjeet Singh wrote: One one hand

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: I understand that we need to hide guts of an implementation. But without this the Index Advisor will have to emulate what LookupOpclassInfo() does and that's a lot of code that I am afraid, if emulated by another function in Index Advisor, is more

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: BTW, you use the term 'fictitious' in the comments, would it be better to standardize the term used for such an index? So either the comment would be changed to call it hypothetical, or the structure member would be changed to isfictitious.

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 10:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: I understand that we need to hide guts of an implementation. But without this the Index Advisor will have to emulate what LookupOpclassInfo() does and that's a lot of code

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: BTW, you use the term 'fictitious' in the comments, would it be better to standardize the term used for such an index? So either the comment would be changed to call it

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: The only reason you'd need that code is if you were trying to construct a fake Relation structure, which seems unnecessary and undesirable. The planner requires IndexOptInfo, and

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, hypothetical is the more-established term I think. Please find the patch attached. Applied with minor adjustments to HEAD and 9.0. regards, tom

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Thom Brown
On 16 February 2011 23:02, Gurjeet Singh singh.gurj...@gmail.com wrote: On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes:     BTW, you use the term 'fictitious' in the comments, would it be better to standardize the term

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Tom Lane
Thom Brown t...@linux.com writes: For my benefit, could you explain how ishypothetical gets set to true? In the core, it never does. An index advisor plugin would set it in IndexOptInfo structs that it makes. regards, tom lane -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Thom Brown
On 17 February 2011 00:48, Tom Lane t...@sss.pgh.pa.us wrote: Thom Brown t...@linux.com writes: For my benefit, could you explain how ishypothetical gets set to true? In the core, it never does.  An index advisor plugin would set it in IndexOptInfo structs that it makes. I get the idea.

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-16 Thread Gurjeet Singh
On Wed, Feb 16, 2011 at 7:25 PM, Tom Lane t...@sss.pgh.pa.us wrote: Gurjeet Singh singh.gurj...@gmail.com writes: On Wed, Feb 16, 2011 at 10:26 AM, Tom Lane t...@sss.pgh.pa.us wrote: Yeah, hypothetical is the more-established term I think. Please find the patch attached. Applied with

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-15 Thread Heikki Linnakangas
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

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-15 Thread Gurjeet Singh
On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.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

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-15 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: 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.

Re: [HACKERS] Fix for Index Advisor related hooks

2011-02-15 Thread Tom Lane
Gurjeet Singh singh.gurj...@gmail.com writes: On Tue, Feb 15, 2011 at 8:24 AM, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 11.02.2011 22:44, Gurjeet Singh wrote: One one hand get_actual_variable_range() expects that virtual indexes do not have an OID assigned, on the

[HACKERS] Fix for Index Advisor related hooks

2011-02-11 Thread Gurjeet Singh
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