Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf97aebd

Browse files
committed
Revise TupleTableSlot code to avoid unnecessary construction and disassembly
of tuples when passing data up through multiple plan nodes. A slot can nowhold either a normal "physical" HeapTuple, or a "virtual" tuple consistingof Datum/isnull arrays. Upper plan levels can usually just copy the Datumarrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()calls to extract the data again. This work extends Atsushi Ogawa's earlierpatch, which provided the key idea of adding Datum arrays to TupleTableSlots.(I believe however that something like this was foreseen way back in Berkeleydays --- see the old comment on ExecProject.) A test case involving manylevels of join of fairly wide tables (about 80 columns altogether) showedabout 3x overall speedup, though simple queries will probably not behelped very much.I have also duplicated some code in heaptuple.c in order to provide versionsof heap_formtuple and friends that use "bool" arrays to indicate nullattributes, instead of the old convention of "char" arrays containing either'n' or ' '. This provides a better match to the convention used byExecEvalExpr. While I have not made a concerted effort to get rid of usesof the old routines, I think they should be deprecated and eventually removed.
1 parent712f053 commitf97aebd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1764
-932
lines changed

‎doc/src/sgml/xfunc.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.100 2005/03/12 20:25:06 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.101 2005/03/16 21:38:04 tgl Exp $
33
-->
44

55
<sect1 id="xfunc">
@@ -2219,7 +2219,7 @@ CREATE FUNCTION c_overpaid(emp, integer) RETURNS boolean
22192219
case, you first need to obtain or construct a <structname>TupleDesc</>
22202220
descriptor for the tuple structure. When working with Datums, you
22212221
pass the <structname>TupleDesc</> to <function>BlessTupleDesc</>,
2222-
and then call <function>heap_formtuple</> for each row. When working
2222+
and then call <function>heap_form_tuple</> for each row. When working
22232223
with C strings, you pass the <structname>TupleDesc</> to
22242224
<function>TupleDescGetAttInMetadata</>, and then call
22252225
<function>BuildTupleFromCStrings</> for each row. In the case of a
@@ -2264,7 +2264,7 @@ AttInMetadata *TupleDescGetAttInMetadata(TupleDesc tupdesc)
22642264
<para>
22652265
When working with Datums, use
22662266
<programlisting>
2267-
HeapTupleheap_formtuple(TupleDesc tupdesc, Datum *values,char *nulls)
2267+
HeapTupleheap_form_tuple(TupleDesc tupdesc, Datum *values,bool *isnull)
22682268
</programlisting>
22692269
to build a <structname>HeapTuple</> given user data in Datum form.
22702270
</para>
@@ -2383,7 +2383,7 @@ typedef struct
23832383
*
23842384
* tuple_desc is for use when returning tuples (i.e. composite data types)
23852385
* and is only needed if you are going to build the tuples with
2386-
*heap_formtuple() rather than with BuildTupleFromCStrings(). Note that
2386+
*heap_form_tuple() rather than with BuildTupleFromCStrings(). Note that
23872387
* the TupleDesc pointer stored here should usually have been run through
23882388
* BlessTupleDesc() first.
23892389
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp