Re: why not parallel seq scan for slow functions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(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-05 22:21:04
Message-ID: CA+TgmoYxTU10otTP-hQ1a-VJU8ED==afW_3dSs3m_vzCT-ygSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 5, 2017 at 12:57 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> Thanks for the confirmation. Find rebased patch attached.

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.

simple_gather_path = (Path *)
create_gather_path(root, rel, cheapest_partial_path, rel->reltarget,
NULL, NULL);
+
+ /* Add projection step if needed */
+ if (target && simple_gather_path->pathtarget != target)
+ simple_gather_path = apply_projection_to_path(root, rel,
simple_gather_path, target);

Instead of using apply_projection_to_path, why not pass the correct
reltarget to create_gather_path?

+ /* Set or update cheapest_total_path and related fields */
+ set_cheapest(current_rel);

I wonder if it's really OK to call set_cheapest() a second time for
the same relation...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-11-05 22:34:23 Re: Custom compression methods
Previous Message Andres Freund 2017-11-05 21:40:15 Re: [POC] Faster processing at Gather node