Re: index and queries using '<' '>'

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: index and queries using '<' '>'
Дата
Msg-id 20041119141648.GA22737@wolff.to
обсуждение исходный текст
Ответ на Re: index and queries using '<' '>'  (Marc Boucher <pgml@gmx.net>)
Ответы Re: index and queries using '<' '>'  (Marc Boucher <pgml@gmx.net>)
Список pgsql-general
On Fri, Nov 19, 2004 at 14:45:04 +0100,
  Marc Boucher <pgml@gmx.net> wrote:
> At 16:23 18/11/2004 +0100, Martijn van Oosterhout wrote:
> > The system seems to think that a scan is cheap because the table is so
> > small.
> The table currently contains just over 10000 elements. So 238 rows is a
> small part of it.

No, small is typically less than 1%. This depends on the size of the rows
and how much better accessing disk blocks sequentially is in your
enviroment and the size of your cache.

Because your table is so small it will probably all be cached after being
read through once, so you may want to tune your config settings to
say than random disk access costs only a little more than sequential
access. However, you need to be careful if your table is going to grow
a lot larger.

> Since the table is still growing, and the amount of rows in the reply of
> the query is quite uniform (it's not dependant on the size of the table), I
> hope that the statistics will evolve in a state that will force the use of
> the index.

Index scans aren't always faster than sequential scans.

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

Предыдущее
От: Marc Boucher
Дата:
Сообщение: Re: index and queries using '<' '>'
Следующее
От: Marc Boucher
Дата:
Сообщение: Re: index and queries using '<' '>'