Re: [HACKERS] Turn off transitive joins

2017-10-14 Thread Gourav Kumar
I don't think there is any need to add any such capability in postgresql, but I need it for my work. I need the join qualifiers. On 15-Oct-2017 1:37 AM, "Tom Lane" <t...@sss.pgh.pa.us> wrote: > Gourav Kumar <gourav1...@gmail.com> writes: > > Is there some way

[HACKERS] Turn off transitive joins

2017-10-14 Thread Gourav Kumar
Hi all, Is there some way by which I can tell postgresql to not to consider transitive joins while considering join pairs. I.e. Let's say a query has two join predicates one between A & B relations and the other between B and C relations. While constructing the DP to find the best join order,

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
I want to get the join graph of a given query. Which has node for each relation and an edge between two nodes if they have a join predicate among them. On 14-Oct-2017 3:58 AM, "Andres Freund" <and...@anarazel.de> wrote: > On 2017-10-14 03:49:57 +0530,

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
But then is there some way to tell Optimizer not to consider transitive joins ? Or to know if the join is transitive or not ? On 14-Oct-2017 3:43 AM, "Tom Lane" <t...@sss.pgh.pa.us> wrote: > Gourav Kumar <gourav1...@gmail.com> writes: > > For e.g. I am checking fo

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-13 Thread Gourav Kumar
.store_sales else null end and case when ws2.web_sales > 0 then ws3.web_sales/ws2.web_sales else null end > case when ss2.store_sales > 0 then ss3.store_sales/ss2.store_sales else null end order by web_q2_q3_increase; -- end On 13 October 2017 at 01:00, Gourav Kumar &l

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
s a join predicate between ss1 and ws2 or ss1 and ws3. But optimizer still considers a join among them. On 14 October 2017 at 02:20, Gourav Kumar <gourav1...@gmail.com> wrote: > I tried debugging the code, at no point in execution the function > make_rels_by_clauseless_joins was c

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
I tried debugging the code, at no point in execution the function make_rels_by_clauseless_joins was called. Although optimizer did consider some of the joins which are cross products. On 14 October 2017 at 01:57, Gourav Kumar <gourav1...@gmail.com> wrote: > Can I use something like

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
8 PM, Robert Haas <robertmh...@gmail.com> > wrote: > > > > On Fri, Oct 13, 2017 at 4:06 PM, Gourav Kumar <gourav1...@gmail.com> > wrote: > > > Can you guide me where to look for it? > > > > Search for make_rels_by_clauseless_joins. > > >

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
Can you guide me where to look for it? On 14 October 2017 at 01:35, Robert Haas <robertmh...@gmail.com> wrote: > On Fri, Oct 13, 2017 at 3:41 PM, Gourav Kumar <gourav1...@gmail.com> > wrote: > > is there some way through which I can disable cross products in > postgre

[HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
Hi all, is there some way through which I can disable cross products in postgresql? This will make the DP join to not to consider join between two relations if they don't have a join predicate among them. Thanks, Gourav Kumar Computer Science and Automation Indian Institute of Science

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-12 Thread Gourav Kumar
Well for this given query it is possible. I haven't come across any such query yet. Possibly because I am more concerned about the TPCDS and TPCH benchmarks, where it's less likely to occur. On 13 October 2017 at 00:52, Tom Lane <t...@sss.pgh.pa.us> wrote: > Gourav Kumar <gourav1.

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-12 Thread Gourav Kumar
A Join clause/predicate will only mention 2 relations. It can't have 3 or more relations. On 12 October 2017 at 23:14, Tom Lane <t...@sss.pgh.pa.us> wrote: > Gourav Kumar <gourav1...@gmail.com> writes: > > My objective is to construct join graph from a given query. > &g

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-12 Thread Gourav Kumar
What is meant by "unstructured Join"? Thanks, Gourav On 12 October 2017 at 22:47, Gourav Kumar <gourav1...@gmail.com> wrote: > 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 &

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-12 Thread Gourav Kumar
hey share a join predicate among them or not. On 12 October 2017 at 22:08, Tom Lane <t...@sss.pgh.pa.us> wrote: > Gourav Kumar <gourav1...@gmail.com> writes: > > I have the RelOptInfo data structure for the relations which are to be > > joined but when I check their joininfo,

Re: [HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-12 Thread Gourav Kumar
wrote: > On Tue, Oct 10, 2017 at 7:29 PM, Gourav Kumar <gourav1...@gmail.com> > wrote: > > Hi all, > > > > When you fire a query in postgresql, it will first parse the query and > > create the data structures for storing various aspects of the query and > > execu

[HACKERS] How does postgres store the join predicate for a relation in a given query

2017-10-10 Thread Gourav Kumar
of a query. Like which data structure is used to store the join predicates. How can we find the join predicates applied on a relation from relid, Oid or RangeTblEntry ? I want to construct a join graph for a given query, for which I need the join predicates between two relations. -- Thanks, Gourav Kumar