Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0

From: tim_wilson <tim(dot)wilson(at)telogis(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0
Date: 2014-06-06 06:43:32
Message-ID: 1402037012706-5806302.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I have now created a repeatable test for this ...bug, well that may be
debatable, but getting the query plan this wrong after vacum and analyze
have run certainly looks like a bug to me.

I have created a test case that matches my problem domain but can probably
be simplified.
postgres_bug.sql
<http://postgresql.1045698.n5.nabble.com/file/n5806302/postgres_bug.sql>

Even after autovac vacuum and autovac analyze have run the query plan goes
from using indexes on the big table to table scanning them as it thinks my
unit_test table is large due to the error in the estimate for rows in the
table that autovac generated. Once you run a cluster on the table all goes
back to using the correct indexes. And the next autovacuum gets things
straight again on the stats table.

Look forward to solution as this is hurting us. A very hot table on our
system goes bad every night and needs constant watching.

regards
Tim

--
View this message in context: http://postgresql.1045698.n5.nabble.com/autovacuum-vacuum-creates-bad-statistics-for-planner-when-it-log-index-scans-0-tp5804416p5806302.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Steven Crandell 2014-06-06 09:17:33 Re: CPU load spikes when CentOS tries to reclaim 'cached' memory
Previous Message Tom Lane 2014-06-06 02:02:01 Re: Re: autovacuum vacuum creates bad statistics for planner when it log index scans: 0