Re: Problem with indexes, LIMIT, ORDER BY ... DESC - Mailing list pgsql-general

From Nick Fankhauser
Subject Re: Problem with indexes, LIMIT, ORDER BY ... DESC
Date
Msg-id NEBBLAAHGLEEPCGOBHDGAEHAFBAA.nickf@ontko.com
Whole thread Raw
In response to Problem with indexes, LIMIT, ORDER BY ... DESC  (Ken Williams <ken@mathforum.org>)
List pgsql-general
Ken-

I'd suggest trying the index with the date first, or even indexing them
separately. Essentially, it looks like the index works as expected to
selected the candidate rows, but since date isn't the initial part of the
index, the index can't be used for the sort that must be done on the entire
set of candidates before the first one is selected.

BTW, I believe there is a "max" function that you might be able to use on
this. It may amount to the same operations as far as the planner goes, but
it gives you one more option to play with.

Regards,

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/


pgsql-general by date:

Previous
From: Yutaka tanida
Date:
Subject: Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes
Next
From: Wim
Date:
Subject: HELP! Cannot access table!!!!