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

Rewritten Index Advisor patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgreSQL(dot)org
Cc: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
Subject: Rewritten Index Advisor patch
Date: 2007-05-25 00:45:40
Message-ID: 27516.1180053940@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Awhile back I complained that I didn't like the way that the index advisor
patch plugged into the system:
http://archives.postgresql.org/pgsql-hackers/2007-04/msg00346.php

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.  Most of the patch bulk is actually just a small
refactoring of ExplainOnePlan's API to make it more convenient to call
from an advisor plugin.  I also added hooks to let an advisor work through
EXPLAIN, as I still maintain is a more useful behavior than doubling the
work involved in every planner call.  However, the planner() hook is still
there for those who are insistent.

To test the code, I made up a silly little proof-of-concept "advisor" that
just checks to see if 2-column indexes would be more helpful if the column
order were switched.  It's incomplete because I didn't do anything about
printing out a nice explanation of what the hypothetical index is.

Comments, objections?

			regards, tom lane


Attachment: advisor-hooks.patch.gz
Description: application/octet-stream (4.3 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2007-05-25 01:26:19
Subject: Re: like/ilike improvements
Previous:From: Andrew DunstanDate: 2007-05-24 23:32:19
Subject: Re: like/ilike improvements

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