X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id CC8DE30D6EE for ; Sat, 14 Jun 2003 18:51:51 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 02898-01 for ; Sat, 14 Jun 2003 15:51:41 -0300 (ADT) Received: from smtp.noos.fr (nan-smtp-12.noos.net [212.198.2.83]) by svr1.postgresql.org (Postfix) with ESMTP id C352830D6DD for ; Sat, 14 Jun 2003 15:51:40 -0300 (ADT) Received: (qmail 6898475 invoked by uid 0); 14 Jun 2003 18:51:38 -0000 Received: from unknown (HELO gmendola) ([212.198.40.246]) (envelope-sender ) by 212.198.2.83 (qmail-ldap-1.03) with SMTP for ; 14 Jun 2003 18:51:38 -0000 Message-ID: <002b01c332a5$fb5cc720$10d4a8c0@mm.eutelsat.org> From: "Mendola Gaetano" To: Cc: Subject: Re: statistics question Date: Sat, 14 Jun 2003 20:51:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Archive-Number: 200306/154 X-Sequence-Number: 9145 "Sidar Lopez Cruz" 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