Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UcBYZ-0001ja-BP for pgsql-performance@arkaria.postgresql.org; Tue, 14 May 2013 09:30:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UcBYY-0003kb-RM for pgsql-performance@arkaria.postgresql.org; Tue, 14 May 2013 09:30:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UcBYX-0003kR-VV for pgsql-performance@postgresql.org; Tue, 14 May 2013 09:30:02 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UcBYS-0002IO-1i for pgsql-performance@postgresql.org; Tue, 14 May 2013 09:30:01 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 0D62528663; Tue, 14 May 2013 02:29:55 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 08713B0458; Tue, 14 May 2013 02:29:55 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id C16F6C004E; Tue, 14 May 2013 02:29:49 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Tue, 14 May 2013 02:29:48 -0700 (PDT) Message-ID: <5192040F.8060502@vmware.com> Date: Tue, 14 May 2013 12:29:51 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Sameer Thakur CC: pgsql-performance@postgresql.org Subject: Re: Predicate information in EXPLAIN Command References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -5.6 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 14.05.2013 12:23, Sameer Thakur wrote: > Hello, > I am trying to find predicate information for a given SQL query plan as > provided by Oracle using DBMS_XPLAN. I am looking at the EXPLAIN command > for getting this query plan information, with no luck so far. > > Does the EXPLAIN command provide predicate information? Sure. For example, postgres=# explain select * from a where id = 123; QUERY PLAN --------------------------------------------------- Seq Scan on a (cost=0.00..40.00 rows=12 width=4) Filter: (id = 123) (2 rows) The predicate is right there on the Filter line. Likewise for a join: postgres=# explain select * from a, b where a.id = b.id; QUERY PLAN ----------------------------------------------------------------- Hash Join (cost=64.00..134.00 rows=2400 width=8) Hash Cond: (a.id = b.id) -> Seq Scan on a (cost=0.00..34.00 rows=2400 width=4) -> Hash (cost=34.00..34.00 rows=2400 width=4) -> Seq Scan on b (cost=0.00..34.00 rows=2400 width=4) (5 rows) The join predicate is on the Hash Cond line. - Heikki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance