Skip to content

Commit 8986e60

Browse files
committed
Update flowchart and backend descriptions.
1 parent 0cba552 commit 8986e60

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

src/tools/backend/index.html

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,35 @@ <H2 ALIGN=CENTER>
3232
<A HREF="../../include/nodes/parsenodes.h">Query</A> structure that
3333
contains all the elements used by complex queries. Query.qual holds the
3434
WHERE clause qualification, which is filled in by
35-
3635
<A HREF="../../backend/parser/parse_clause.c">transformWhereClause().</A>
37-
Each table is represented by a <A HREF="../../include/nodes/parsenodes.h">
38-
RangeTableEntry,</A>
39-
and they are linked together to form the <I>range table</I> for the
40-
query, and is generated by <A HREF="../../backend/parser/parse_clause.c">
36+
Each table referenced in the query is represented by a <A
37+
HREF="../../include/nodes/parsenodes.h"> RangeTableEntry,</A> and they
38+
are linked together to form the <I>range table</I> of the query, which is
39+
generated by <A HREF="../../backend/parser/parse_clause.c">
4140
makeRangeTable().</A> Query.rtable holds the queries range table.
4241
<P>
4342
Certain queries, like SELECT, return columns of data. Other queries,
4443
like INSERT and UPDATE, specify the columns modified by the query.
45-
These columns references are converted to <A
44+
These column references are converted to <A
4645
HREF="../../include/nodes/primnodes.h"> Resdom</A> entries, which are
4746
linked together to make up the <I>target list</I> of the query. The
48-
target list is stored in Query.targetList, and is generated by
47+
target list is stored in Query.targetList, which is generated by
4948
<A HREF="../../backend/parser/parse_target.c">transformTargetList().</A>
5049
<P>
5150
Other query elements, like aggregates(SUM()), GROUP BY, ORDER BY are
52-
also stored in their own fields.
51+
also stored in their own Query fields.
5352
<P>
5453
The next step is for the Query to be modified by any VIEWS or RULES that
5554
may apply to the query. This is performed by the <A
5655
HREF="../../backend/rewrite">rewrite</A> system.
5756
<P>
58-
The optimizer takes the Query structure, and generates an optimal
59-
<A HREF="../..//include/nodes/plannodes.h">Plan</A> containing primitive
60-
operations to be performed by the executor to complete the query. The
61-
<A HREF="../../backend/optimizer/path">path</A> module
62-
determines the table join order and join type of each of the tables in
63-
the RangeTable, using Query.qual(WHERE clause) to consider optimal index
57+
The <A HREF="../../backend/optimizer">optimizer</A> takes the Query
58+
structure, and generates an optimal
59+
<A HREF="../..//include/nodes/plannodes.h">Plan</A> containing the
60+
primitive operations to be performed by the executor to execute the
61+
query. The <A HREF="../../backend/optimizer/path">path</A> module
62+
determines the best table join order and join type of each table in the
63+
RangeTable, using Query.qual(WHERE clause) to consider optimal index
6464
usage.
6565
<P>
6666
The Plan is then passed to the <A
@@ -76,21 +76,27 @@ <H2 ALIGN=CENTER>
7676
<LI>ShmemIndex - contains an index of all other shared memory
7777
structures, allowing quick lookup of other structure locations in shared
7878
memory
79-
<LI>Buffer Descriptors - control header for shared memory buffer block
80-
<LI>Buffer Blocks - block of table/index data shared by all backends
79+
<LI><A HREF="../../include/storage/buf_internals.h">Buffer
80+
Descriptors</A> - control header for shared memory buffer block
81+
82+
<LI><A HREF="../../include/storage/buf_internals.h">Buffer Blocks</A>
83+
- block of table/index data shared by all backends
8184
<LI>Shared Buf Lookup Table - lookup to see if a requested buffer
8285
is already in the shared memory area
83-
<LI>LockTable - lock table structure, specifiying table, lock types, and
86+
<LI><A HREF="../../include/storage/lock.h">LockTable</A>
87+
- lock table structure, specifiying table, lock types, and
8488
backends holding or waiting on lock
8589
<LI>LockTable (lock hash) - lookup of LockTable structures using
8690
table name
8791
<LI>LockTable (xid hash) - lookup of LockTable structures using
8892
transaction id
89-
<LI>Proc Header - information about each backend, including locks held/waiting,
90-
indexed by process id
93+
<LI><A HREF="../../include/storage/proc.h">Proc Header</A> - information
94+
about each backend, including locks held/waiting, indexed by process id
9195
</UL>
92-
Each structure is created by calling <A
93-
HREF="../../backend/storage/ipc/shmem.c"> ShmemInitStruct().</A>
96+
Each data structure is created by calling <A
97+
HREF="../../backend/storage/ipc/shmem.c"> ShmemInitStruct(),</A> and
98+
the lookup hashes are created by
99+
<A HREF="../../backend/storage/ipc/shmem.c">ShmemInitHash().</A>
94100
<HR>
95101
<CENTER>
96102
<EM><BIG>

0 commit comments

Comments
 (0)