Re: d25ea01275 and partitionwise join

2020-04-07 Thread Amit Langote
On Wed, Apr 8, 2020 at 11:17 AM Tom Lane wrote: > Amit Langote writes: > > On Tue, Apr 7, 2020 at 2:41 AM Tom Lane wrote: > >> I *think* that it might be all right, because although what we > >> are matching to is a user-written COALESCE() not an actual > >> FULL JOIN USING column, it has to

Re: d25ea01275 and partitionwise join

2020-04-07 Thread Etsuro Fujita
On Wed, Apr 8, 2020 at 11:17 AM Tom Lane wrote: > But this patch seems to still work, > and the other thing doesn't fix the problem, so pushed. Thanks for working on this! Best regards, Etsuro Fujita

Re: d25ea01275 and partitionwise join

2020-04-07 Thread Tom Lane
Amit Langote writes: > On Tue, Apr 7, 2020 at 2:41 AM Tom Lane wrote: >> I *think* that it might be all right, because although what we >> are matching to is a user-written COALESCE() not an actual >> FULL JOIN USING column, it has to behave in somewhat the same >> way. In particular, by

Re: d25ea01275 and partitionwise join

2020-04-06 Thread Amit Langote
On Tue, Apr 7, 2020 at 2:41 AM Tom Lane wrote: > Amit Langote writes: > > which does succeed in using partitionwise join. Please see attached > > delta that applies on your v7 if that is what you'd rather have. > > I figured these queries were cheap enough that we could afford to run > both.

Re: d25ea01275 and partitionwise join

2020-04-06 Thread Tom Lane
Amit Langote writes: > which does succeed in using partitionwise join. Please see attached > delta that applies on your v7 if that is what you'd rather have. I figured these queries were cheap enough that we could afford to run both. With that and some revision of the comments (per attached),

Re: d25ea01275 and partitionwise join

2020-04-06 Thread Amit Langote
On Mon, Apr 6, 2020 at 11:09 PM Tom Lane wrote: > Amit Langote writes: > > Oops, I thought I copy-pasted 4-way full join test not this one, but > > evidently didn't. > > Have you got such a query at hand? I wondered whether we shouldn't > use a 4-way rather than 3-way test case; it'd offer more

Re: d25ea01275 and partitionwise join

2020-04-06 Thread Tom Lane
Amit Langote writes: > On Mon, Apr 6, 2020 at 7:29 AM Tom Lane wrote: >> * I think your logic for building the coalesce combinations was just >> wrong. We need combinations of left-hand inputs with right-hand inputs, >> not left-hand with left-hand or right-hand with right-hand. Also the >>

Re: d25ea01275 and partitionwise join

2020-04-06 Thread Amit Langote
On Mon, Apr 6, 2020 at 7:29 AM Tom Lane wrote: > Amit Langote writes: > > Okay, I tried that in the updated patch. I didn't try to come up with > > examples that might break it though. > > I looked through this. Thank you. > * I think your logic for building the coalesce combinations was just

Re: d25ea01275 and partitionwise join

2020-04-05 Thread Tom Lane
Amit Langote writes: > Okay, I tried that in the updated patch. I didn't try to come up with > examples that might break it though. I looked through this. * Wasn't excited about inventing makeCoalesceExpr(); the fact that it only had two potential call sites seemed to make it not worth the

Re: d25ea01275 and partitionwise join

2020-04-04 Thread Amit Langote
On Sat, Apr 4, 2020 at 6:13 AM Tom Lane wrote: > Amit Langote writes: > > Updated patches attached. > > I looked through these and committed 0001+0002, with some further > comment-polishing. However, I have no faith at all in 0003. Thanks for the review. > It is > blithely digging through

Re: d25ea01275 and partitionwise join

2020-04-03 Thread Tom Lane
Amit Langote writes: > Updated patches attached. I looked through these and committed 0001+0002, with some further comment-polishing. However, I have no faith at all in 0003. It is blithely digging through COALESCE expressions with no concern for whether they came from full joins or not, or

Re: d25ea01275 and partitionwise join

2020-03-01 Thread Amit Langote
On Sat, Feb 29, 2020 at 8:18 AM Tom Lane wrote: > Amit Langote writes: > > On Wed, Nov 6, 2019 at 2:00 AM Tom Lane wrote: > >> Just to leave a breadcrumb in this thread --- the planner failure > >> induced by d25ea01275 has been fixed in 529ebb20a. The difficulty > >> with multiway full joins

Re: d25ea01275 and partitionwise join

2020-02-28 Thread Tom Lane
Amit Langote writes: > On Wed, Nov 6, 2019 at 2:00 AM Tom Lane wrote: >> Just to leave a breadcrumb in this thread --- the planner failure >> induced by d25ea01275 has been fixed in 529ebb20a. The difficulty >> with multiway full joins that Amit started this thread with remains >> open, but I

Re: d25ea01275 and partitionwise join

2019-11-06 Thread Amit Langote
On Wed, Nov 6, 2019 at 2:00 AM Tom Lane wrote: > > Amit Langote writes: > > On Mon, Oct 14, 2019 at 5:02 AM Justin Pryzby wrote: > >> I can't say much about the patch; there's a little typo: > >> "The nullability of inner relation keys prevents them to" > >> ..should say "prevent them from". >

Re: d25ea01275 and partitionwise join

2019-11-05 Thread Tom Lane
Amit Langote writes: > On Mon, Oct 14, 2019 at 5:02 AM Justin Pryzby wrote: >> I can't say much about the patch; there's a little typo: >> "The nullability of inner relation keys prevents them to" >> ..should say "prevent them from". > Thanks, will fix. Just to leave a breadcrumb in this

Re: d25ea01275 and partitionwise join

2019-10-22 Thread Amit Langote
Hi Justin, On Mon, Oct 14, 2019 at 5:02 AM Justin Pryzby wrote: > > On Thu, Sep 19, 2019 at 05:15:37PM +0900, Amit Langote wrote: > > Please find attached updated patches. > > Tom pointed me to this thread, since we hit it in 12.0 >

Re: d25ea01275 and partitionwise join

2019-10-14 Thread Justin Pryzby
On Thu, Sep 19, 2019 at 05:15:37PM +0900, Amit Langote wrote: > Please find attached updated patches. Tom pointed me to this thread, since we hit it in 12.0 https://www.postgresql.org/message-id/flat/16802.1570989962%40sss.pgh.pa.us#070f6675a11dff17760b1cfccf1c038d I can't say much about the

Re: d25ea01275 and partitionwise join

2019-10-13 Thread Justin Pryzby
On Sun, Oct 13, 2019 at 03:02:17PM -0500, Justin Pryzby wrote: > On Thu, Sep 19, 2019 at 05:15:37PM +0900, Amit Langote wrote: > > Please find attached updated patches. > > Tom pointed me to this thread, since we hit it in 12.0 >

Re: d25ea01275 and partitionwise join

2019-09-20 Thread Richard Guo
On Thu, Sep 19, 2019 at 4:15 PM Amit Langote wrote: > Hi Richard, > > Thanks a lot for taking a close look at the patch and sorry about the > delay. > > On Wed, Sep 4, 2019 at 5:29 PM Richard Guo wrote: > >> On Wed, Sep 4, 2019 at 10:01 AM Amit Langote > wrote: > > I'm reviewing v2-0002 and I

Re: d25ea01275 and partitionwise join

2019-09-06 Thread Amit Langote
Hello Richard, On Wed, Sep 4, 2019 at 4:30 PM Richard Guo wrote: > > Hi Amit, > > On Wed, Sep 4, 2019 at 10:01 AM Amit Langote wrote: >> >> Fujita-san, >> >> To avoid losing track of this, I've added this to November CF. >> >> https://commitfest.postgresql.org/25/2278/ >> >> I know there is one

Re: d25ea01275 and partitionwise join

2019-09-04 Thread Richard Guo
Hi Amit, On Wed, Sep 4, 2019 at 3:30 PM Richard Guo wrote: > Hi Amit, > > On Wed, Sep 4, 2019 at 10:01 AM Amit Langote > wrote: > >> Fujita-san, >> >> To avoid losing track of this, I've added this to November CF. >> >> https://commitfest.postgresql.org/25/2278/ >> >> I know there is one more

Re: d25ea01275 and partitionwise join

2019-09-04 Thread Richard Guo
Hi Amit, On Wed, Sep 4, 2019 at 10:01 AM Amit Langote wrote: > Fujita-san, > > To avoid losing track of this, I've added this to November CF. > > https://commitfest.postgresql.org/25/2278/ > > I know there is one more patch beside the partitionwise join fix, but > I've set the title to suggest

Re: d25ea01275 and partitionwise join

2019-09-03 Thread Amit Langote
Fujita-san, On Thu, Jul 18, 2019 at 8:10 PM Etsuro Fujita wrote: > > On Thu, Jul 18, 2019 at 11:18 AM Amit Langote wrote: > > On Tue, Jul 16, 2019 at 8:22 PM Etsuro Fujita > > wrote: > > > On Tue, Jul 2, 2019 at 6:29 PM Amit Langote > > > wrote: > > > > 0001 - fix partitionwise join to work

Re: d25ea01275 and partitionwise join

2019-07-18 Thread Etsuro Fujita
On Thu, Jul 18, 2019 at 11:18 AM Amit Langote wrote: > On Tue, Jul 16, 2019 at 8:22 PM Etsuro Fujita wrote: > > On Tue, Jul 2, 2019 at 6:29 PM Amit Langote wrote: > > > 0001 - fix partitionwise join to work correctly with n-way joins of > > > which some are full joins (+ cosmetic improvements

Re: d25ea01275 and partitionwise join

2019-07-17 Thread Amit Langote
Fujita-san, Thanks for looking at this. On Tue, Jul 16, 2019 at 8:22 PM Etsuro Fujita wrote: > > On Tue, Jul 2, 2019 at 6:29 PM Amit Langote wrote: > > 0001 - fix partitionwise join to work correctly with n-way joins of > > which some are full joins (+ cosmetic improvements around the code > >

Re: d25ea01275 and partitionwise join

2019-07-16 Thread Etsuro Fujita
On Tue, Jul 2, 2019 at 6:29 PM Amit Langote wrote: > 0001 - fix partitionwise join to work correctly with n-way joins of > which some are full joins (+ cosmetic improvements around the code > that was touched) Here are my comments about the cosmetic improvements: they seem pretty large to me, so