Re: PG planning randomly ? - Mailing list pgsql-performance

From Tom Lane
Subject Re: PG planning randomly ?
Date
Msg-id 8661.1204063173@sss.pgh.pa.us
Whole thread Raw
In response to Re: PG planning randomly ?  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-performance
"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> On Tue, Feb 26, 2008 at 11:12 AM, Laurent Raufaste <analogue@glop.org> wrote:
>> I tried increasing the stats target with the command:
>> SET default_statistics_target=1000 ;
>> That's the command I launched before executing the ANALYZE showed in
>> the previous mail.

> You're doing it wrong.  The default target affects newly created
> columns / tables.  You need to use alter table to change a stats
> target after creation.  Like so:
> alter table abc alter column xyz set statistics 100;

That's completely incorrect.  If the column doesn't have a specific
stats target (indicated by -1 in attstattarget, which Laurent showed
us was the case), then ANALYZE will use the current value of
default_statistics_target.  The table-creation-time value of that
parameter isn't relevant at all.

            regards, tom lane

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: PG planning randomly ?
Next
From: Joel Stevenson
Date:
Subject: Re: LISTEN / NOTIFY performance in 8.3