1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>24.3.Viewing Locks</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="monitoring.html" title="Chapter24.Monitoring Database Activity">
<link rel="prev" href="monitoring-stats.html" title="24.2.The Statistics Collector">
<link rel="next" href="diskusage.html" title="Chapter25.Monitoring Disk Usage">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="monitoring-locks"></a>24.3.Viewing Locks</h2></div></div></div>
<a name="id673120"></a><p> Another useful tool for monitoring database activity is the
<code class="structname">pg_locks</code> system table. It allows the
database administrator to view information about the outstanding
locks in the lock manager. For example, this capability can be used
to:
</p>
<div class="itemizedlist"><ul type="disc">
<li><p> View all the locks currently outstanding, all the locks on
relations in a particular database, all the locks on a
particular relation, or all the locks held by a particular
<span class="productname">PostgreSQL</span> session.
</p></li>
<li><p> Determine the relation in the current database with the most
ungranted locks (which might be a source of contention among
database clients).
</p></li>
<li><p> Determine the effect of lock contention on overall database
performance, as well as the extent to which contention varies
with overall database traffic.
</p></li>
</ul></div>
<p>
Details of the <code class="structname">pg_locks</code> view appear in
<a href="view-pg-locks.html" title="42.37.pg_locks">Section42.37, “<code class="structname">pg_locks</code>”</a>.
For more information on locking and managing concurrency with
<span class="productname">PostgreSQL</span>, refer to <a href="mvcc.html" title="Chapter12.Concurrency Control">Chapter12, <i>Concurrency Control</i></a>.
</p>
</div></body>
</html>
|