Litao Wu <[EMAIL PROTECTED]> writes:
> I noticed that reltuples are way off if
> I vacuum the table and analyze the table.
> And the data (296901) after vacuum seems 
> accurate while
> the reltuples (1.90744e+06)
> after anlayze is too wrong.

VACUUM derives an exact count because it scans the whole table.  ANALYZE
samples just a subset of the table and extrapolates.  It would appear
that you've got radically different tuple densities in different parts
of the table, and that's confusing ANALYZE.

> My PG version is 7.3.2 (I know it is old).

8.0's ANALYZE uses a new sampling method that we think is less prone
to this error, though of course any sampling method will fail some of
the time.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to