Re: Statistics mismatch between n_live_tup and actual row count

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Brandl <ml(at)3(dot)141592654(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Statistics mismatch between n_live_tup and actual row count
Date: 2011-12-08 22:59:59
Message-ID: 10611.1323385199@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Brandl <ml(at)3(dot)141592654(dot)de> writes:
> we're currently investigating a statistics issue on postgres. We have some tables which frequently show up with strange values for n_live_tup. If you compare those values with a count on that particular table, there is a mismatch of factor 10-30. This causes the planner to come up with very bad plans (we also have this issue on bigger table like the one below).

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sharmi_jo 2011-12-08 23:07:50
Previous Message kc5 2011-12-08 22:53:52 Re: Clarification on CONTEXT: xlog redo xid assignment