Re: Problem with indexes, LIMIT, ORDER BY ... DESC

From: "Nick Fankhauser" <nickf(at)ontko(dot)com>
To: "Ken Williams" <ken(at)mathforum(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with indexes, LIMIT, ORDER BY ... DESC
Date: 2002-06-07 13:13:56
Message-ID: NEBBLAAHGLEEPCGOBHDGAEHAFBAA.nickf@ontko.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)ontko(dot)com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wim 2002-06-07 13:28:47 HELP! Cannot access table!!!!
Previous Message Achilleus Mantzios 2002-06-07 11:23:33 Re: arrays as pgsql function parameters