many children. This parameter can only be set at server start.
</para>
+ <para>
+ This parameter also determines the number of per-backend slots
+ available for <link linkend="locking-tables-fast-path">fast-path
+ locking</link>.
+ </para>
+
<para>
When running a standby server, you must set this parameter to have the
same or higher value as on the primary server. Otherwise, queries
Number of times a lock of this type could not be acquired via fast path
because the fast path slot limit was exceeded. Increasing
<xref linkend="guc-max-locks-per-transaction"/> can reduce this number.
+ See <xref linkend="locking-tables-fast-path"/> for which locks are
+ eligible for fast-path locking; for ineligible lock types this
+ counter is always zero.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
+
+ <sect3 id="locking-tables-fast-path">
+ <title>Fast-Path Locking</title>
+
+ <indexterm zone="locking-tables-fast-path">
+ <primary>fast-path locking</primary>
+ </indexterm>
+
+ <para>
+ Internally, <productname>PostgreSQL</productname> can record some
+ table-level locks using a <firstterm>fast-path locking</firstterm>
+ mechanism instead of the main lock table. This reduces the overhead of
+ acquiring and releasing locks that rarely conflict. It is an
+ implementation optimization and does not change lock semantics.
+ </para>
+
+ <para>
+ Fast-path locking can be used only for eligible relation locks in the
+ weak table-level lock modes <literal>ACCESS SHARE</literal>
+ (<literal>AccessShareLock</literal>), <literal>ROW SHARE</literal>
+ (<literal>RowShareLock</literal>), and <literal>ROW EXCLUSIVE</literal>
+ (<literal>RowExclusiveLock</literal>). It does not apply to shared
+ relations (those visible across all databases, such as
+ <structname>pg_authid</structname>). Other lock types, and stronger
+ lock modes on relations, always go through the main lock table. Even
+ for eligible locks, fast-path is used only when a per-backend slot is
+ available; the number of slots is derived from <xref
+ linkend="guc-max-locks-per-transaction"/>. When no slot is available,
+ the lock is acquired via the main lock table instead.
+ </para>
+
+ <para>
+ Acquiring a lock via the main lock table is considerably more
+ expensive than the fast path, and under heavy concurrent lock
+ activity can become a point of contention (observable as the
+ <literal>LockManager</literal> wait event).
+ </para>
+ </sect3>
</sect2>
<sect2 id="locking-rows">
</para>
<para>
True if lock was taken via fast path, false if taken via main
- lock table
+ lock table (see <xref linkend="locking-tables-fast-path"/>)
</para></entry>
</row>
The <structname>pg_locks</structname> view displays data from both the
regular lock manager and the predicate lock manager, which are
separate systems; in addition, the regular lock manager subdivides its
- locks into regular and <firstterm>fast-path</firstterm> locks.
+ locks into regular and <firstterm>fast-path</firstterm> locks
+ (see <xref linkend="locking-tables-fast-path"/>).
This data is not guaranteed to be entirely consistent.
When the view is queried,
data on fast-path locks (with <structfield>fastpath</structfield> = <literal>true</literal>)