Re: Efficiency Question

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Efficiency Question
Дата
Msg-id 20020909135731.GA1461@wolff.to
обсуждение исходный текст
Ответ на Efficiency Question  ("Colin Fox" <cfox@cfconsulting.ca>)
Список pgsql-sql
On Mon, Sep 09, 2002 at 00:13:04 +0000, Colin Fox <cfox@cfconsulting.ca> wrote:
> 
> select
>    *
> from
>    motm
> order by
>    creation_date desc
> limit 1;
> 
> So in the first case I select the record that has the largest date. In the
> second case, I order all the records, and then return only one.

If you have an index on creation_date an index scan can be used which
will make the second form run a lot faster if there are lots of records.


В списке pgsql-sql по дате отправления:

Предыдущее
От: jasondavis19@hotmail.com (Jason Davis)
Дата:
Сообщение: Cross tables Like%
Следующее
От: Viacheslav N Tararin
Дата:
Сообщение: Re: new calculated column