postgresql_16:5.1.5 Pipeline Mode
PostgreSQL 16 > Client Interfaces > libpq — C Library > Pipeline Mode
libpq pipeline mode allows applications to send a query without having to read the result of the previously sent query. Taking advantage of the pipeline mode, a client will wait less for the server, since multiple queries/results can be sent/received in a single network transaction.
While pipeline mode provides a significant performance boost, writing clients using the pipeline mode is more complex because it involves managing a queue of pending queries and finding which result corresponds to which query in the queue.
Pipeline mode also generally consumes more memory on both the client and server, though careful and aggressive management of the send/receive queue can mitigate this. This applies whether or not the connection is in blocking or non-blocking mode.
While libpq's pipeline API was introduced in PostgreSQL 14, it is a client-side feature which doesn't require special server support and works on any server that supports the v3 extended query protocol. For more information see (see postgresql_16:8.4.2.4).
Subsections
- postgresql_16:5.1.5.1 Using Pipeline Mode
- postgresql_16:5.1.5.2 Functions Associated with Pipeline Mode
- postgresql_16:5.1.5.3 When to Use Pipeline Mode