From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: why not parallel seq scan for slow functions |
Date: | 2017-11-07 02:57:06 |
Message-ID: | CAA4eK1K3xVTkcQ8ozjMEJa2Roa6Djw9DMuGTry1F4ctXr2vCeg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Nov 6, 2017 at 7:05 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Nov 6, 2017 at 11:20 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> On Mon, Nov 6, 2017 at 3:51 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> This looks like it's on the right track to me. I hope Tom will look
>>> into it, but if he doesn't I may try to get it committed myself.
>>>
>>> - if (rel->reloptkind == RELOPT_BASEREL)
>>> - generate_gather_paths(root, rel);
>>> + if (rel->reloptkind == RELOPT_BASEREL &&
>>> + root->simple_rel_array_size > 2 &&
>>> + !root->append_rel_list)
>>>
>>> This test doesn't look correct to me. Actually, it doesn't look
>>> anywhere close to correct to me. So, one of us is very confused...
>>> not sure whether it's you or me.
>>>
>> It is quite possible that I haven't got it right, but it shouldn't be
>> completely bogus as it stands the regression tests and some manual
>> verification. Can you explain what is your concern about this test?
>
> Well, I suppose that test will fire for a baserel when the total
> number of baserels is at least 3 and there's no inheritance involved.
> But if there are 2 baserels, we're still not the topmost scan/join
> target.
>
No, if there are 2 baserels, then simple_rel_array_size will be 3.
The simple_rel_array_size is always the "number of relations" plus
"one". See setup_simple_rel_arrays.
> Also, even if inheritance is used, we might still be the
> topmost scan/join target.
>
Sure, but in that case, it won't generate the gather path here (due to
this part of check "!root->append_rel_list"). I am not sure whether I
have understood the second part of your question, so if my answer
appears inadequate, then can you provide more details on what you are
concerned about?
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2017-11-07 03:00:16 | Re: Parallel Plans and Cost of non-filter functions |
Previous Message | Amit Langote | 2017-11-07 02:45:11 | Re: [Sender Address Forgery]Re: path toward faster partition pruning |