Re: order by and index path (was: What about LIMIT in SELECT ?)

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: order by and index path (was: What about LIMIT in SELECT ?)
Дата
Msg-id 362601CC.AA5032C2@trust.ee
обсуждение исходный текст
Список pgsql-hackers
> Date: Thu, 15 Oct 1998 10:56:50 +0200
Andreas Zeugswetter wrote:
>
> Resumee:
> You have to look at this from the cost point of view. If there is an order by that can be
> done with an index, this will make the index a little more preferrable than for the same
> query without the order by, but it should not force the index.
> You have to give the sort a cost, so that the index access can be compared to the
> seq scan and sort path.

But if we finally get only 10 first rows, it may still be _much_ faster
to do just the index scan, which, being the toplevel executor will get
only the needed rows.

So here we come back to the LIMIT clause (or something like it) because
the optimiser has no knowledge whatever about the use of DECLARE/FETCH
(I assume).



------------------
Hannu Krosing

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

Предыдущее
От: Andreas Zeugswetter
Дата:
Сообщение: AW: [HACKERS] PostgreSQL v6.4 BETA2...
Следующее
От: Brook Milligan
Дата:
Сообщение: Re: [HACKERS] perl interface bug?