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 41931C6A.4030401@coretech.co.nz
Whole thread Raw
In response to Re: MAX/MIN optimization via rewrite (plus query rewrites generally)  ("John Hansen" <john@geeknet.com.au>)
List pgsql-hackers
Probably for a small table, where the machinery of reading the index, 
followed by checking the table for non-visible tuples is more costly 
than just scanning the table!


regards

Mark

John Hansen wrote:

>Why not just change the function all together to 'select $1 from $2
>order by $1 desc limit 1;'
>
>Is there ANY situation where max(col) as it is, would be faster?
>
>... John
>  
>


pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites
Next
From: Greg Stark
Date:
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites