|
27 | 27 | <title>The Path of a Query</title>
|
28 | 28 |
|
29 | 29 | <para>
|
30 |
| - Here we give a short overview of the stages a query has to pass |
| 30 | + Here we give a short overview of the stages a query has to pass |
31 | 31 | to obtain a result.
|
32 | 32 | </para>
|
33 | 33 |
|
|
114 | 114 | <title>How Connections Are Established</title>
|
115 | 115 |
|
116 | 116 | <para>
|
117 |
| - <productname>PostgreSQL</productname> is implemented using a |
118 |
| - simple <quote>process per user</quote> client/server model. In this model |
119 |
| - there is one <firstterm>client process</firstterm> connected to |
120 |
| - exactly one <firstterm>server process</firstterm>. As we do not |
121 |
| - know ahead of time how many connections will be made, we have to |
122 |
| - use a <firstterm>supervisor process</firstterm> (also |
123 |
| - <firstterm>master process</firstterm>) that spawns a new |
124 |
| - server process every time a connection is requested. This supervisor |
125 |
| - process is called <literal>postmaster</literal> and listens at a |
126 |
| - specified TCP/IP port for incoming connections. Whenever a request |
127 |
| - for a connection is detected the <literal>postmaster</literal> |
128 |
| - process spawns a new server process. The server processes |
129 |
| - communicate with each other using <firstterm>semaphores</firstterm> and |
130 |
| - <firstterm>shared memory</firstterm> to ensure data integrity |
131 |
| - throughout concurrent data access. |
| 117 | + <productname>PostgreSQL</productname> implements a |
| 118 | + <quote>process per user</quote> client/server model. |
| 119 | + In this model, every |
| 120 | + <glossterm linkend="glossary-client">client process</glossterm> |
| 121 | + connects to exactly one |
| 122 | + <glossterm linkend="glossary-backend">backend process</glossterm>. |
| 123 | + As we do not know ahead of time how many connections will be made, |
| 124 | + we have to use a <quote>supervisor process</quote> that spawns a new |
| 125 | + backend process every time a connection is requested. This supervisor |
| 126 | + process is called |
| 127 | + <glossterm linkend="glossary-postmaster">postmaster</glossterm> |
| 128 | + and listens at a specified TCP/IP port for incoming connections. |
| 129 | + Whenever it detects a request for a connection, it spawns a new |
| 130 | + backend process. Those backend processes communicate with each |
| 131 | + other and with other processes of the |
| 132 | + <glossterm linkend="glossary-instance">instance</glossterm> |
| 133 | + using <firstterm>semaphores</firstterm> and |
| 134 | + <glossterm linkend="glossary-shared-memory">shared memory</glossterm> |
| 135 | + to ensure data integrity throughout concurrent data access. |
132 | 136 | </para>
|
133 | 137 |
|
134 | 138 | <para>
|
|
141 | 145 | </para>
|
142 | 146 |
|
143 | 147 | <para>
|
144 |
| - Once a connection is established the client process can send a query |
145 |
| - to the <firstterm>backend</firstterm> (server). The query is transmitted using plain text, |
146 |
| - i.e., there is no parsing done in the <firstterm>frontend</firstterm> (client). The |
147 |
| - server parses the query, creates an <firstterm>execution plan</firstterm>, |
148 |
| - executes the plan and returns the retrieved rows to the client |
| 148 | + Once a connection is established, the client process can send a query |
| 149 | + to the backend process it's connected to. The query is transmitted using |
| 150 | + plain text, i.e., there is no parsing done in the client. The backend |
| 151 | + process parses the query, creates an <firstterm>execution plan</firstterm>, |
| 152 | + executes the plan, and returns the retrieved rows to the client |
149 | 153 | by transmitting them over the established connection.
|
150 | 154 | </para>
|
151 | 155 | </sect1>
|
|
0 commit comments