Re: Sequencial scan over primary keys

Поиск
Список
Период
Сортировка
От Igor Roboul
Тема Re: Sequencial scan over primary keys
Дата
Msg-id 20001110154306.A22808@linux.rainbow
обсуждение исходный текст
Ответ на Sequencial scan over primary keys  ("Vilson farias" <vilson.farias@digitro.com.br>)
Список pgsql-general
On Fri, Nov 10, 2000 at 10:16:47AM -0200, Vilson farias wrote:
> result of execution is a sequencial scan, but this is a PRIMARY KEY, it does
> has an index. How can it be explained?
If you wish use index, then you need include ORDER BY clause. AFAIK
two SELECTs on same data without ORDER BY _CAN_ return records in
different order. This is part of relation theory AFAIK. So index is
not used. But, for example, sequencial scan can be faster than indexed
when you do not use WHERE.
So for example, 'SELECT * FROM t1' will be faster then 'SELECT * FROM
t1 ORDER BY primary_key_field'. I think.

--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744

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

Предыдущее
От: "Vilson farias"
Дата:
Сообщение: Sequencial scan over primary keys 2
Следующее
От: "Oliver Elphick"
Дата:
Сообщение: Re: strange behvaviour in join? BUG in 7.02?