pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Predicate information in EXPLAIN Command
2+ messages / 2 participants
[nested] [flat]

* Predicate information in EXPLAIN Command
@ 2013-05-14 09:23 Sameer Thakur <samthakur74@gmail.com>
  2013-05-14 09:29 ` Re: Predicate information in EXPLAIN Command Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sameer Thakur @ 2013-05-14 09:23 UTC (permalink / raw)
  To: pgsql-performance

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?

Thank you
Sameer

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Predicate information in EXPLAIN Command
  2013-05-14 09:23 Predicate information in EXPLAIN Command Sameer Thakur <samthakur74@gmail.com>
@ 2013-05-14 09:29 ` Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2013-05-14 09:29 UTC (permalink / raw)
  To: Sameer Thakur <samthakur74@gmail.com>; +Cc: pgsql-performance

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-05-14 09:29 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14 09:23 Predicate information in EXPLAIN Command Sameer Thakur <samthakur74@gmail.com>
2013-05-14 09:29 ` Heikki Linnakangas <hlinnakangas@vmware.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox