Re: Tuning random_page_cost

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Tuning random_page_cost
Дата
Msg-id 20040713124354.GC3710@wolff.to
обсуждение исходный текст
Ответ на Tuning random_page_cost  ("Markus Wollny" <Markus.Wollny@computec.de>)
Список pgsql-general
On Tue, Jul 13, 2004 at 13:30:29 +0200,
  Markus Wollny <Markus.Wollny@computec.de> wrote:
> Hi!
>
> I've got a query that has a where clause on a timestamp field:
>
> select  t.board_id
>    , t.thread_id
>  from  public.board_thread t
>  where  t.last_reply <= now()-'6 months'::interval
>  limit  1
>
> I've got random_page_cost set to 1.4 which is fine for most queries; yet
> here the planner prefers a (slower) sequential scan:

If you know that an index scan is better you can fudge the query to
change the planner's estimate of the number of rows that will be returned.
The normal fudge is to add a >= check for some timestamp that is earlier
than any in the column, so that you will have a range condition, but not
any change in the rows returned.

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

Предыдущее
От: reina_ga@hotmail.com (Tony Reina)
Дата:
Сообщение: Re: Need Libpq.dll w/ SSL
Следующее
От: "Markus Wollny"
Дата:
Сообщение: Re: Tuning random_page_cost