quick question: index optimisations on small tables

Поиск
Список
Период
Сортировка
От Andrew Snow
Тема quick question: index optimisations on small tables
Дата
Msg-id 000801c13164$5b674630$fa01b5ca@avon
обсуждение исходный текст
Ответы Re: quick question: index optimisations on small tables  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
If I have:

CREATE TABLE small (
  key   integer PRIMARY KEY,
  value text
);

and assuming there are only enough rows to fit in one page, doesn't it
make sense to use the index instead of a seq. scan for queries of type

SELECT value FROM small WHERE key = 12345;


Since it can get the answer straight out of the index, and if there are
potentially numerous rows, looking up a b-tree is faster than a linear
search?


- Andrew


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

Предыдущее
От: "P.J. \"Josh\" Rovero"
Дата:
Сообщение: glacial deletes (long)
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Re: Fw: [JDBC] Regarding vacuumdb