Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 34d5957

Browse files
committed
update
1 parent 2584029 commit 34d5957

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

src/tools/backend/index.html

+25-22
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<HTML>
22
<HEAD>
3-
<TITLE>PostgreSQL Backend Flowchart</TITLE>
3+
<TITLE>How PostgreSQL Processes a Query</TITLE>
44
</HEAD>
55
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#A00000" ALINK="#0000FF">
66
<H1 ALIGN=CENTER>
7-
PostgreSQL Backend Flowchart
7+
How PostgreSQL Processes a Query
88
</H1>
99
<H2 ALIGN=CENTER>
1010
by Bruce Momjian
1111
</H2>
1212
<P>
13-
A query come into the backend via data packets coming in through TCP/IP
14-
and Unix Domain sockets. It is loaded into a string, and passed to
13+
A query comes to the backend via data packets arriving through TCP/IP
14+
or Unix Domain sockets. It is loaded into a string, and passed to
1515
the
1616
<A HREF="../../backend/parser">parser,</A> where the lexical scanner,
1717
<A HREF="../../backend/parser/scan.l">scan.l,</A>
1818
breaks the query up into tokens(words). The parser
1919
uses
2020
<A HREF="../../backend/parser/gram.y">gram.y</A> and the tokens to
21-
identify the query type, and load the proper query-specific
22-
structure, like
23-
<A HREF="../../include/nodes/parsenodes.h">CreateStmt or SelectStmt.</A>
21+
identify the query type, and load the proper query-specific structure,
22+
like <A HREF="../../include/nodes/parsenodes.h">CreateStmt</A> or <A
23+
HREF="../../include/nodes/parsenodes.h">SelectStmt.</A>
2424
<P>
25-
The query is then identified as a <I>Utility</I> function or a more
26-
complex query. A <I>Utility</I> query is processed by a
27-
query-specific function in <A HREF="../../backend/commands">
28-
commands.</A> A complex query, like <CODE>SELECT, UPDATE,</CODE> and
25+
The query is then identified as a <I>Utility</I> query or a more complex
26+
query. A <I>Utility</I> query is processed by a query-specific function
27+
in <A HREF="../../backend/commands"> commands.</A> A complex query, like
28+
<CODE>SELECT, UPDATE,</CODE> and
2929
<CODE>DELETE</CODE> requires much more handling.
3030
<P>
3131
The parser takes a complex query, and creates a
@@ -37,7 +37,7 @@ <H2 ALIGN=CENTER>
3737
HREF="../../include/nodes/parsenodes.h"> RangeTableEntry,</A> and they
3838
are linked together to form the <I>range table</I> of the query, which is
3939
generated by <A HREF="../../backend/parser/parse_clause.c">
40-
makeRangeTable().</A> Query.rtable holds the queries range table.
40+
makeRangeTable().</A> Query.rtable holds the query's range table.
4141
<P>
4242
Certain queries, like <CODE>SELECT,</CODE> return columns of data. Other
4343
queries, like <CODE>INSERT</CODE> and <CODE>UPDATE,</CODE> specify the columns
@@ -48,7 +48,7 @@ <H2 ALIGN=CENTER>
4848
<A HREF="../../backend/parser/parse_target.c">transformTargetList().</A>
4949
<P>
5050
Other query elements, like aggregates(<CODE>SUM()</CODE>), <CODE>GROUP BY,</CODE>
51-
<CODE>ORDER BY</CODE> are also stored in their own Query fields.
51+
and <CODE>ORDER BY</CODE> are also stored in their own Query fields.
5252
<P>
5353
The next step is for the Query to be modified by any <CODE>VIEWS</CODE> or
5454
<CODE>RULES</CODE> that may apply to the query. This is performed by the <A
@@ -69,21 +69,22 @@ <H2 ALIGN=CENTER>
6969
There are many other modules that support this basic functionality.
7070
They can be accessed by clicking on the flowchart.
7171
<P>
72-
Another area of interest is the shared memory area, containing table
73-
data/index blocks, locks, backend information, and lookup tables for
74-
these structures:
72+
Another area of interest is the shared memory area, which contains data
73+
accessable to all backends. It has table recently used data/index
74+
blocks, locks, backend information, and lookup tables for these
75+
structures:
7576
<UL>
7677
<LI>ShmemIndex - lookup shared memory addresses using structure names
7778
<LI><A HREF="../../include/storage/buf_internals.h">Buffer
78-
Descriptors</A> - control header for buffer cache block
79-
<LI><A HREF="../../include/storage/buf_internals.h">Buffer Blocks</A> -
79+
Descriptor</A> - control header for buffer cache block
80+
<LI><A HREF="../../include/storage/buf_internals.h">Buffer Block</A> -
8081
data/index buffer cache block
81-
<LI>Shared Buf Lookup Table - lookup of buffer cache block address using
82+
<LI>Shared Buffer Lookup Table - lookup of buffer cache block addresses using
8283
table name and block number(<A HREF="../../include/storage/buf_internals.h">
8384
BufferTag</A>)
84-
<LI>MultiLevelLockTable (ctl) - <A
85-
HREF="../../include/storage/lock.h">LOCKCTL</A> control structure for
86-
each locking method. Currently, only multi-level locking is used.
85+
<LI>MultiLevelLockTable (ctl) - control structure for
86+
each locking method. Currently, only multi-level locking is used(<A
87+
HREF="../../include/storage/lock.h">LOCKMETHODCTL</A>).
8788
<LI>MultiLevelLockTable (lock hash) - the <A
8889
HREF="../../include/storage/lock.h">LOCK</A> structure, looked up using
8990
relation, database object ids(<A
@@ -105,7 +106,9 @@ <H2 ALIGN=CENTER>
105106
HREF="../../backend/storage/ipc/shmem.c">ShmemInitStruct(),</A> and
106107
the lookups are created by
107108
<A HREF="../../backend/storage/ipc/shmem.c">ShmemInitHash().</A>
109+
<P>
108110
<HR>
111+
<P>
109112
<CENTER>
110113
<EM><BIG>
111114
Click on an item to see more detail or

0 commit comments

Comments
 (0)