pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mendola Gaetano <mendola@bigfoot.com>
To: sidarlopez@hotmail.com
Cc: pgsql-admin@postgresql.org
Subject: Re: statistics question
Date: Sat, 14 Jun 2003 20:51:34 +0200
Message-ID: <002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org> (raw)

"Sidar Lopez Cruz" <sidarlopez@hotmail.com> wrote:
> can statistics help the postgresql performance? if yes how?

What do you mean with "statistics" ?
Anyway the planner use statistics information, collected by
postgres statistics collector ( you should turn on it:

stats_start_collector = true
stats_reset_on_server_start = true
stats_command_string = true
stats_row_level = true
stats_block_level = true

).

How: 
suppose to do a select like this:
select * from table_foo where field = X;

if the 100 % of rows have field = X is better do
a sequenzial scan without jump around use the index,
instead if only 0.1 % of the rows have the field = X is better
do an index scan ( specially if the table is really huge ).

In reality the data partitioning is not 100% or 0.1 % and the
planner some time can take wrong decision so you should 
increase or decrease the cost of index scan or full scan
playing with:

cpu_tuple_cost
cpu_index_tuple_cost
cpu_operator_cost


I'm sorry to say however  that since version 7.X
I'm not anymore able to drive correctly the planner,
is like the planner consider these values less then before.

I hope I was clear enough.

Regards
Gaetano Mendola



























view thread (2+ messages)

Message-ID: <002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org>
Permalink:  ../002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org/
Also on:    postgresql.org/message-id/002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mendola@bigfoot.com, sidarlopez@hotmail.com
  Subject: Re: statistics question
  In-Reply-To: <002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org>
  References: <002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org>

* 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