Re: [SQL] Joining bug???? - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: [SQL] Joining bug????
Date
Msg-id 199810280219.VAA05720@candle.pha.pa.us
Whole thread Raw
In response to Re: [SQL] Joining bug????  (pierre <pierre@desertmoon.com>)
List 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 by date:

Previous
From: pierre
Date:
Subject: Re: [SQL] Joining bug????
Next
From: "Felix Kwong"
Date:
Subject: Unsubscribe