Re: explain and PARAM_EXEC

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: explain and PARAM_EXEC
Date: 2010-02-20 16:50:43
Message-ID: m2eikf4zrw.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Indeed, and if I were setting out to parallelize queries in PG (which
> I am not), subplans would be the last thing I would think about. You
> could put an enormous amount of work in there and have nothing much
> to show for it, because the construct doesn't even arise in many
> queries. Even where the user wrote something that looks like a subplan,
> the planner will do its best to get rid of it by turning it into a
> join.

I guess that's because subplans do cost more than their alternative. The
idea was to provide a parallel implementation of them, so they get some
benefits, then compare better to plain join'ing.

But I can see that's an entirely wrong approach, and I'm happy to know
that and glad I asked, thanks :)

> So if you want to parallelize queries, start someplace else. The past
> discussions of this have revolved around splitting the node tree of an
> ordinary query plan into separately executable parts. Maybe a subplan
> could be one of the cut points for such an approach, but if it's the
> only one or even the main one, you're wasting your time.

Unless you arrange for the planner to have good (new) reasons to prefer
using subplans, or provide subplan based joins ?

Ok, once you've done that, maybe you're back to the main problem and
just changed its name.

Regards,
--
dim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2010-02-20 17:33:54 Re: [COMMITTERS] pgsql: Forbid setval() during recovery.
Previous Message Tom Lane 2010-02-20 16:34:50 Re: [COMMITTERS] pgsql: Forbid setval() during recovery.