Re: statistics question

From: "Mendola Gaetano" <mendola(at)bigfoot(dot)com>
To: <sidarlopez(at)hotmail(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: statistics question
Date: 2003-06-14 18:51:34
Message-ID: 002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Sidar Lopez Cruz" <sidarlopez(at)hotmail(dot)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

Browse pgsql-admin by date

  From Date Subject
Next Message Craig Jensen 2003-06-15 03:11:58 rpm-scripts
Previous Message Ernest E Vogelsinger 2003-06-14 13:31:52 Re: psql doesn't work