@@ -14,13 +14,13 @@ ____________________________________________________________________________-->
14
14
<!--==========================orignal english content==========================
15
15
<para>
16
16
This chapter originated as part of
17
- <xref linkend="SIM98" >, Stefan Simkovics'
17
+ <xref linkend="sim98"/ >, Stefan Simkovics'
18
18
Master's Thesis prepared at Vienna University of Technology under the direction
19
19
of O.Univ.Prof.Dr. Georg Gottlob and Univ.Ass. Mag. Katrin Seyr.
20
20
</para>
21
21
____________________________________________________________________________-->
22
22
<para>
23
- 这一章的内容来自于<xref linkend="SIM98 "/>的一部分,它是Stefan Simkovics在维也纳技术大学的硕士学位论文,指导人是 Georg Gottlob教授和Mag. Katrin Seyr。
23
+ 这一章的内容来自于<xref linkend="sim98 "/>的一部分,它是Stefan Simkovics在维也纳技术大学的硕士学位论文,指导人是 Georg Gottlob教授和Mag. Katrin Seyr。
24
24
</para>
25
25
</note>
26
26
@@ -186,7 +186,7 @@ ____________________________________________________________________________-->
186
186
<!--==========================orignal english content==========================
187
187
<para>
188
188
<productname>PostgreSQL</productname> is implemented using a
189
- simple <quote>process per user</> client/server model. In this model
189
+ simple <quote>process per user</quote > client/server model. In this model
190
190
there is one <firstterm>client process</firstterm> connected to
191
191
exactly one <firstterm>server process</firstterm>. As we do not
192
192
know ahead of time how many connections will be made, we have to
@@ -209,10 +209,10 @@ ____________________________________________________________________________-->
209
209
<para>
210
210
The client process can be any program that understands the
211
211
<productname>PostgreSQL</productname> protocol described in
212
- <xref linkend="protocol">. Many clients are based on the
213
- C-language library <application>libpq</>, but several independent
212
+ <xref linkend="protocol"/ >. Many clients are based on the
213
+ C-language library <application>libpq</application >, but several independent
214
214
implementations of the protocol exist, such as the Java
215
- <application>JDBC</> driver.
215
+ <application>JDBC</application > driver.
216
216
</para>
217
217
____________________________________________________________________________-->
218
218
<para>
@@ -290,8 +290,8 @@ ____________________________________________________________________________-->
290
290
text) for valid syntax. If the syntax is correct a
291
291
<firstterm>parse tree</firstterm> is built up and handed back;
292
292
otherwise an error is returned. The parser and lexer are
293
- implemented using the well-known Unix tools <application>bison</>
294
- and <application>flex</>.
293
+ implemented using the well-known Unix tools <application>bison</application >
294
+ and <application>flex</application >.
295
295
</para>
296
296
____________________________________________________________________________-->
297
297
<para>
@@ -391,7 +391,7 @@ ____________________________________________________________________________-->
391
391
back by the parser as input and does the semantic interpretation needed
392
392
to understand which tables, functions, and operators are referenced by
393
393
the query. The data structure that is built to represent this
394
- information is called the <firstterm>query tree</>.
394
+ information is called the <firstterm>query tree</firstterm >.
395
395
</para>
396
396
____________________________________________________________________________-->
397
397
<para>
@@ -404,10 +404,10 @@ ____________________________________________________________________________-->
404
404
system catalog lookups can only be done within a transaction, and we
405
405
do not wish to start a transaction immediately upon receiving a query
406
406
string. The raw parsing stage is sufficient to identify the transaction
407
- control commands (<command>BEGIN</>, <command>ROLLBACK</>, etc), and
407
+ control commands (<command>BEGIN</command >, <command>ROLLBACK</command >, etc), and
408
408
these can then be correctly executed without any further analysis.
409
409
Once we know that we are dealing with an actual query (such as
410
- <command>SELECT</> or <command>UPDATE</>), it is okay to
410
+ <command>SELECT</command > or <command>UPDATE</command >), it is okay to
411
411
start a transaction if we're not already in one. Only then can the
412
412
transformation process be invoked.
413
413
</para>
@@ -420,10 +420,10 @@ ____________________________________________________________________________-->
420
420
<para>
421
421
The query tree created by the transformation process is structurally
422
422
similar to the raw parse tree in most places, but it has many differences
423
- in detail. For example, a <structname>FuncCall</> node in the
423
+ in detail. For example, a <structname>FuncCall</structname > node in the
424
424
parse tree represents something that looks syntactically like a function
425
- call. This might be transformed to either a <structname>FuncExpr</>
426
- or <structname>Aggref</> node depending on whether the referenced
425
+ call. This might be transformed to either a <structname>FuncExpr</structname >
426
+ or <structname>Aggref</structname > node depending on whether the referenced
427
427
name turns out to be an ordinary function or an aggregate function.
428
428
Also, information about the actual data types of columns and expression
429
429
results is added to the query tree.
@@ -495,7 +495,7 @@ ____________________________________________________________________________-->
495
495
<!--==========================orignal english content==========================
496
496
<para>
497
497
The query rewriter is discussed in some detail in
498
- <xref linkend="rules">, so there is no need to cover it here.
498
+ <xref linkend="rules"/ >, so there is no need to cover it here.
499
499
We will only point out that both the input and the output of the
500
500
rewriter are query trees, that is, there is no change in the
501
501
representation or level of semantic detail in the trees. Rewriting
@@ -538,8 +538,8 @@ ____________________________________________________________________________-->
538
538
involving large numbers of join operations. In order to determine
539
539
a reasonable (not necessarily optimal) query plan in a reasonable amount
540
540
of time, <productname>PostgreSQL</productname> uses a <firstterm>Genetic
541
- Query Optimizer</firstterm> (see <xref linkend="geqo">) when the number of joins
542
- exceeds a threshold (see <xref linkend="guc-geqo-threshold">).
541
+ Query Optimizer</firstterm> (see <xref linkend="geqo"/ >) when the number of joins
542
+ exceeds a threshold (see <xref linkend="guc-geqo-threshold"/ >).
543
543
</para>
544
544
____________________________________________________________________________-->
545
545
<para>
@@ -550,10 +550,10 @@ ____________________________________________________________________________-->
550
550
<!--==========================orignal english content==========================
551
551
<para>
552
552
The planner's search procedure actually works with data structures
553
- called <firstterm>paths</>, which are simply cut-down representations of
553
+ called <firstterm>paths</firstterm >, which are simply cut-down representations of
554
554
plans containing only as much information as the planner needs to make
555
555
its decisions. After the cheapest path is determined, a full-fledged
556
- <firstterm>plan tree</> is built to pass to the executor. This represents
556
+ <firstterm>plan tree</firstterm > is built to pass to the executor. This represents
557
557
the desired execution plan in sufficient detail for the executor to run it.
558
558
In the rest of this section we'll ignore the distinction between paths
559
559
and plans.
@@ -582,12 +582,12 @@ ____________________________________________________________________________-->
582
582
<literal>relation.attribute OPR constant</literal>. If
583
583
<literal>relation.attribute</literal> happens to match the key of the B-tree
584
584
index and <literal>OPR</literal> is one of the operators listed in
585
- the index's <firstterm>operator class</>, another plan is created using
585
+ the index's <firstterm>operator class</firstterm >, another plan is created using
586
586
the B-tree index to scan the relation. If there are further indexes
587
587
present and the restrictions in the query happen to match a key of an
588
588
index, further plans will be considered. Index scan plans are also
589
589
generated for indexes that have a sort ordering that can match the
590
- query's <literal>ORDER BY</> clause (if any), or a sort ordering that
590
+ query's <literal>ORDER BY</literal > clause (if any), or a sort ordering that
591
591
might be useful for merge joining (see below).
592
592
</para>
593
593
____________________________________________________________________________-->
@@ -677,7 +677,7 @@ ____________________________________________________________________________-->
677
677
678
678
<!--==========================orignal english content==========================
679
679
<para>
680
- If the query uses fewer than <xref linkend="guc-geqo-threshold">
680
+ If the query uses fewer than <xref linkend="guc-geqo-threshold"/ >
681
681
relations, a near-exhaustive search is conducted to find the best
682
682
join sequence. The planner preferentially considers joins between any
683
683
two relations for which there exist a corresponding join clause in the
@@ -698,7 +698,7 @@ ____________________________________________________________________________-->
698
698
<para>
699
699
When <varname>geqo_threshold</varname> is exceeded, the join
700
700
sequences considered are determined by heuristics, as described
701
- in <xref linkend="geqo">. Otherwise the process is the same.
701
+ in <xref linkend="geqo"/ >. Otherwise the process is the same.
702
702
</para>
703
703
____________________________________________________________________________-->
704
704
<para>
@@ -711,9 +711,9 @@ ____________________________________________________________________________-->
711
711
the base relations, plus nested-loop, merge, or hash join nodes as
712
712
needed, plus any auxiliary steps needed, such as sort nodes or
713
713
aggregate-function calculation nodes. Most of these plan node
714
- types have the additional ability to do <firstterm>selection</>
714
+ types have the additional ability to do <firstterm>selection</firstterm >
715
715
(discarding rows that do not meet a specified Boolean condition)
716
- and <firstterm>projection</> (computation of a derived column set
716
+ and <firstterm>projection</firstterm > (computation of a derived column set
717
717
based on given column values, that is, evaluation of scalar
718
718
expressions where needed). One of the responsibilities of the
719
719
planner is to attach selection conditions from the
@@ -758,7 +758,7 @@ ____________________________________________________________________________-->
758
758
subplan) is, let's say, a
759
759
<literal>Sort</literal> node and again recursion is needed to obtain
760
760
an input row. The child node of the <literal>Sort</literal> might
761
- be a <literal>SeqScan</> node, representing actual reading of a table.
761
+ be a <literal>SeqScan</literal > node, representing actual reading of a table.
762
762
Execution of this node causes the executor to fetch a row from the
763
763
table and return it up to the calling node. The <literal>Sort</literal>
764
764
node will repeatedly call its child to obtain all the rows to be sorted.
@@ -806,24 +806,24 @@ ____________________________________________________________________________-->
806
806
<!--==========================orignal english content==========================
807
807
<para>
808
808
The executor mechanism is used to evaluate all four basic SQL query types:
809
- <command>SELECT</>, <command>INSERT</>, <command>UPDATE</>, and
810
- <command>DELETE</>. For <command>SELECT</>, the top-level executor
809
+ <command>SELECT</command >, <command>INSERT</command >, <command>UPDATE</command >, and
810
+ <command>DELETE</command >. For <command>SELECT</command >, the top-level executor
811
811
code only needs to send each row returned by the query plan tree off
812
- to the client. For <command>INSERT</>, each returned row is inserted
813
- into the target table specified for the <command>INSERT</>. This is
814
- done in a special top-level plan node called <literal>ModifyTable</>.
812
+ to the client. For <command>INSERT</command >, each returned row is inserted
813
+ into the target table specified for the <command>INSERT</command >. This is
814
+ done in a special top-level plan node called <literal>ModifyTable</literal >.
815
815
(A simple
816
- <command>INSERT ... VALUES</> command creates a trivial plan tree
817
- consisting of a single <literal>Result</> node, which computes just one
818
- result row, and <literal>ModifyTable</> above it to perform the insertion.
819
- But <command>INSERT ... SELECT</> can demand the full power
820
- of the executor mechanism.) For <command>UPDATE</>, the planner arranges
816
+ <command>INSERT ... VALUES</command > command creates a trivial plan tree
817
+ consisting of a single <literal>Result</literal > node, which computes just one
818
+ result row, and <literal>ModifyTable</literal > above it to perform the insertion.
819
+ But <command>INSERT ... SELECT</command > can demand the full power
820
+ of the executor mechanism.) For <command>UPDATE</command >, the planner arranges
821
821
that each computed row includes all the updated column values, plus
822
- the <firstterm>TID</> (tuple ID, or row ID) of the original target row;
823
- this data is fed into a <literal>ModifyTable</> node, which uses the
822
+ the <firstterm>TID</firstterm > (tuple ID, or row ID) of the original target row;
823
+ this data is fed into a <literal>ModifyTable</literal > node, which uses the
824
824
information to create a new updated row and mark the old row deleted.
825
- For <command>DELETE</>, the only column that is actually returned by the
826
- plan is the TID, and the <literal>ModifyTable</> node simply uses the TID
825
+ For <command>DELETE</command >, the only column that is actually returned by the
826
+ plan is the TID, and the <literal>ModifyTable</literal > node simply uses the TID
827
827
to visit each target row and mark it deleted.
828
828
</para>
829
829
____________________________________________________________________________-->
0 commit comments