On Thursday 17 Oct 2002 12:46 am, Keith Gray wrote:
> Getting MIN() adn MAX() seems fairly trivial to me.
>
> When is on an index or more importantly Primary
> Key it must be a common SQL.
>
> Would it be possible in the code to look at
> the field in MIN() or MAX() and if it is
> indexed use a si
Keith:
I think it would be great to get the optimizer to do something smart on
such a simple (and common) query. I am porting an app to Postgresql and
I am not looking forward to having to fix all the postgres-ism that
seem trivial like this. Postgres gets a bad rap for this kinda simple
q
Richard Huxton wrote:
>>> As of now, Max() doesn't utilizes the indices hence
>>>it always do a sequential scan.
>>Is this likely to be sorted in 7.2 ?
>>Is anyone looking at this?
> As I understand, the problem is that the optimisation only applies for simple
> cases...
Getting MIN() adn
On Tuesday 15 Oct 2002 8:47 am, Keith Gray wrote:
> Ludwig Lim wrote:
> > As of now, Max() doesn't utilizes the indices hence
> > it always do a sequential scan.
>
> Thanks Ludwig,
>
> That does help performance, but I was using a "standard"
> SQL command wrapped in a VB6 ADO ODBC program.
>
> I
Ludwig Lim wrote:
>>I have just been comparing some large table
>>performance under 7.1 using the
>>
>> select max(primary key)from table;
>>
>
> Try using the following as alternative :
>
> SELECT primary_key
> FROM table
> ORDER BY primary_key desc
> LIMIT 1;
>
> This shou
Hi Keith:
--- Keith Gray <[EMAIL PROTECTED]> wrote:
> Help,
>
> I have just been comparing some large table
> performance
> under 7.1 using the
>
> select max(primary key)from table;
>
> We are using this for various functions including
> sequence.
>
Try using the following as alter
Help,
I have just been comparing some large table performance
under 7.1 using the
select max(primary key)from table;
We are using this for various functions including sequence.
It is taking 9 seconds to return this from around 1 million records.
Shouldn't this be an instantaneous look