Re: MAX/MIN optimization via rewrite (plus query rewrites

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, alvherre(at)dcc(dot)uchile(dot)cl
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites
Date: 2004-11-11 02:27:18
Message-ID: 4192CE06.8090809@coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>
>A more radical way of handling it would be to detect the relevance of an
>indexscan in indxpath.c and generate a special kind of Path node; this
>would not generalize to other sorts of things as you were hoping, but
>I'm unconvinced that the mechanism is going to be very general-purpose
>anyway. The major advantage is that this would work conveniently for
>comparing the cost of a rewritten query to a non-rewritten one.
>
>
>
I like this point - it makes sense to check that the rewritten query is
less costly to execute than the original!

>How are you planning to represent the association between MIN/MAX and
>particular index orderings in the system catalogs?
>
>
>
>
That is the next item to think on, we could have a rewrite catalog that
holds possible transformations for certain functions (certain aggregates
at this stage I guess). This is a bit like Alvaro's idea - however it
may be better to represent it the way he suggested!

regards

Mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2004-11-11 02:40:26 Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Previous Message Alvaro Herrera 2004-11-11 01:29:07 Re: Reorganization of the translation files