Lists: | pgsql-patches |
---|
From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | pgsql-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Avoid needless copy in nodeMaterial |
Date: | 2007-10-16 04:05:23 |
Message-ID: | 1192507523.6133.21.camel@goldbach |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 베이SQL |
Attached is a patch that avoids a needless copy of the result tuple in
nodeMaterial, in the case that we don't have a previously-materialized
tuple to return. We can just return the TTS produced by executing our
child node, rather than returning a copy of it.
I didn't bother pulling the MinimalTuple out of "outerslot" and stuffing
it back into the nodeMaterial's result slot, as AFAICS that is not
necessary. Although I suppose you could make a cleanliness argument that
that would be worth doing instead.
(This is 8.4 material...)
-Neil
Attachment | Content-Type | Size |
---|---|---|
material_copy_tweak-1.patch | text/x-patch | 1.8 KB |
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Neil Conway <neilc(at)samurai(dot)com> |
Cc: | pgsql-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Avoid needless copy in nodeMaterial |
Date: | 2007-10-16 04:34:12 |
Message-ID: | 3744.1192509252@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
Neil Conway <neilc(at)samurai(dot)com> writes:
> Attached is a patch that avoids a needless copy of the result tuple in
> nodeMaterial, in the case that we don't have a previously-materialized
> tuple to return.
Seems like this needs more comments about what's happening, rather
than less ...
Also, it looks to me like the plan node's own resultslot might never be
assigned to at all, when the subplan returns zero rows. Does this
corner case still work correctly?
regards, tom lane
From: | Neil Conway <neilc(at)samurai(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Avoid needless copy in nodeMaterial |
Date: | 2007-10-16 04:55:35 |
Message-ID: | 1192510535.6133.28.camel@goldbach |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-patches |
On Tue, 2007-10-16 at 00:34 -0400, Tom Lane wrote:
> Seems like this needs more comments about what's happening, rather
> than less ...
Fair point.
> Also, it looks to me like the plan node's own resultslot might never be
> assigned to at all, when the subplan returns zero rows. Does this
> corner case still work correctly?
ISTM the node's own result slot wouldn't be assigned to in this case
regardless: (nodeMaterial.c, circa 116)
outerslot = ExecProcNode(outerNode);
if (TupIsNull(outerslot))
{
node->eof_underlying = true;
return NULL;
}
There's no requirement that we must assign to the result slot, AFAICS.
-Neil
From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Neil Conway <neilc(at)samurai(dot)com> |
Cc: | pgsql-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Avoid needless copy in nodeMaterial |
Date: | 2007-11-04 22:36:48 |
Message-ID: | 200711042236.lA4MamY05599@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg롤 토토SQL : |
This has been saved for the 8.4 release:
http://momjian.postgresql.org/cgi-bin/pgpatches_hold
---------------------------------------------------------------------------
Neil Conway wrote:
> Attached is a patch that avoids a needless copy of the result tuple in
> nodeMaterial, in the case that we don't have a previously-materialized
> tuple to return. We can just return the TTS produced by executing our
> child node, rather than returning a copy of it.
>
> I didn't bother pulling the MinimalTuple out of "outerslot" and stuffing
> it back into the nodeMaterial's result slot, as AFAICS that is not
> necessary. Although I suppose you could make a cleanliness argument that
> that would be worth doing instead.
>
> (This is 8.4 material...)
>
> -Neil
>
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +