Re: Query runs 38 seconds for small database!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan de Visser <jdevisser(at)digitalfairway(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Subject: Re: Query runs 38 seconds for small database!
Date: 2006-05-08 19:48:38
Message-ID: 29126.1147117718@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jan de Visser <jdevisser(at)digitalfairway(dot)com> writes:
> On Monday 08 May 2006 14:10, Andrus wrote:
>> I created empty table konto and loaded more that 219 records to it during
>> database creation.
>> So it seems that if table grows from zero to more than 219 times larger
>> then it was still not processed.

> That's because you need at least 500 rows for analyze and 100 for a vacuum,
> (autovacuum_vacuum_threshold = 1000, autovacuum_analyze_threshold = 500).

This crystallizes something that's been bothering me for awhile,
actually: why do the "threshold" variables exist at all? If we took
them out, or at least made their default values zero, then the autovac
criteria would simply be "vacuum or analyze if at least X% of the table
has changed" (where X is set by the "scale_factor" variables). Which
seems intuitively reasonable. As it stands, the thresholds seem to bias
autovac against ever touching small tables at all ... but, as this
example demonstrates, a fairly small table can still kill your query
performance if the planner knows nothing about it.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeffrey Tenny 2006-05-08 19:51:26 Re: performance question (something to do w/ parameterized
Previous Message Jeffrey Tenny 2006-05-08 19:43:39 Re: performance question (something to do w/ parameterized