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

From: Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
To: John Hansen <john(at)geeknet(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites
Date: 2004-11-11 08:01:46
Message-ID: 41931C6A.4030401@coretech.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2004-11-11 08:08:33 Re: MAX/MIN optimization via rewrite (plus query rewrites
Previous Message Mark Kirkwood 2004-11-11 07:55:23 Re: MAX/MIN optimization via rewrite (plus query rewrites