Re: MAX/MIN optimization via rewrite (plus query rewrites - Mailing list pgsql-hackers

From Mark Kirkwood
Subject Re: MAX/MIN optimization via rewrite (plus query rewrites
Date
Msg-id 4192CE06.8090809@coretech.co.nz
Whole thread Raw
In response to Re: MAX/MIN optimization via rewrite (plus query rewrites generally)  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Reorganization of the translation files
Next
From: Bruno Wolff III
Date:
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites generally)