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" wrote: > On 2017-10-14 03:49:57 +0530, Gourav Kumar wrote: > > But then is there

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Andres Freund
On 2017-10-14 03:49:57 +0530, Gourav Kumar wrote: > But then is there some way to tell Optimizer not to consider transitive > joins ? What are you actually trying to achieve here? - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

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" wrote: > Gourav Kumar writes: > > For e.g. I am checking for this query > > ... > > where

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Tom Lane
Gourav Kumar writes: > For e.g. I am checking for this query > ... > where > and ss1.ca_county = ss2.ca_county > and ss2.ca_county = ss3.ca_county > and ss1.ca_county = ws1.ca_county > and ws1.ca_county = ws2.ca_county > and ws1.ca_county = ws3.ca_county

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
For e.g. I am checking for this query with ss as (select ca_county,d_qoy, d_year,sum(ss_ext_sales_price) as store_sales from store_sales,date_dim,customer_address where ss_sold_date_sk = d_date_sk and ss_addr_sk=ca_address_sk group by ca_county,d_qoy, d_year), ws as (select

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 wrote: > Can I use something like joininfo,

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Gourav Kumar
Can I use something like joininfo, which will store the join predicates and I can check if there is no join predicate among the two relations don't consider them. On 14 October 2017 at 01:48, Fabrízio de Royes Mello < fabriziome...@gmail.com> wrote: > > On Fri, Oct 13, 2017 at 5:08 PM, Robert

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Fabrízio de Royes Mello
On Fri, Oct 13, 2017 at 5:08 PM, Robert Haas wrote: > > On Fri, Oct 13, 2017 at 4:06 PM, Gourav Kumar wrote: > > Can you guide me where to look for it? > > Search for make_rels_by_clauseless_joins. > I wonder if it's possible implement it as an

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Robert Haas
On Fri, Oct 13, 2017 at 4:06 PM, Gourav Kumar wrote: > Can you guide me where to look for it? Search for make_rels_by_clauseless_joins. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list

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 wrote: > On Fri, Oct 13, 2017 at 3:41 PM, Gourav Kumar > wrote: > > is there some way through which I can disable cross products in > postgresql? > > > > This will make

Re: [HACKERS] Disable cross products in postgres

2017-10-13 Thread Robert Haas
On Fri, Oct 13, 2017 at 3:41 PM, Gourav Kumar wrote: > 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. I mean, it would

[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