make Gather node projection-capable

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: make Gather node projection-capable
Date: 2015-10-22 17:24:32
Message-ID: CA+TgmobQnvm34ZSmZdQVGVS7uizpVHrb3TCHYoutuhu-gJWyJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The Gather node, as currently committed, is neither projection-capable
nor listed as an exception in is_projection_capable_plan. Amit
discovered this in testing, and I hit it in my testing as well. We
could just mark it as being not projection-capable, but I think it
might be better to go the other way and give it projection
capabilities. Otherwise, we're going to start generating lots of
plans like this:

Result
-> Gather
-> Partial Seq Scan

While that's not the end of the world, it seems to needlessly fly in
the face of the general principle that nodes should generally try to
support projection. So attached is a patch to make Gather
projection-capable (gather-project.patch). It has a slight dependency
on my patch to fix up the tqueue machinery for record types, so I've
attached that patch here as well (tqueue-record-types.patch).

Comments? Reviews?

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

Attachment Content-Type Size
tqueue-record-types.patch application/x-patch 19.9 KB
gather-project.patch application/x-patch 6.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-10-22 17:25:52 Re: clearing opfuncid vs. parallel query
Previous Message YUriy Zhuravlev 2015-10-22 17:19:41 Re: clearing opfuncid vs. parallel query