<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gombemi.ccas.gwu.edu/gombemiwiki/index.php?action=history&amp;feed=atom&amp;title=DBDiskSpaceManagement</id>
		<title>DBDiskSpaceManagement - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gombemi.ccas.gwu.edu/gombemiwiki/index.php?action=history&amp;feed=atom&amp;title=DBDiskSpaceManagement"/>
		<link rel="alternate" type="text/html" href="https://gombemi.ccas.gwu.edu/gombemiwiki/index.php?title=DBDiskSpaceManagement&amp;action=history"/>
		<updated>2026-05-27T00:24:39Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.4</generator>

	<entry>
		<id>https://gombemi.ccas.gwu.edu/gombemiwiki/index.php?title=DBDiskSpaceManagement&amp;diff=73&amp;oldid=prev</id>
		<title>KarlPinc: New Page</title>
		<link rel="alternate" type="text/html" href="https://gombemi.ccas.gwu.edu/gombemiwiki/index.php?title=DBDiskSpaceManagement&amp;diff=73&amp;oldid=prev"/>
				<updated>2015-09-29T18:27:22Z</updated>
		
		<summary type="html">&lt;p&gt;New Page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== DB Disk Space Management ==&lt;br /&gt;
&lt;br /&gt;
The queries on this page must be run by an administrative login&lt;br /&gt;
to get a complete picture of disk usage.  When run by a regular&lt;br /&gt;
user the queries will show only the portion of the database to&lt;br /&gt;
which the user has access.&lt;br /&gt;
&lt;br /&gt;
Note that the database uses space not shown in these queries.&lt;br /&gt;
These queries are useful in determining relative disk usage.&lt;br /&gt;
Actual disk usage may vary somewhat.&lt;br /&gt;
&lt;br /&gt;
It may be desirable to modify these queries to change the sort&lt;br /&gt;
order or limit the results returned.&lt;br /&gt;
&lt;br /&gt;
=== Disk Space by Schema (by User) ===&lt;br /&gt;
Use the following query to discover how much space is used per-schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 -- Space used by schema (which user is using space)&lt;br /&gt;
 select pg_namespace.nspname as schema&lt;br /&gt;
       , pg_size_pretty(sum(pg_total_relation_size(pg_class.oid)))&lt;br /&gt;
         as size&lt;br /&gt;
    from pg_class, pg_namespace&lt;br /&gt;
    where pg_class.relnamespace = pg_namespace.oid&lt;br /&gt;
    group by pg_namespace.nspname&lt;br /&gt;
    order by sum(pg_total_relation_size(pg_class.oid)) desc;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disk Space Used by Table ===&lt;br /&gt;
Use the following query to discover how much space is used per-table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 -- Space used by schema (which user is using space)&lt;br /&gt;
 select pg_namespace.nspname as schema&lt;br /&gt;
       , pg_class.relname as table&lt;br /&gt;
       , pg_size_pretty(pg_total_relation_size(pg_class.oid)) &lt;br /&gt;
         as size&lt;br /&gt;
    from pg_class, pg_namespace&lt;br /&gt;
    where pg_class.relnamespace = pg_namespace.oid&lt;br /&gt;
    order by pg_total_relation_size(pg_class.oid) desc;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>KarlPinc</name></author>	</entry>

	</feed>