Re: [HACKERS] How does postgres store the join predicate for arelation in a given query - Mailing list pgsql-hackers

From Gourav Kumar
Subject Re: [HACKERS] How does postgres store the join predicate for arelation in a given query
Date
Msg-id CAPzqDmjAyRG_sGRZFHjKCnVXomZEwjcdn65g7TTWtwF30JCL+w@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] How does postgres store the join predicate for a relation in a given query  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] How does postgres store the join predicate for arelation in a given query
Re: [HACKERS] How does postgres store the join predicate for a relation in a given query
List pgsql-hackers
My objective is to construct join graph from a given query.
A join graph, has a node for each relation involved in a join, and an edge between two relations if they share a join predicate among them.

To do this I first tried to use the make_join_rel() function
     - There I checked if they root->join->cur->level is 2, just write the relation names to a file.
     - But this strategy failed, because if there is somewhere a Cartesian product among two relations, then they can't have an edge in the join graph.
     - So, along with writing the relation name, I need to know if they share a join predicate among them or not.
 

On 12 October 2017 at 22:08, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Gourav Kumar <gourav1905@gmail.com> writes:
> I have the RelOptInfo data structure for the relations which are to be
> joined but when I check their joininfo, it is empty.

You aren't telling us anything much about the case you're studying,
but if the join clauses have the form of equality comparisons, they
likely got converted into EquivalenceClass data structures instead.
These days the joininfo lists only contain "unstructured" join
conditions.

                        regards, tom lane



--
Thanks,
Gourav Kumar
Computer Science and Automation
Indian Institute of Science

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [COMMITTERS] pgsql: Add port/strnlen support to libpq and ecpg Makefiles.
Next
From: Gourav Kumar
Date:
Subject: Re: [HACKERS] How does postgres store the join predicate for arelation in a given query