Skip site navigation (1) Skip section navigation (2)

Re: Rewritten Index Advisor patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Rewritten Index Advisor patch
Date: 2007-05-25 18:16:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
I wrote:
> Attached is a proposed replacement patch that keeps essentially all the
> advisor logic outside the core backend, and uses the method I suggested of
> modifying the result of get_relation_info() rather than installing phony
> system-catalog entries.

I've applied this with one further change to make the planner_hook a bit
more general; it now looks like this:

PlannedStmt *
planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
    PlannedStmt *result;

    if (planner_hook)
        result = (*planner_hook) (parse, cursorOptions, boundParams);
        result = standard_planner(parse, cursorOptions, boundParams);
    return result;

PlannedStmt *
standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
  ... exactly the same as planner() was before ...

This avoids presuming that the hook needs to duplicate the Query, and
potentially lets a plugin replace the planner altogether.

The Index Advisor patch as-submitted is not compatible with these hooks,
but it appears to need nontrivial work anyway due to other changes
between 8.2 and 8.3 (in particular the introduction of PlannedStmt).
Rather than trying to get it into 8.3 as a contrib module, I recommend
pursuing it as a pgfoundry project, so as to decouple its release
schedule from the backend's.

			regards, tom lane

In response to

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2007-05-25 19:30:35
Subject: Re: Seq scans status update
Previous:From: Tom LaneDate: 2007-05-25 18:02:21
Subject: Re: cluster test

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group