Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9bba67aa
Commit
9bba67aa
authored
Jun 13, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to show disk space per db.
parent
4f8795eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
contrib/oid2name/README.oid2name
contrib/oid2name/README.oid2name
+14
-1
No files found.
contrib/oid2name/README.oid2name
View file @
9bba67aa
...
@@ -84,6 +84,7 @@ Oid of table ips from database "test":
...
@@ -84,6 +84,7 @@ Oid of table ips from database "test":
---------------------------------
---------------------------------
18737 = ips
18737 = ips
$ # show disk space for every db object
$ du * | while read SIZE OID
$ du * | while read SIZE OID
> do
> do
> echo "$SIZE `oid2name -q -d test -o $OID`"
> echo "$SIZE `oid2name -q -d test -o $OID`"
...
@@ -92,6 +93,7 @@ $ du * | while read SIZE OID
...
@@ -92,6 +93,7 @@ $ du * | while read SIZE OID
36 18722 = cities
36 18722 = cities
...
...
$ # same as above, but sort by largest first
$ du * | while read SIZE OID
$ du * | while read SIZE OID
> do
> do
> echo "$SIZE `oid2name -q -d test -o $OID`"
> echo "$SIZE `oid2name -q -d test -o $OID`"
...
@@ -101,6 +103,18 @@ $ du * | while read SIZE OID
...
@@ -101,6 +103,18 @@ $ du * | while read SIZE OID
1950 23903 = customers
1950 23903 = customers
...
...
$ # show disk usage per database
$ cd /u/pg/data/base
$ du -s * |
> while read SIZE OID
> do
> echo "$SIZE `aspg oid2name -q | grep ^$OID' '`"
> done |
> sort -rn
2256 18721 = test
2135 18735 = postgres
..
This can be done in psql with: (each page is typically 8k)
This can be done in psql with: (each page is typically 8k)
test=> SELECT relpages, relfilenode, relname FROM pg_class ORDER BY relpages DESC;
test=> SELECT relpages, relfilenode, relname FROM pg_class ORDER BY relpages DESC;
...
@@ -112,4 +126,3 @@ Mail me with any problems or additions you would like to see. Clearing
...
@@ -112,4 +126,3 @@ Mail me with any problems or additions you would like to see. Clearing
house for the code will be at: http://www.crimelabs.net
house for the code will be at: http://www.crimelabs.net
b. palmer, bpalmer@crimelabs.net
b. palmer, bpalmer@crimelabs.net
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment