Re: Why does not subquery pruning conditions inherit to parent query?

2019-06-06 Thread David Rowley
On Thu, 6 Jun 2019 at 19:47, Kato, Sho wrote: > > On Friday, May 31, 2019 9:33 PM, David Rowley wrote: > > Sure, it's possible, but it would require writing code. When it can and > > cannot/should not be done would need to be determined. > > Is there any harmful effect by pulling up a subquery

RE: Why does not subquery pruning conditions inherit to parent query?

2019-06-06 Thread Kato, Sho
tion pruning does not work on the wiki. Thoughts? Regards, kato sho > -Original Message- > From: David Rowley [mailto:david.row...@2ndquadrant.com] > Sent: Friday, May 31, 2019 9:33 PM > To: Kato, Sho/加藤 翔 > Cc: Tom Lane ; pgsql-hack...@postgresql.org > Subject: Re: Why

Re: Why does not subquery pruning conditions inherit to parent query?

2019-05-31 Thread David Rowley
On Fri, 31 May 2019 at 03:18, Kato, Sho wrote: > Is it possible to improve a subquery quals to pull up into outer query? Sure, it's possible, but it would require writing code. When it can and cannot/should not be done would need to be determined. -- David Rowley

RE: Why does not subquery pruning conditions inherit to parent query?

2019-05-31 Thread Kato, Sho
Sent: Monday, May 27, 2019 7:56 PM > To: Kato, Sho/加藤 翔 > Cc: 'David Rowley' ; > pgsql-hack...@postgresql.org > Subject: Re: Why does not subquery pruning conditions inherit to parent > query? > > "Kato, Sho" writes: > > Friday, May 24, 2019 5:10 PM, Dav

Re: Why does not subquery pruning conditions inherit to parent query?

2019-05-27 Thread Tom Lane
"Kato, Sho" writes: > Friday, May 24, 2019 5:10 PM, David Rowley wrote: >> The planner can only push quals down into a subquery, it cannot pull quals >> from a subquery into the outer query. > However, following query looks like the subquery qual is pushed down into the > outer query. >

RE: Why does not subquery pruning conditions inherit to parent query?

2019-05-26 Thread Kato, Sho
> From: David Rowley [mailto:david.row...@2ndquadrant.com] > Sent: Friday, May 24, 2019 5:10 PM > To: Kato, Sho/加藤 翔 > Cc: pgsql-hack...@postgresql.org > Subject: Re: Why does not subquery pruning conditions inherit to parent > query? > > On Fri, 24 May 2019 at 19:44, Kat

Re: Why does not subquery pruning conditions inherit to parent query?

2019-05-24 Thread David Rowley
On Fri, 24 May 2019 at 19:44, Kato, Sho wrote: > I execute following query to the partitioned table, but the plan is different > from my assumption, so please tell me the reason. > > postgres=# explain select * from jta, (select a, max(b) from jtb where a = 1 > group by a ) c1 where jta.a =

Why does not subquery pruning conditions inherit to parent query?

2019-05-24 Thread Kato, Sho
Hello I execute following query to the partitioned table, but the plan is different from my assumption, so please tell me the reason. postgres=# explain select * from jta, (select a, max(b) from jtb where a = 1 group by a ) c1 where jta.a = c1.a; QUERY PLAN