pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dawid Kuroczko <qnex42@gmail.com>
To: Joel Fradkin <jfradkin@wazagua.com>
Cc: PERFORM <pgsql-performance@postgresql.org>
Subject: Re: speed of querry?
Date: Thu, 14 Apr 2005 18:04:02 +0200
Message-ID: <758d5e7f05041409044eadfcd1@mail.gmail.com> (raw)
In-Reply-To: <000b01c54100$a68d2300$797ba8c0@jfradkin>
References: <758d5e7f0504140720754c7750@mail.gmail.com>
	<000b01c54100$a68d2300$797ba8c0@jfradkin>

On 4/14/05, Joel Fradkin <jfradkin@wazagua.com> wrote:
> Josh from commandprompt.com had me alter the config to have
> default_statistics_target = 250
> 
> Is this somehow related to what your asking me to do?
> I did do an analyze, but have only ran the viw a few times.

well, he did suggest the right thing.  However this parameter
applies to newly created tables, so either recreate the tables
or do the ALTER TABLE I've sent eariler.

Basically it tells postgres how many values should it keep for
statistics per column.  The config default_statistics_target
is the default (= used when creating table) and ALTER... is
a way to change it later.

The more statistics PostgreSQL has means it can better
predict how much data will be returned -- and this directly
leads to a choice how to handle the data (order in which
tables should be read, whether to use index or not, which
algorithm use for join, etc.).  The more statistics, the better
PostgreSQL is able to predict.  The more statistics, the slower
planner is able to do the analysis.  So you have to find
a value which will be as much as is needed to accurately
predict the results but not more!  PostgreSQL's default of
10 is a bit conservative, hence the suggestions to increase
it. :)  [ and so is random_page_cost or some people have
found that in their cases it is beneficial to reduce the value,
even as much as below 2. ]

Hope this clairifies things a bit.

   Regards,
      Dawid



view thread (22+ messages)  latest in thread

Message-ID: <758d5e7f05041409044eadfcd1@mail.gmail.com>
Permalink:  ../758d5e7f05041409044eadfcd1@mail.gmail.com/
Also on:    postgresql.org/message-id/758d5e7f05041409044eadfcd1@mail.gmail.com

 · 

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: qnex42@gmail.com, jfradkin@wazagua.com
  Subject: Re: speed of querry?
  In-Reply-To: <758d5e7f05041409044eadfcd1@mail.gmail.com>

* 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