Update version.
authorBruce Momjian
Mon, 20 Jul 1998 10:01:51 +0000 (10:01 +0000)
committerBruce Momjian
Mon, 20 Jul 1998 10:01:51 +0000 (10:01 +0000)
src/tools/backend/index.html

index 2fb2a096af298cdb9349cea61b31052c1bd4aefe..626517293cd2ecec56256edd26504510818a3ff4 100644 (file)
@@ -10,6 +10,7 @@ How PostgreSQL Processes a Query
 by Bruce Momjian
 
 

+
 A query comes to the backend via data packets arriving through TCP/IP
 or Unix Domain sockets.   It is loaded into a string, and passed to
 the
@@ -22,12 +23,14 @@ identify the query type, and load the proper query-specific structure,
 like CreateStmt or 
 HREF="../../include/nodes/parsenodes.h">SelectStmt.
 

+
 The query is then identified as a Utility query or a more complex
 query.  A Utility query is processed by a query-specific function
 in  commands. A complex query, like
 SELECT, UPDATE, and
 DELETE requires much more handling.
 

+
 The parser takes a complex query, and creates a
 Query structure that
 contains all the elements used by complex queries.  Query.qual holds the
@@ -39,6 +42,7 @@ are linked together to form the range table of the query, which is
 generated by 
 makeRangeTable().  Query.rtable holds the query's range table.
 

+
 Certain queries, like SELECT, return columns of data.  Other
 queries, like INSERT and UPDATE, specify the columns
 modified by the query.  These column references are converted to 
@@ -49,13 +53,16 @@ the query. The target list is stored in Query.targetList, which is
 generated by
 transformTargetList().
 

+
 Other query elements, like aggregates(SUM()), GROUP BY,
 and ORDER BY are also stored in their own Query fields.
 

+
 The next step is for the Query to be modified by any VIEWS or
 RULES that may apply to the query.  This is performed by the 
 HREF="../../backend/rewrite">rewrite system.
 

+
 The optimizer takes the Query
 structure and generates an optimal 
 HREF="../..//include/nodes/plannodes.h">Plan, which contains the
@@ -65,18 +72,21 @@ table join order and join type of each table in the RangeTable, using
 Query.qual(WHERE clause) to consider optimal index usage.
 

 
+
 The Plan is then passed to the 
 HREF="../../backend/executor">executor for execution, and the result
 returned to the client.  The Plan actually as set of nodes, arranged in
 a tree structure with a top-level node, and various sub-nodes as
 children.
-
 

+
 There are many other modules that support this basic functionality.
 They can be accessed by clicking on the flowchart.
 

+
 
 

+
 
 
 Click on an item to see more detail or look at the full
@@ -107,8 +117,10 @@ Click on an item to see more detail or look at the full
 
 
 

+
 
 

+
 Another area of interest is the shared memory area, which contains data
 accessable to all backends.  It has table recently used data/index
 blocks, locks, backend information, and lookup tables for these
@@ -147,6 +159,7 @@ HREF="../../backend/storage/ipc/shmem.c">ShmemInitStruct(), and
 the lookups are created by
 ShmemInitHash().
 

+