Re: [SQL] Joining bug????

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [SQL] Joining bug????
Дата
Msg-id 199810280219.VAA05720@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] Joining bug????  (pierre <pierre@desertmoon.com>)
Список pgsql-sql
> Thanks David. The vacuum analyze did the trick. I made the invalid
> assumption that the statistics would be up to date just after a copy and
> index creation. They were not. As soon as I ran the vacuum across all my
> tables the explains changed and I got a MAJOR speed increase and the most
> complicated query takes no more than 4-8 seconds. This is perfect.
>
> Perhaps this (bug??) should be documented? I've seen documentation
> relating to the vacuum analyze, but I always made that invalid
> assumption. *sigh* Ah well you live and you learn. :)

I have beefed up the FAQ:

   For column-specific optimization statistics, use vacuum analyze.
   Vacuum analyze is important for complex multi-join queries, so the
   optimizer can estimate the number of rows returned from each table,
   and choose the proper join order. The backend does not keep track of
   column statistics on its own, and vacuum analyze must be run to
   collect them periodically.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

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

Предыдущее
От: pierre
Дата:
Сообщение: Re: [SQL] Joining bug????
Следующее
От: "Felix Kwong"
Дата:
Сообщение: Unsubscribe