Re: Statistics mismatch between n_live_tup and actual row count - Mailing list pgsql-general

From Tom Lane
Subject Re: Statistics mismatch between n_live_tup and actual row count
Date
Msg-id 10611.1323385199@sss.pgh.pa.us
Whole thread Raw
In response to Statistics mismatch between n_live_tup and actual row count  (Andreas Brandl <ml@3.141592654.de>)
Responses Re: Statistics mismatch between n_live_tup and actual row count
List pgsql-general
Andreas Brandl <ml@3.141592654.de> writes:
> we're currently investigating a statistics issue on postgres. We have some tables which frequently show up with
strangevalues for n_live_tup. If you compare those values with a count on that particular table, there is a mismatch of
factor10-30. This causes the planner to come up with very bad plans (we also have this issue on bigger table like the
onebelow). 

The planner doesn't use n_live_tup; the only thing that that's used for
is decisions about when to autovacuum/autoanalyze.  So you have two
problems here not one.

Can you provide a test case for the n_live_tup drift?  That is,
something that when done over and over causes n_live_tup to get further
and further from reality?

            regards, tom lane

pgsql-general by date:

Previous
From: kc5
Date:
Subject: Re: Clarification on CONTEXT: xlog redo xid assignment
Next
From: sharmi_jo@yahoo.com
Date:
Subject: