1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 momjian Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.23 2003/11/01 01:56:28 petere Exp $
3
3
-->
4
4
5
5
<chapter id="overview">
@@ -99,11 +99,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
99
99
<para>
100
100
The executor recursively steps through
101
101
the <firstterm>plan tree</firstterm> and
102
- retrieves tuples in the way represented by the plan.
102
+ retrieves rows in the way represented by the plan.
103
103
The executor makes use of the
104
104
<firstterm>storage system</firstterm> while scanning
105
105
relations, performs <firstterm>sorts</firstterm> and <firstterm>joins</firstterm>,
106
- evaluates <firstterm>qualifications</firstterm> and finally hands back the tuples derived.
106
+ evaluates <firstterm>qualifications</firstterm> and finally hands back the rows derived.
107
107
</para>
108
108
</step>
109
109
</procedure>
@@ -150,7 +150,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
150
150
to the <firstterm>backend</firstterm> (server). The query is transmitted using plain text,
151
151
i.e. there is no parsing done in the <firstterm>frontend</firstterm> (client). The
152
152
server parses the query, creates an <firstterm>execution plan</firstterm>,
153
- executes the plan and returns the retrieved tuples to the client
153
+ executes the plan and returns the retrieved rows to the client
154
154
by transmitting them over the established connection.
155
155
</para>
156
156
</sect1>
@@ -195,8 +195,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
195
195
The <firstterm>lexer</firstterm> is defined in the file
196
196
<filename>scan.l</filename> and is responsible
197
197
for recognizing <firstterm>identifiers</firstterm>,
198
- the <firstterm>SQL keywords </firstterm> etc. For
199
- every keyword or identifier that is found, a <firstterm>token</firstterm>
198
+ the <firstterm>SQL key words </firstterm> etc. For
199
+ every key word or identifier that is found, a <firstterm>token</firstterm>
200
200
is generated and handed to the parser.
201
201
</para>
202
202
@@ -278,7 +278,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
278
278
call. This may be transformed to either a <structname>FuncExpr</>
279
279
or <structname>Aggref</> node depending on whether the referenced
280
280
name turns out to be an ordinary function or an aggregate function.
281
- Also, information about the actual datatypes of columns and expression
281
+ Also, information about the actual data types of columns and expression
282
282
results is added to the query tree.
283
283
</para>
284
284
</sect2>
@@ -297,9 +297,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
297
297
<itemizedlist>
298
298
<listitem>
299
299
<para>
300
- The first one worked using <firstterm>tuple level</firstterm> processing and was
300
+ The first one worked using <firstterm>row level</firstterm> processing and was
301
301
implemented deep in the <firstterm>executor</firstterm>. The rule system was
302
- called whenever an individual tuple had been accessed. This
302
+ called whenever an individual row had been accessed. This
303
303
implementation was removed in 1995 when the last official release
304
304
of the <productname>Berkeley Postgres</productname> project was
305
305
transformed into <productname>Postgres95</productname>.
@@ -396,11 +396,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
396
396
<listitem>
397
397
<para>
398
398
<firstterm>nested loop join</firstterm>: The right relation is scanned
399
- once for every tuple found in the left relation. This strategy
399
+ once for every row found in the left relation. This strategy
400
400
is easy to implement but can be very time consuming. (However,
401
- if the right relation can be scanned with an indexscan , this can
401
+ if the right relation can be scanned with an index scan , this can
402
402
be a good strategy. It is possible to use values from the current
403
- row of the left relation as keys for the indexscan of the right.)
403
+ row of the left relation as keys for the index scan of the right.)
404
404
</para>
405
405
</listitem>
406
406
@@ -419,16 +419,16 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
419
419
<firstterm>hash join</firstterm>: the right relation is first scanned
420
420
and loaded into a hash table, using its join attributes as hash keys.
421
421
Next the left relation is scanned and the
422
- appropriate values of every tuple found are used as hash keys to
423
- locate the matching tuples in the table.
422
+ appropriate values of every row found are used as hash keys to
423
+ locate the matching rows in the table.
424
424
</para>
425
425
</listitem>
426
426
</itemizedlist>
427
427
</para>
428
428
429
429
<para>
430
430
The finished plan tree consists of sequential or index scans of
431
- the base relations, plus nestloop , merge, or hash join nodes as
431
+ the base relations, plus nested-loop , merge, or hash join nodes as
432
432
needed, plus any auxiliary steps needed, such as sort nodes or
433
433
aggregate-function calculation nodes. Most of these plan node
434
434
types have the additional ability to do <firstterm>selection</>
@@ -451,26 +451,26 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
451
451
The <firstterm>executor</firstterm> takes the plan handed back by the
452
452
planner/optimizer and recursively processes it to extract the required set
453
453
of rows. This is essentially a demand-pull pipeline mechanism.
454
- Each time a plan node is called, it must deliver one more tuple , or
455
- report that it is done delivering tuples .
454
+ Each time a plan node is called, it must deliver one more row , or
455
+ report that it is done delivering rows .
456
456
</para>
457
457
458
458
<para>
459
459
To provide a concrete example, assume that the top
460
460
node is a <literal>MergeJoin</literal> node.
461
- Before any merge can be done two tuples have to be fetched (one from
461
+ Before any merge can be done two rows have to be fetched (one from
462
462
each subplan). So the executor recursively calls itself to
463
463
process the subplans (it starts with the subplan attached to
464
464
<literal>lefttree</literal>). The new top node (the top node of the left
465
465
subplan) is, let's say, a
466
466
<literal>Sort</literal> node and again recursion is needed to obtain
467
- an input tuple . The child node of the <literal>Sort</literal> might
467
+ an input row . The child node of the <literal>Sort</literal> might
468
468
be a <literal>SeqScan</> node, representing actual reading of a table.
469
469
Execution of this node causes the executor to fetch a row from the
470
470
table and return it up to the calling node. The <literal>Sort</literal>
471
471
node will repeatedly call its child to obtain all the rows to be sorted.
472
472
When the input is exhausted (as indicated by the child node returning
473
- a NULL instead of a tuple ), the <literal>Sort</literal> code performs
473
+ a NULL instead of a row ), the <literal>Sort</literal> code performs
474
474
the sort, and finally is able to return its first output row, namely
475
475
the first one in sorted order. It keeps the remaining rows stored so
476
476
that it can deliver them in sorted order in response to later demands.
@@ -508,7 +508,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/arch-dev.sgml,v 2.22 2003/09/29 18:18:35 mo
508
508
result row. But <command>INSERT ... SELECT</> may demand the full power
509
509
of the executor mechanism.) For <command>UPDATE</>, the planner arranges
510
510
that each computed row includes all the updated column values, plus
511
- the <firstterm>TID</> (tuple ID, or location ) of the original target row;
511
+ the <firstterm>TID</> (tuple ID, or row ID ) of the original target row;
512
512
the executor top level uses this information to create a new updated row
513
513
and mark the old row deleted. For <command>DELETE</>, the only column
514
514
that is actually returned by the plan is the TID, and the executor top
0 commit comments