pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Laurent Raufaste <analogue@glop.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: PG planning randomly ?
Date: Tue, 26 Feb 2008 16:59:33 -0500
Message-ID: <8661.1204063173@sss.pgh.pa.us> (raw)
In-Reply-To: <dcc563d10802261206i641a68f1w8719d42233dd489a@mail.gmail.com>
References: <669dc9710802260719h61d846b3hd50b7f547bcb82c3@mail.gmail.com>
	<3637.1204043502@sss.pgh.pa.us>
	<669dc9710802260912y7fe58f9epe42fe7eb360119d8@mail.gmail.com>
	<dcc563d10802261206i641a68f1w8719d42233dd489a@mail.gmail.com>

"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



view thread (12+ messages)  latest in thread

Message-ID: <8661.1204063173@sss.pgh.pa.us>
Permalink:  ../8661.1204063173@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8661.1204063173@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, scott.marlowe@gmail.com, analogue@glop.org
  Subject: Re: PG planning randomly ?
  In-Reply-To: <8661.1204063173@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox