@@ -32,35 +32,35 @@ <H2 ALIGN=CENTER>
32
32
< A HREF ="../../include/nodes/parsenodes.h "> Query</ A > structure that
33
33
contains all the elements used by complex queries. Query.qual holds the
34
34
WHERE clause qualification, which is filled in by
35
-
36
35
< 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 ">
41
40
makeRangeTable().</ A > Query.rtable holds the queries range table.
42
41
< P >
43
42
Certain queries, like SELECT, return columns of data. Other queries,
44
43
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
46
45
HREF ="../../include/nodes/primnodes.h "> Resdom</ A > entries, which are
47
46
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
49
48
< A HREF ="../../backend/parser/parse_target.c "> transformTargetList().</ A >
50
49
< P >
51
50
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.
53
52
< P >
54
53
The next step is for the Query to be modified by any VIEWS or RULES that
55
54
may apply to the query. This is performed by the < A
56
55
HREF ="../../backend/rewrite "> rewrite</ A > system.
57
56
< 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
64
64
usage.
65
65
< P >
66
66
The Plan is then passed to the < A
@@ -76,21 +76,27 @@ <H2 ALIGN=CENTER>
76
76
< LI > ShmemIndex - contains an index of all other shared memory
77
77
structures, allowing quick lookup of other structure locations in shared
78
78
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
81
84
< LI > Shared Buf Lookup Table - lookup to see if a requested buffer
82
85
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
84
88
backends holding or waiting on lock
85
89
< LI > LockTable (lock hash) - lookup of LockTable structures using
86
90
table name
87
91
< LI > LockTable (xid hash) - lookup of LockTable structures using
88
92
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
91
95
</ 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 >
94
100
< HR >
95
101
< CENTER >
96
102
< EM > < BIG >
0 commit comments