Re: Parameterization of partial path

From: Antonin Houska <ah(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Parameterization of partial path
Date: 2017-02-10 14:00:01
Message-ID: 1296.1486735201@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Feb 9, 2017 at 12:36 PM, Antonin Houska <ah(at)cybertec(dot)at> wrote:
> > When looking at try_partial_hashjoin_path and try_partial_nestloop_path
> > functions I'm failing to understand the comment "Parameterized partial paths
> > are not supported.".
> >
> > It's clear to me that GatherPath can't have parameters because repeated
> > execution of parallel plan with adjusted parameters is not supported.
>
> Actually, I think in theory that is fine. You'd start up and shut
> down workers for every execution, which is likely to stink in terms of
> performance, but it should work OK. The only problem is that it'll
> only work if you pass the values of the parameters down to the worker
> processes, which the code currently doesn't. Bind parameters sent by
> the user are passed down, but there's no provision to pass down
> parameters populated at execution time. Amit has written code for
> that, though, and it's been posted here. It just hasn't gotten into
> the tree yet for one reason or another.

ok, I also thought it's about missing implementation rather than principal
issue.

> > But the
> > fact that generic partial path has parameters should not be a problem if those
> > parameters are satisfied below the nearest GatherPath node higher in the plan
> > tree. Do I miss anything of the concept?
>
> Yes, I think you're missing a key point. A parameterized path would
> normally be used for a query like small LJ (big1 IJ big2 ON big1.x =
> big2.x) ON big1.y = small.y. The plan might look like this:

Thanks for detailed explanation. I think the missing point in my thoughts was
that the only way to satisfy parameters of a relation (so that Gather does not
have to pass any parameters) is to put the relation on the inner side of a
join. However the inner side must provide the whole result set, not just part
of it, else the result is wrong.

--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de, http://www.cybertec.at

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-02-10 14:28:12 Re: removing tsearch2
Previous Message Daniel Gustafsson 2017-02-10 13:56:59 Re: removing tsearch2