Skip site navigation (1) Skip section navigation (2)

Re: Almost infinite query -> Different Query Plan when changing where clause value

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: lionel duboeuf <lionel(dot)duboeuf(at)boozter(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Almost infinite query -> Different Query Plan when changing where clause value
Date: 2010-02-15 17:24:27
Message-ID: dcc563d11002150924r2b6afb9dg685b7af94fa06798@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, Feb 15, 2010 at 2:52 AM, lionel duboeuf
<lionel(dot)duboeuf(at)boozter(dot)com> wrote:
> See as attachment the "correct" query plan for an other 'user'.
> I confirm by executing manual "VACUUM ANALYZE" that the problem is solved.
> But what i don't understand is that i would expect autovacuum to do the job.

There are two operations here.  Vacuum, which reclaims lost space, and
analyze which analyzes your data and stores histograms to be used when
building queries, to determine how many rows are likely to be returned
by each part of the plan.

The autovac daemon runs both vacuums and analyzes, often independently
of each other, when needed, based on threshold settings.  By running
autovac your db would get analyzed when necessary and would then have
up to date statistics when queries were run after that.

In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2010-02-15 17:26:28
Subject: Re: 8.1 -> 8.4 regression
Previous:From: Robert HaasDate: 2010-02-15 16:41:43
Subject: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group