Re: index speed and failed expectations?

Поиск
Список
Период
Сортировка
От Adam Rich
Тема Re: index speed and failed expectations?
Дата
Msg-id 005201c8f636$f5e5e3d0$e1b1ab70$@r@sbcglobal.net
обсуждение исходный текст
Ответ на index speed and failed expectations?  (rihad <rihad@mail.ru>)
Ответы Re: index speed and failed expectations?  (rihad <rihad@mail.ru>)
Re: index speed and failed expectations?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: index speed and failed expectations?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
> This query from the console:
>
> select * from stats order by start_time;
>
> takes 8 seconds before starting its output. Am I wrong in assuming that
> the index on start_time should make ORDER BY orders of magnitude
> faster?
> Or is this already fast enough? Or should I max up some memory (buffer)
> setting to achieve greater speeds? Not that the speed is crucial, just
> curious.
>

Postgresql won't use the index for queries like this.  Due to the
MVCC implementation, the index does not contain all necessary information
and would therefore be slower than using the table data alone.

(What postgresql lacks is a first_row/all_rows hint like oracle)

However, if you limit the number of rows enough, you might force it
to use an index:

select * from stats order by start_time limit 1000;




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

Предыдущее
От: rihad
Дата:
Сообщение: index speed and failed expectations?
Следующее
От: rihad
Дата:
Сообщение: Re: index speed and failed expectations?