@ -27,7 +27,7 @@
<title>The Path of a Query</title>
<title>The Path of a Query</title>
<para>
<para>
Here we give a short overview of the stages a query has to pass
Here we give a short overview of the stages a query has to pass
to obtain a result.
to obtain a result.
</para>
</para>
@ -114,21 +114,25 @@
<title>How Connections Are Established</title>
<title>How Connections Are Established</title>
<para>
<para>
<productname>PostgreSQL</productname> is implemented using a
<productname>PostgreSQL</productname> implements a
simple <quote>process per user</quote> client/server model. In this model
<quote>process per user</quote> client/server model.
there is one <firstterm>client process</firstterm> connected to
In this model, every
exactly one <firstterm>server process</firstterm>. As we do not
<glossterm linkend="glossary-client">client process</glossterm>
know ahead of time how many connections will be made, we have to
connects to exactly one
use a <firstterm>supervisor process</firstterm> (also
<glossterm linkend="glossary-backend">backend process</glossterm>.
<firstterm>master process</firstterm>) that spawns a new
As we do not know ahead of time how many connections will be made,
server process every time a connection is requested. This supervisor
we have to use a <quote>supervisor process</quote> that spawns a new
process is called <literal>postmaster</literal> and listens at a
backend process every time a connection is requested. This supervisor
specified TCP/IP port for incoming connections. Whenever a request
process is called
for a connection is detected the <literal>postmaster</literal>
<glossterm linkend="glossary-postmaster">postmaster</glossterm>
process spawns a new server process. The server processes
and listens at a specified TCP/IP port for incoming connections.
communicate with each other using <firstterm>semaphores</firstterm> and
Whenever it detects a request for a connection, it spawns a new
<firstterm>shared memory</firstterm> to ensure data integrity
backend process. Those backend processes communicate with each
throughout concurrent data access.
other and with other processes of the
<glossterm linkend="glossary-instance">instance</glossterm>
using <firstterm>semaphores</firstterm> and
<glossterm linkend="glossary-shared-memory">shared memory</glossterm>
to ensure data integrity throughout concurrent data access.
</para>
</para>
<para>
<para>
@ -141,11 +145,11 @@
</para>
</para>
<para>
<para>
Once a connection is established the client process can send a query
Once a connection is established, the client process can send a query
to the <firstterm>backend</firstterm> (server). The query is transmitted using plain text,
to the backend process it's connected to. The query is transmitted using
i.e., there is no parsing done in the <firstterm>frontend</firstterm> ( client) . The
plain text, i.e., there is no parsing done in the client. The backend
server parses the query, creates an <firstterm>execution plan</firstterm>,
process parses the query, creates an <firstterm>execution plan</firstterm>,
executes the plan and returns the retrieved rows to the client
executes the plan, and returns the retrieved rows to the client
by transmitting them over the established connection.
by transmitting them over the established connection.
</para>
</para>
</sect1>
</sect1>