Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B7B2F9FBD0F for ; Fri, 13 Apr 2007 11:17:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 11176-02-8 for ; Fri, 13 Apr 2007 11:17:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1B40D9FBDAA for ; Fri, 13 Apr 2007 11:13:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3DEDFq9018792; Fri, 13 Apr 2007 10:13:15 -0400 (EDT) To: "Avdhoot Kishore Saple" cc: pgsql-performance@postgresql.org Subject: Re: local selectivity estimation - computing frequency of predicates In-reply-to: <54D17EC6EF3C114693F2F8117990AAC101A10233@BLRKECMSG13.ad.infosys.com> References: <54D17EC6EF3C114693F2F8117990AAC101A10233@BLRKECMSG13.ad.infosys.com> Comments: In-reply-to "Avdhoot Kishore Saple" message dated "Fri, 13 Apr 2007 14:29:30 +0530" Date: Fri, 13 Apr 2007 10:13:14 -0400 Message-ID: <18791.1176473594@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/293 X-Sequence-Number: 24170 "Avdhoot Kishore Saple" writes: > How to compute the frequency of predicate (e.g. Salary > $70000) in an > SQL query from a DB's pre-defined indexes?". I'm specifically looking at > how to retrieve information about indices (like number of pages at each > level of index, range of attribute values etc.) I don't think what you're looking for is exposed anywhere. Postgres doesn't rely on indexes for statistical information anyway; the pg_statistic system catalog (see also pg_stats view) is used for that. regards, tom lane