Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C7A8C9FB87C for ; Mon, 11 Jun 2007 11:34:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 32462-02 for ; Mon, 11 Jun 2007 11:34:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 9927B9FA43F for ; Mon, 11 Jun 2007 11:34:31 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l5BEYOTa000504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Jun 2007 08:34:26 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l5BEYN8u033385; Mon, 11 Jun 2007 08:34:23 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l5BEYNwr033384; Mon, 11 Jun 2007 08:34:23 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 11 Jun 2007 08:34:23 -0600 From: Michael Fuhr To: Nimesh Satam Cc: Heikki Linnakangas , pgsql-performance@postgresql.org, database@zedo.com Subject: Re: pg_statistic doesnt contain details for specific table Message-ID: <20070611143423.GA33335@winnie.fuhr.org> References: <965aa3ed0706110150g6f5e85bevfb4be0b50b649271@mail.gmail.com> <466D0DB4.2080404@enterprisedb.com> <965aa3ed0706110158r27c9c19aj32a87d9ccf7e2383@mail.gmail.com> <20070611132953.GA32879@winnie.fuhr.org> <965aa3ed0706110652k496af68di8217d488fa6e297a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <965aa3ed0706110652k496af68di8217d488fa6e297a@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/181 X-Sequence-Number: 25214 On Mon, Jun 11, 2007 at 07:22:24PM +0530, Nimesh Satam wrote: > INFO: analyzing "public.cam_attr" > INFO: "cam_attr": scanned 103 of 103 pages, containing 11829 live rows and > 0 dead rows; 6000 rows in sample, 11829 estimated total rows Looks reasonable. > Also how do we check if the statistics are set to Zero for the table? SELECT attname, attstattarget FROM pg_attribute WHERE attrelid = 'public.cam_attr'::regclass AND attnum > 0 AND NOT attisdropped; If nobody has changed the statistics targets then they're all probably -1. Negative attstattarget values mean to use the system default, which you can see with: SHOW default_statistics_target; How exactly are you determining that no statistics are showing up for this table? Are you running a query like the following? SELECT * FROM pg_stats WHERE schemaname = 'public' AND tablename = 'cam_attr'; -- Michael Fuhr