Re: [SQL] Joining bug????

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: pierre(at)desertmoon(dot)com (pierre)
Cc: daveh(at)insightdist(dot)com, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Joining bug????
Date: 1998-10-28 02:19:18
Message-ID: 199810280219.VAA05720@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Felix Kwong 1998-10-28 07:03:12 Unsubscribe
Previous Message pierre 1998-10-28 01:38:55 Re: [SQL] Joining bug????